summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2018-04-25Tweak ordering of constant pdf_obj enums to make PDF_NULL == NULL.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-04-12Update CHANGES and bump version.Tor Andersson
2018-04-11Rework how we handle DynaLab tricky fonts in freetype.Tor Andersson
Force the face_flags to include TRICKY if we detect a DynaLab font name instead of trying to force hinting ourselves.
2018-04-03Android: Scavenge on Bitmap.lockPixels() failure.Robin Watts
If Bitmap.lockPixels fails with an allocation error, scavenge in the store.
2018-04-03Fix VS2008 build.Robin Watts
Ken reports that a VS2008 import of the projects fails with complaints about __restrict whereever stdlib.h is included. Fix the #ifdeffery so that we don't mess with it on VS2008.
2018-03-22Add pdf_add_new_dict family of functions.Tor Andersson
Create a new empty dictionary, add it to the xref and return a new indirect reference object that points to it. This indirect reference needs to be dropped, since it was created with a function using the 'new' keyword.
2018-03-22Add pdf_dict_put_dict family of functions.Tor Andersson
pdf_dict_put_dict creates a new empty dictionary, inserts it into the parent dictionary, and returns a borrowed reference to it. These functions should simplify document creation by removing the need to wrap creation with try/catch for reference counting cleanup.
2018-03-22Add more version number #defines.Tor Andersson
2018-03-22Add fz_output encoding filters.Tor Andersson
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-03-16Simplify PDF font creation code.Tor Andersson
Don't create a useless pdf_font_desc when writing font resources. Simplify reference counting by using fewer intermediate variables.
2018-03-16Add simple fonts with 8-bit greek and cyrillic encodings.Tor Andersson
Use KOI8-U for Cyrillic, and ISO 8859-7 for Greek. Use with 'mutool create' using an extra argument to the %%Font directive: %%Font TmRmC Times-Roman Cyrillic BT /TmRmC 16 Tf 10 10 Td <fa c4 d2 c1 d7 d3 d4 d7 d5 ca d4 c5 21> Tj ET The alternatives are "Latin", "Greek", and "Cyrillic".
2018-03-16Add simple CJK font creation.Tor Andersson
Create a non-embedded CJK font using UTF-16 encoding. This can be used in mutool create like so: %%CJKFont Ming GB1 BT /Ming 10 Tf 100 100 Td <4F60 597D> Tj ET
2018-03-16Add simple functions to create the built-in fonts by name.Tor Andersson
2018-03-16Add simpler annotation line ending style accessors.Tor Andersson
2018-03-16Add annotation quadding accessor.Tor Andersson
2018-03-16Add annotation opacity accessor.Tor Andersson
2018-03-16Don't throw when fz_is_directory is called on a non-existent path.Tor Andersson
2018-03-07Distinguish between simple and CID font resources in cache.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 fz_point for pdf_set_annot_ink_list and vertices too.Tor Andersson
2018-02-27Improve line ending style accessors.Tor Andersson
2018-02-27Add annotation QuadPoints creation functions.Tor Andersson
2018-02-27Add annotation Line access functions.Tor Andersson
2018-02-27Add annotation Vertices creation functions.Tor Andersson
2018-02-27Add annotation InkList creation functions.Tor Andersson
2018-02-27Add fz_expand_irect function.Tor Andersson
2018-02-27Add fz_translate_rect helper function.Tor Andersson
2018-02-27Add convenience functions to create point/rect/matrix.Tor Andersson
In the absence of C99 (fz_rect){0,0,1,1} syntax, this will have to do.
2018-02-27Remove typedef in favor of explicit enum keyword.Tor Andersson
Avoids the silliness of fz_annot_type pdf_annot_type().
2018-02-27Don't use constants larger than will fit in a signed int in enum.Tor Andersson
2018-02-13Add fz_begin_layer/fz_end_layer.Robin Watts
Call these from the PDF interpreter. Make the DisplayList and Trace devices cope. Use these in the SVG output device.
2018-02-12Expose detailed PDF permissions.Tor Andersson
2018-02-12Don't pollute global namespace with __printflike.Tor Andersson
Use a FZ_PRINTFLIKE macro instead.
2018-02-07Fix uninitialised variable warning in fz_peek_bytePaul Gardiner
2018-02-02Signature support: code-style and typo fixesPaul Gardiner
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-02-02Signature support: break out function for obtaining hash bytesPaul Gardiner
2018-02-02Signature support: simplify pkcs7 api by the removal of byte ranges.Paul Gardiner
Rather than provide a stream and an explicitly defined set of byte ranges within that stream, provide a stream that gives access to just the bytes in the ranges.
2018-02-02Generalise the null filter to handle more than a single range.Paul Gardiner
This is needed to simplify the way the bytes for hashing are passed to pkcs7 functions.
2018-02-02Signature support: separate pkcs7 specifics into a separate file.Paul Gardiner
Previously, pdf-pkcs7.c contained mishmash of functions required for creating and checking signatures, with no separation between the parts relating to pdf and those relating to pkcs7. This commit introduces pdf_signature.c which contains the pdf specifics, leaving pdf-pkcs7.c to be purely pkcs7 functions. This should more easily allow the use of pkcs7 solutions other than openssl. The pkcs7 api is declared in pdf-pkcs7.h. It is entirely free of mupdf specifics, other than using an fz_stream to specify the bytes to be hashed.
2018-02-02Signature support: use an enum to report errors.Paul Gardiner
Previously, errors were reported with a boolean function return with a char buffer filled out with the reason in the failure case. Now an enum is used to report the various failure cases. The function pdf_check_signature has been left as is so that existing apps will not need changing.
2018-01-31Add pdf_debug_obj function to quickly print objects from gdb command line.Tor Andersson
2018-01-31Add convenience functions to set dict/array values by primitives.Tor Andersson
2018-01-31Rename confusing fz_stream close callback to drop.Tor Andersson
2018-01-31Add buffering to fz_output.Tor Andersson
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.
2018-01-19Perform document signing via fz_stream and fz_outputPaul Gardiner
This change achieves two goals. It allows signing to be performed even when the document is obtained other than from a disk file. It also reestablishes to a working state signing of file-based documents, a feature that was broken due to complete_signatures being called after certain tables, avaialble via the output options object, had been destroyed.