summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-annot.c
AgeCommit message (Collapse)Author
2018-08-21Fix 699641: Follow Parent chain when looking up DA in annotations.Tor Andersson
The DA property is marked as inheritable for text fields. It is not marked inheritable for FreeText annotations, but I don't believe it will be a problem to treat it as such anyway.
2018-08-10Respect NoRotate flag for icon-based annotations.Tor Andersson
2018-07-06Add pdf_dict_get_rect and pdf_dict_get_matrix helpers.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-05Support background and border color in Widget/Tx and Widget/Ch.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-06-22Tokenize on all whitespace when parsing DA string.Tor Andersson
2018-06-22Use fz_quad type in structured text and selection/highlighting.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-01Fix loss of reference to focussed annotation when rereading annotationsPaul Gardiner
2018-04-27Use pdf_dict_get_int, etc.Tor Andersson
2018-04-24Remove need for namedump by using macros and preprocessor.Tor Andersson
Add a PDF_NAME(Foo) macro that evaluates to a pdf_obj for /Foo. Use the C preprocessor to create the enum values and string table from one include file instead of using a separate code generator tool.
2018-03-22Use PDF object creation convenience functions.Tor Andersson
Use pdf_dict_put_* convenience functions. Use pdf_dict_get instead of pdf_dict_gets with constant strings.
2018-03-22Clean up windows ifdefs.Tor Andersson
_WIN32 is always defined on windows (it means the WinAPI is available). _WIN64 is also defined on 64-bit targets. This means the test for defined(_WIN32) || defined(_WIN64) is redundant, since if _WIN64 is defined, then _WIN32 is always also defined. MSC_VER is only defined for MSVC, so split the ifdef sections in include/fitz/system.h into separate MSVC and WIN32 parts so that we can build with MinGW and other non-MSVC compilers on windows.
2018-03-22Load most annotations, even if they are missing appearances.Tor Andersson
Filter out Link and Popup annotations. Links are not comments, popup annotations are auxiliary information for other annotations, so neither of these types should be present in our list of annotations, but all other annotations should be there, whether they have appearance streams or not. Ensure has_new_ap is zero when first loaded, and changed if either the active AP object is changed or the current AP content stream is updated.
2018-02-27Remove pdf_xobject wrapper struct.Tor Andersson
Just use the pdf_obj directly. Revise ap_iteration and split annot->dirty into separate flags. One flag for needs_new_ap, and one for has_new_ap (to be used by clients who may have cached a rendered annotation).
2017-11-22jni: Make sure to dirty annotation whenever it changes.Fred Ross-Perry
2017-09-07Initialize variables to appease clang scan-build.Sebastian Rasmussen
2017-06-22Add const to pdf_toname.Tor Andersson
2017-06-16Plug leak of uri if creating link fails.Sebastian Rasmussen
2017-04-27Include required system headers.Tor Andersson
2017-04-13Fix 697725: silly typo when parsing GoToR destination.Tor Andersson
2017-04-11Bug 697662: Support named actions to first/last/next/previous page.Sebastian Rasmussen
2017-03-28Rejig fz_new_annot to fz_new_derived_annot.Robin Watts
More consistent with the rest of the code.
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-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-14pdf: Use URI dictionary for relative URIs.Tor Andersson
2016-11-14Add/fix page coordinates to link targets.Tor Andersson
Correctly transformed target coordinates for PDF. Target coordinates for EPUB and HTML.
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-18Avoid checking argument to fz_drop_*()/fz_free().Sebastian Rasmussen
As fz_drop_*()/fz_free() all must handle NULL.
2016-10-16Avoid casting when dropping super objects.Sebastian Rasmussen
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-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-07-08Separate close and drop functionality for devices and writers.Tor Andersson
Closing a device or writer may throw exceptions, but much of the foreign language bindings (JNI and JS) depend on drop to never throw an exception (exceptions in finalizers are bad).
2016-07-08Slim pdf_xobject struct: remove cached matrix field.Tor Andersson
2016-07-08Slim pdf_xobject struct: remove cached bbox field.Tor Andersson
2016-07-08Slim pdf_annot struct: remove cached page_ctm field.Tor Andersson
2016-07-08Slim pdf_annot struct: remove cached inv_page_ctm field.Tor Andersson
2016-07-08Slim pdf_annot struct: remove cached annot_type and widget_type fields.Tor Andersson
2016-07-08Slim pdf_annot struct: remove cached matrix field.Tor Andersson
2016-07-08Slim pdf_annot struct: remove cached rect field.Tor Andersson
2016-07-08Slim pdf_annot struct: remove cached pagerect field.Tor Andersson
2016-07-06Start slimming pdf_page.Tor Andersson
We want to turn pdf_page into a thin wrapper around a pdf_obj, so that any updates to the underlying PDF objects will be reflected without having to reload the pdf_page.
2016-07-06pdf: Drop generation number from public interfaces.Tor Andersson
The generation number is only needed for decryption, and is assumed to be zero or irrelevant for all other uses. Store the original object number and generation in the xref slot, so that we can decrypt them even when the objects have been renumbered, without needing to pass the original object number around through the stream loading APIs.