summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2018-11-13Use fz_image.imagemask field when adding PDF image resources.Tor Andersson
Don't pass the information as a separate argument.
2018-11-12Remove bitrotted and not working PDF portfolio code.Tor Andersson
Extracting embedded files can be trivially done with 'mutool show' or a simple mutool run script. The portfolio creation code is incomplete, and would require a lot of work and testing with Adobe in order to be useful.
2018-11-12Clean up pdf-portfolio.cTor Andersson
Remove pointless paranoia checks. Move the check whether it has already been loaded into load_portfolio().
2018-11-12Fix 697728: Use UTF-8 strings in PDF portfolio functions.Tor Andersson
2018-11-12Fix 697687: Use #if rather than #ifdef HAVE_SIGSETJMP.Tor Andersson
Allows to turn it off with make XCFLAGS=-DHAVE_SIGSETJMP=0 or by adding -DHAVE_SIGSETJMP=0 to the relevant Makerules section.
2018-11-12Remove confusing flag define.Tor Andersson
What's the difference between PDF_OBJ_FLAG_MARK and PDF_FLAGS_MARKED? PDF_OBJ_FLAG_MARK is used to flag an xref entry as one that we want to keep cached with the pdf_mark_xref/pdf_clear_xref_to_mark functions. PDF_FLAGS_MARKED is used to detect unwanted recursion in PDF structures. Renaming the xref_entry.flags field to xref_entry.marked should remove this source of potential confusion.
2018-11-07Add explicit jmp_buf dereferencing to allow using fz_try from C++.Tor Andersson
2018-11-07Fix 700053: Add 'decrypt' option to pdf_save_document.Tor Andersson
This option is exposed as the -D flag to mutool clean. Allow saving a document without encryption. The next step is to allow saving a document with new encryption, but this may require a fair amount of rejigging since the PDF write code to keep separate doc->crypt objects for decryption and encryption.
2018-10-26Rewrite try/always/catch macros to allow fz_context to be opaque.Tor Andersson
Hide fz_stack_slot and exception handling details too. Also make sure we have an initialized jmp_buf so we can safely throw from the always block even in the exception stack overflow case.
2018-10-25Handle premultiplied alpha in pixmap color conversions (CMYK only).Tor Andersson
2018-10-25Add and use fz_convert_pixmap_samples helper function.Tor Andersson
2018-10-25Make alpha channel unmultiply and premultiply utility functions public.Tor Andersson
2018-10-25Rename NO_ICC to FZ_ENABLE_ICC=0|1 to match other config.h options.Tor Andersson
2018-10-23Remove extra blank lines.Tor Andersson
2018-10-23Fix FZ_ENABLE_SPOT_RENDERING config.h ifdeffery.Tor Andersson
2018-10-23Add Emscripten / WebAssembly build.Tor Andersson
Requires Linux (or possibly MacOS X) and an installed emsdk to build.
2018-10-23Add fz_write_pixmap_as_data_uri helper function.Tor Andersson
Also include "data:" schema in the data uri for fz_write_image_as_data_uri.
2018-10-23Allow SVG output to keep ID numbers unique across pages.Tor Andersson
This is required if embedding multiple SVG documents in a web page, for example.
2018-09-25Bump version number to 1.14.0Tor Andersson
2018-09-21Add fz_lookup_cjk_font_by_name to create builtin CJK fonts.Tor Andersson
2018-09-21Regularize language and script names.Tor Andersson
Drop the unused 'serif' argument to the CJK lookup functions. Use the BCP 47 names for CJK scripts and languages: zh-Hant for traditional Chinese, zh-Hans for simplified Chinese, ja for Japanese, ko for Korean. The lookup function also allows commonly used language+country codes: zh-TW and zh-HK for traditional Chinese, zh-CN for simplified Chinese.
2018-09-20Be consistent in use of #if FZ_ENABLE_...Robin Watts
Using #ifdef FZ_ENABLE_ means we build code in, even if we have defined FZ_ENABLE_WHATEVER to be 0 (as we do in config.h).
2018-09-19Add accessor for field text label.Tor Andersson
2018-09-19Make fz_page objects singleton.Tor Andersson
Keep a list of currently open pages for each document. Attempting to load a page that is already loaded will return the same instance again.
2018-09-13Make naming of effective overprint argument consistent.Sebastian Rasmussen
2018-09-05Add fz_new_stext_page_from_annot utility function.Tor Andersson
2018-09-05Use colorspace type enum instead of magic profile names.Tor Andersson
2018-08-28Avoid use of fixed size buffers for the digest when document signingPaul Gardiner
The signer object now has an extra method that informs the caller of the maximum size the digest might be. This is used to allocate space for the digest within the file and to size some of the buffers used in the code. The openssl-based inplementation of the signer object has been updated to perform a test digest generation so as to find the size needed. We believe that the digest size is indendent of the hashed data.
2018-08-22Remove the old 'nested depth' tracking.Tor Andersson
This was used to prevent infinite cycles in the Type3 font CharProcs, but the previous commits forbids all cycles in order to prevent memory leaks due to cyclic reference counts.
2018-08-10The proper term is apparently 'filename extension', not 'suffix'.Tor Andersson
2018-08-10Use proper name space for form field flag constants.Tor Andersson
2018-08-10Remove functions that implement duplicate functionality.Tor Andersson
pdf_get_inheritable also looks in trailer/Root/AcroForm for missing keys, but this behavior is not supported by anything in the specification.
2018-08-10Clean up null/range/endstream filter.Tor Andersson
Use separate functions to keep the code simpler. Use memmem to simplify and optimize search for 'endstream' token. Do not look for 'endobj' since that could cause a false positives in compressed object streams that have duff lengths.
2018-08-10Add fz_memmem function taken from musl libc.Tor Andersson
2018-08-10Rejig pdf_update_page and pdf_update_annot.Tor Andersson
The intent is for a user to iterate over the annotations on a page calling pdf_update_annot for each one. If this function returns true, then the annotation has changed since the last time it was called, and the user needs to re-render. pdf_update_page is a simple loop over the annotations on a page, for use if you only care about page level granularity. Users should no longer look at or change the pdf_annot.has_new_ap field.
2018-07-17Disallow incremental updating for documents that have hybrid xrefsPaul Gardiner
Alter pdf_can_be_saved_incrementally to return false when a hybrid xref file has been opened. This doesn't enforce the behaviour, but will ensure it for apps that determine their behaviour via this test function. Once changes have been saved to such a file, it is no longer hybrid and so further saving steps can use incremental updates. This change was made because we were previously unable to sign hybrid xref documents in a way that was satisfactory to Adobe Reader. Adobe Reader reorganises hybrid xref files, thus invalidating any signature.
2018-07-17Fix memory leaks in document signing functionsPaul Gardiner
2018-07-06Bug 699308: Fix stream reading logic to better cope with duff Lengths.Robin Watts
Always look for the "endstream" marker after a PDF stream to see if we've hit the end. Allow for "endobj" to cope with producers that omit endstream entirely. Avoid slowing down legal files by only checking for the end marker after the specified length has been read.
2018-07-06Add pdf_dict_get_rect and pdf_dict_get_matrix helpers.Tor Andersson
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-05Add fz_transform_page helper function.Tor Andersson
Create a matrix that transforms a page with resolution and rotation, and grid fits the resulting bounding box.
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-05Return true if any annots have new APs in pdf_update_page.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-04Add fz_snap_selection function to snap selection to chars/words/lines.Tor Andersson
Updates the input point coordinates, and also returns a quad with appropriate UI handles.
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.