summaryrefslogtreecommitdiff
path: root/source/pdf
AgeCommit message (Collapse)Author
2016-11-23Fix pdf-write bug when ascii encoding.Robin Watts
2016-11-22Rearrange CMap resources. Only include the ones that are used.Tor Andersson
Silences unused variable warnings on gcc.
2016-11-22Fix const compiler warning.Sebastian Rasmussen
2016-11-21Fix a few cases where pdf_unmark_obj wasn't always being called on errors.Tor Andersson
2016-11-21Harden viewers against failures when loading outlines.Tor Andersson
Ignore invalid page references in outlines. This was shown by a file that had [null 0 0 1] as a link dest. Attempting to parse that threw an error, which caused the whole outline load to fail.
2016-11-17Rename openssl flags to libcrypto.Sebastian Rasmussen
Only libcrypto is used to do checking of digital signatures. The SSL library openssl is never used.
2016-11-16pdf: Add x and y output parameters to pdf_lookup_anchor.Tor Andersson
2016-11-16pdf: Use '#page=N' for remote destination pages.Tor Andersson
As per Adobe's recommendation: https://helpx.adobe.com/acrobat/kb/link-html-pdf-page-acrobat.html
2016-11-16pdf: Add 'compressed/raw' flag to pdf_add_stream.Tor Andersson
Also expose the argument to JS and JNI.
2016-11-14pdf: Don't pass form UI events to link annotations.Tor Andersson
Don't try handling them both as links and form widgets.
2016-11-14pdf: Use URI dictionary for relative URIs.Tor Andersson
2016-11-14Fix return in void function.Tor Andersson
2016-11-14Continued Layer API work.Robin Watts
Hide pdf_is_hidden_ocg from the public interface. Ensure that RBGroups and Order properly fall back to the default entries if they are missing in the OCCDs. Add pdf_set_layer_config_as_default. This sets the default layer config to be current one. This destroys the current default dictionary, but we leave the other configs intact.
2016-11-14Make fz_buffer structure private to fitz.Robin Watts
Move the definition of the structure contents into new fitz-imp.h file. Make all code outside of fitz access the buffer through the defined API. Add a convenience API for people that want to get buffers as null terminated C strings.
2016-11-14Add/fix page coordinates to link targets.Tor Andersson
Correctly transformed target coordinates for PDF. Target coordinates for EPUB and HTML.
2016-11-14Add optional 'object' argument to pdf_add_stream.Tor Andersson
2016-11-11Add pdf_layer configuration API.Robin Watts
Add API to: * allow enumeration of layer configs (OCCDs) within PDF files. * allow selection of layer configs. * allow enumeration of the "UI" (or "Human readable") form of layer configs. * allow selection/toggling of entries in the UI.
2016-11-07Default background of luminosity masks should be black.Robin Watts
In CMYK groups this is NOT the same as "all components 0". This improves the rendering of Bug689931a.pdf
2016-11-03Fix signed/unsigned and size_t/int/fz_off_t warnings.Robin Watts
All seen in MSVC, mostly in 64bit builds.
2016-11-02Use pdf_annot_border to get the border width of an annotation.fred ross-perry
2016-11-02Fix 697284: The origin was incorrectly calculated for rotated pages.Tor Andersson
2016-11-01When hinted object is not found, avoid return from within fz_try().Sebastian Rasmussen
2016-10-28Clean up link destination handling.Tor Andersson
All link destinations should be URIs, and a document specific function can be called to resolve them to actual page numbers. Outlines have cached page numbers as well as string URIs.
2016-10-21Clean up pdf_add_image to handle unknown image formats more robustly.Tor Andersson
2016-10-21Clean up FZ_IMAGE_XXX enums and purge unused FZ_IMAGE_JBIG2.Tor Andersson
2016-10-19Rename internal headers to follow pattern *-imp.h.Sebastian Rasmussen
2016-10-18Internal drop functions don't need to check for NULL.Sebastian Rasmussen
2016-10-18All external drop functions handles NULL.Sebastian Rasmussen
2016-10-18Avoid checking argument to fz_drop_*()/fz_free().Sebastian Rasmussen
As fz_drop_*()/fz_free() all must handle NULL.
2016-10-18Remove unused luminosity.Sebastian Rasmussen
2016-10-16Avoid casting when dropping super objects.Sebastian Rasmussen
2016-10-13crypt: Handle null pointer when dropping crypt object.Sebastian Rasmussen
Exposed by weird-jpx.pdf from bug 696885.
2016-10-12Fix (harmless) typo in function prototypes.Tor Andersson
2016-10-12Always call fz_drop_document() to drop the document.Sebastian Rasmussen
2016-10-11Free document in fz_drop_document(), not in subclassing documents.Sebastian Rasmussen
2016-10-07Add ctx to fz_font functions.Robin Watts
2016-10-07pdf: Support UTF-8 encoded text strings.Tor Andersson
New in PDF 2.0.
2016-10-07pdf: Separate functions to read text strings and text streams as UTF-8.Tor Andersson
The stream loading is used only by the JS code loading.
2016-10-07pdf: Remove unneccessary document argument to pdf_to_utf8 etc.Tor Andersson
2016-10-07Add annotation editing functions and clean interface of existing ones.Tor Andersson
2016-10-07Remove separate tmp/deleted/changed annotation lists.Tor Andersson
Use a flag in the pdf_annot struct instead. Don't pass pdf_document to annotation edit functions.
2016-10-06Hide internals of fz_colorspaceRobin Watts
The implementation does not need to be in the public API.
2016-10-06Update Xref reading code to cope with 19 byte entries.Robin Watts
The spec says entries should be 20 bytes long. In practise we see 19 byte long ones more often than we like. This is due to the use of a single EOL char rather than 2. The PCLm files I've seen use 19 byte ones, so update the code to cope with these.
2016-10-05Move fz_font definition to be private.Robin Watts
Move the definition of fz_font to be in a private header file rather than in the public API. Add accessors for specific parts of the structure and use them as appropriate. The font flags, and the harfbuzz records remain public. This means that only 3 files now need access to the font implementation (font.c, pdf-font.c and pdf-type3.c). This may be able to be improved further in future.
2016-09-26Fix memory leak when opening html/loading raw stream.Sebastian Rasmussen
2016-09-23Fix leak in error case of pdf_add_stream.Robin Watts
2016-09-23Clean up annotation enum names.Tor Andersson
Put them in the PDF name space and separate words with underscores. Remove redundant namespace prefixes in java constants. Device.FLAG_MASK rather than Device.FZ_DEVFLAG_MASK. Use namespace for PDF annotation flag enum.
2016-09-22Bug 697015: Avoid object references vanishing during repair.Robin Watts
A PDF repair can be triggered 'just in time', when we encounter a problem in the file. The idea is that this can happen without the enclosing code being aware of it. Thus the enclosing code may be holding 'borrowed' references (such as those returned by pdf_dict_get()) at the time when the repair is triggered. We are therefore at pains to ensure that the repair does not replace any objects that exist already, so that the calling code will not have these references unexpectedly invalidated. The sole exception to this is when we replace the 'Length' fields in stream dictionaries with the actual lengths. Bug 697015 shows exactly this situation causing a reference to become invalid. The solution implemented here is to add an 'orphan list' to the document, where we put these (hopefully few, small) objects. These orphans are kept around until the document is closed.
2016-09-19fz_store: Reap passes.Robin Watts
A few commits back, we introduced the fz_key_storable concept to allow us to cope with objects that were used both as values within the store and as parts of keys within the store. This commit worked, but showed up performance problems; when the store has several million PDF objects in it, bulk changes (such as dropping a display list or document) could trigger many passes across the store. We therefore introduce a mechanism to ameliorate this. These passes, now known as "reap passes", can be batched together using fz_defer_reap_start and fz_defer_reap_end. We trigger this start/end around display list dropping, and around PDF content stream processing. This should be fine, as deferral will be interrupted if we ever run our of memory during mallocing.
2016-09-16Remove unused variable.Robin Watts