summaryrefslogtreecommitdiff
path: root/source/pdf
AgeCommit message (Collapse)Author
2018-07-05Fix document signing adding unnecessary incremental updatesPaul Gardiner
When a document is signed multiple times, an incremental update is needed for each, the multiple updates sometimes written to the file as a single saving operation. Within pdf_sign_signature it is the call to pdf_signature_set_value that marks the current section of the xref to which changes are recorded as "full", so that subsequent changes will trigger the creation of a new section. Within pdf_sign_signature we were creating the signature's appearance stream after the call to pdf_signature_set_value and hence triggering an extra unnecessary setction. This commit moves the pdf_signature_set_value to after the creation of the appearance stream, so that we need only as many new xref sections as there are signings.
2018-07-05Add digital signature appearance synthesis.Tor Andersson
The pdf_update_signature_appearance function must be called directly by the signing code when it signs the document; as only the signing code has all the text that needs to be written into the appearance.
2018-07-05Purge unused functions.Tor Andersson
2018-07-05Pass rects by value: device and document interface.Tor Andersson
2018-07-05Pass matrices by value: device and document interface.Tor Andersson
2018-07-05Pass rect and matrix by value in geometry functions.Tor Andersson
Several things irk me about passing values as const pointers: * They can be NULL, which is not a valid value. * They require explicit temporary variables for storage. * They don't compose easily in a legible manner, requiring weird pointer passing semantics where the variable being assigned is hidden as an argument in the innermost function call. * We can't change the value through the pointer, requiring yet more local variables to hold copies of the input value. In the device interface where we pass a matrix to a function, we often find ourselves making a local copy of the matrix so we can concatenate other transforms to it. This copying is a lot of unnecessary busywork that I hope to eventually avoid by laying the groundwork with this commit. This is a rather large API change, so I apologize for the inconvenience, but I hope the end result and gain in legibility will be worth the pain.
2018-07-05Add stack traces to JS error messages.Tor Andersson
2018-07-05Fix bug in util.js: padZeros is a local function.Tor Andersson
2018-07-05Return true if any annots have new APs in pdf_update_page.Tor Andersson
2018-07-05Use separate X and Y text padding in text appearance streams.Tor Andersson
2018-07-05Use real WinAnsi encoding when writing appearance stream text.Tor Andersson
2018-07-05Support background and border color in Widget/Tx and Widget/Ch.Tor Andersson
2018-07-04Fix bugs in triggering has_new_ap update.Tor Andersson
* Trigger correctly on AS state changes. * Handle the case when there is no AP (such as for unchecked checkboxes): - Don't try to create Widget/Btn streams. - Don't flag/unflag when AP synthesis throws.
2018-07-04Don't forget to resolve indirect references when clearing dirty flag.Tor Andersson
2018-07-04Rename pdf_get_annot_contents to pdf_annot_contents.Tor Andersson
Since the function no longer returns ownership of the string, use the common naming convention.
2018-07-04Allow for CIDToGIDMap in font being "/Identity".Robin Watts
Previously we would have tripped over this, thrown an error and aborted loading the whole page. Any non-stream, non "Identity" CIDToGIDMaps now produce a warning rather than an error so we don't stop processing the entire page.
2018-06-22Avoid leaking reference to "form" object.Robin Watts
2018-06-22Improve reference handling.Robin Watts
2018-06-22Tokenize on all whitespace when parsing DA string.Tor Andersson
2018-06-22Size singleline widget text to fit both width and height.Tor Andersson
2018-06-22Use fz_quad type in structured text and selection/highlighting.Tor Andersson
2018-06-22Create appearance streams for Comb text fields.Tor Andersson
2018-06-22Keep copy of decoded utf8 text string in pdf_obj.Tor Andersson
Removes the need to alloc/free text strings in the API, allowing for simple functions like pdf_dict_get_text_string.
2018-06-22Look up DA in Root/AcroForm/DA if missing in annotation property.Tor Andersson
2018-06-22Merge pdf-annot.c and pdf-annot-edit.c (2/2).Tor Andersson
2018-06-22Merge pdf-annot.c and pdf-annot-edit.c (1/2).Tor Andersson
2018-06-22Move link code to pdf-link.c.Tor Andersson
2018-06-22Fix error check in AFPercent_Format to look for null rather than false.Tor Andersson
The number 0 is a valid percentage number.
2018-06-22Call AA/F formatting when synthesizing appearance stream.Tor Andersson
2018-06-22Use line spacing and padding when creating variable text appearance.Tor Andersson
Format single-line Widget/Tx fields vertically centered.
2018-06-22Support annot/MK/R property in Tx and Ch widget annotations.Tor Andersson
2018-06-22Support undocumented annot/Rotate property in FreeText annotations.Tor Andersson
2018-06-22Remove rich text properties when editing annotation contents or styles.Tor Andersson
We do not support rich text content; remove the properties rather than leave them untouched and out of sync with the simple contents and styles.
2018-06-22Use /Tx BMC ... EMC when creating text widget appearance streams.Tor Andersson
2018-06-22Support rotated QuadPoints when generating markup annotation appearances.Tor Andersson
2018-06-22Create appearance streams for annotations.Tor Andersson
Now handles more annotation types, and does not use the pdf-write device. Handles many of the usual annotation properties, such as border width, color, interior color, line ending styles. * Ink * Highlight, Underline, Strike-Out, Squiggly * Line (with arrow-heads) * Polygon * PolyLine * Square * Circle * Caret * Text (needs better icons) * FileAttachment (needs better icons) * Sound (needs better icons) * Stamp * FreeText Partially complete: * Widget (treats everything like a plain text field) Not done, but on the to-do list: * /BS style (solid/dashed/bevel/inset/underline) * /BS dash pattern Not done and not on the list: * Movie * Screen * Printer's Mark * Trap Network * Watermark * /Border corner radii (ignored by acrobat) * /BE cloudy border effect
2018-06-22Remember the md5 digest in the fz_font struct.Tor Andersson
2018-06-22Add pdf_dict_get_name function.Tor Andersson
2018-06-21Allow signature saving using pdf_write_documentPaul Gardiner
It is safe to save a document with unsaved signatures to an fz_output, provided it supports fz_stream_from_output.
2018-06-12Run both V and F additional actions when setting field values.Tor Andersson
2018-06-02Rework XObject form creation/updating.Tor Andersson
2018-06-01Fix loss of reference to focussed annotation when rereading annotationsPaul Gardiner
2018-05-18Fix 699368: Remember 'sent' text state in sanitize filter.Tor Andersson
2018-05-16Remove unused variable.Tor Andersson
2018-05-16Keep JBIG2 image data compressed in fz_compressed_buffer.Tor Andersson
2018-05-16Remove needless deep copy of resource dictionary.Tor Andersson
Also don't bother adding an indirect object for the top resource dict.
2018-05-16Purge unused functions.Tor Andersson
2018-05-15Bug 699351: Handle glyphs with uncomputable width.Sebastian Rasmussen
Previously if a glyphs units per em was 0 we'd try to divide by zero, now mupdf assumes a default value and continues.
2018-05-11Fix 699332: Copy resources when cleaning content streams.Sebastian Rasmussen
Previously if both cleaning and sanitizing content streams the pages' resource dictionaries would retain the actually used resources. If the content streams were only cleaned and not sanitized the page's resource dictionaries were incorrectly emptied. All resources, whether used or not, ought to be retained, as is the case after this commit.
2018-05-09Flesh out some more javascript convenience objects.Tor Andersson
Add some missing convenience data objects: font, highlight, position, etc. Add color.convert and color.equal functions.