summaryrefslogtreecommitdiff
path: root/platform/x11/pdfapp.c
AgeCommit message (Collapse)Author
2018-07-05Signature support: add signing support to the windows appPaul Gardiner
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-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-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-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-07Fix 699081: Missing coordinate transformation when copying text.Tor Andersson
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).
2018-02-27Use text encoding for pdf_choice_widget options and values.Tor Andersson
Adds a requirement on the caller to free the returned strings.
2018-02-02Signature support: add a null pdf_check_signature functionPaul Gardiner
Add a version of pdf_check_signature function that reports no support, for builds without openssl. This allows the removal of ifdefs from the apps.
2018-02-02Signature support: decouple mupdf from the pkcs7 implementationPaul Gardiner
The mupdf build included an implimentation of the pkcs7 functions that are needed for signing documents and verifying signatures, the implementation being either an openssl-based one, or a stub that returned errors. This commit removes the pkcs7 functions from the main mupdf library. For the sake of verification, there wasn't really a need for the pkcs7 functions to be part of mupdf. It was only the checking function that used them. The checking function is now provided as a helper, outside of the main build. The openssl-based pkcs7 functions area also supplied as a helper. Users wishing to verify signatures can either use the checking function directly, or use the source on which to base their own. Document signing requires more integration between mupdf and pkcs7 because part of the process is performed at time of signing and part when saving the document. Mupdf already had a pdf_pkcs7_signer object that kept information between the two phases. That object has now been extended to include the pkcs7 functions involved in signing, and the signing function now requires such an object, rather than a file path to a certificate. The openssl-based pkcs7 helper provides a function that, given the path to a certificate, will return a pdf_pkcs7_signer object. The intention is that different implementations can be produced for different platforms, based on cryptographic routines built into the operationg system. In each case, for the sake of document signing, the routines would be wrapped up as a pdf_pkcs7_signer object.
2018-01-19Perform signature verification via fz_streamPaul Gardiner
Previously, signature verification worked only for file-based documents and the file path had to be passed into the verification function.
2017-11-22jni: Make sure to dirty annotation whenever it changes.Fred Ross-Perry
2017-11-01Use int64_t for public file API offsets.Tor Andersson
Don't mess with conditional compilation with LARGEFILE -- always expose 64-bit file offsets in our public API.
2017-09-07Make sure to always drop a fz_device even upon error.Sebastian Rasmussen
2017-08-21Remove redundant fz_stext_char_bbox function.Tor Andersson
2017-08-17Simplify stext structure and device.Tor Andersson
* Use pool allocator and linked lists for all levels. * Remove separate fz_stext_sheet struct. * Remove unused 'script' style. * Remove 'span' level items. * Detect visual/logical RTL layouts. * Detect indented paragraphs.
2017-07-19Add spots to fz_pixmaps.Robin Watts
Update separations interface further to cope with whether spots should be rendered separately, or as composite colors.
2017-07-06pdfapp: Warn when outline fails to load.Sebastian Rasmussen
2017-07-06pdfapp: Handle PDF javascript not loading.Sebastian Rasmussen
2017-05-31Avoid double literals causing casts to float.Sebastian Rasmussen
2017-05-04Drop FZ_PATH_MAX macro.Tor Andersson
Define PATH_MAX in the few files that use it, should it be missing.
2017-04-27Include required system headers.Tor Andersson
2017-03-29Happy New Year!Sebastian Rasmussen
2017-03-22Always use %g for short-as-possible format character.Tor Andersson
Call fz_append_string instead of fz_append_printf for static strings. Call fz_write_string instead of fz_write_printf for static strings.
2017-03-22Rename fz_putc/puts/printf to fz_write_*.Tor Andersson
Rename fz_write to fz_write_data. Rename fz_write_buffer_* and fz_buffer_printf to fz_append_*. Be consistent in naming: fz_write_* calls write to fz_output. fz_append_* calls append to fz_buffer. Update documentation.
2016-12-27Strip extraneous blank lines.Tor Andersson
2016-12-23Remember to stroke the graphics in the fake document.Sebastian Rasmussen
Additionally clean up the objects created for the fake document along with the document itself and report error to the caller by return code, not by using an exception.
2016-12-22When document reloading fails, do not leak filename.Sebastian Rasmussen
2016-11-23Add 'X' option to disable document styles.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-16Fix 697334: disable text input in x11 viewer permanently.Tor Andersson
The hacky stdin workaround has never worked satisfactorily. Just nuke it.
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-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-26Update ios/android to use new way of passion stext options.Sebastian Rasmussen
In addition, make all callers passing 0 as a point pass NULL instead.
2016-10-18Avoid checking argument to fz_drop_*()/fz_free().Sebastian Rasmussen
As fz_drop_*()/fz_free() all must handle NULL.
2016-10-16Only check digital signature when mouse button is released.Sebastian Rasmussen
2016-10-10Bug 697094: Disable viewer text input on linux.Robin Watts
Only Windows and Android have form filling text input implemented properly so far. Neither of those build using the Makefile. We therefore disable text input in Makefile built viewers.
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-08Use fz_vsnprintf() in x11 viewer.Sebastian Rasmussen
2016-09-08Add options to control heuristics in structured text.Sebastian Rasmussen
2016-09-08Handle too big pixmap by printing error message in X11 viewer.Sebastian Rasmussen
2016-07-14x11: Update x11/win32 viewer for fz_close_device changes.Tor Andersson
2016-07-13Bug 696699: Fix Text extraction mediabox information.Robin Watts
Since the removal of the begin_page device function, structured text extraction has been unable to correctly establish the mediabox for extracted pages. Update the fz_new_stext_page call to take this mediabox information. This is an API change, but hopefully most people are calling fz_new_stext_page_from_page or fz_new_stext_page_from_display_list which are updated here to cope. Update all the apps/tools to behave properly.
2016-07-08Slim pdf_annot struct: remove cached annot_type and widget_type fields.Tor Andersson
2016-07-06x11: Fix segfault when creating presentation transitions.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.