summaryrefslogtreecommitdiff
path: root/source/tools
AgeCommit message (Collapse)Author
2018-03-22Use pdf_add_new_dict family of functions.Tor Andersson
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-22Fix 699130: Handle missing arguments in directives in mutool create.Sebastian Rasmussen
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-02-27Use fz_point for pdf_set_annot_ink_list and vertices too.Tor Andersson
2018-02-27Add annotation Vertices creation functions.Tor Andersson
2018-02-27Fix bug in pdfshow (confusion between indirect/resolved streams).Tor Andersson
2018-02-13Add JNI and JS bindings to layer device calls.Tor Andersson
2018-02-13mutool extract: Don't save raw CMYK jpegs when the -r flag is enabled.Tor Andersson
2018-02-08Add 'null' output device so we can remove NULL checks in hot functions.Tor Andersson
2018-02-06Remove duplicated help string from mudraw.Sebastian Rasmussen
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-31Use convenience pdf dictionary/array creation functions.Tor Andersson
2018-01-29Bug 698908: Plug PDF object leaks when decimating pages in pdfposter.Sebastian Rasmussen
The bug reports a buffer overflow, but after that was fixed this leak was reported by ASAN.
2018-01-29If drawing to one file per page in mudraw, don't use append mode.Sebastian Rasmussen
Opening in append mode was used before commit c4d3a9142761a567fce9f66946a917e087c0de67 when the same file was reopened multiple times for formats that support it. Nowadays the files is only opened once anyway so there is no reason to use append mode.
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-10Add colorspace type enum and use it instead of hardcoded checks on N.Tor Andersson
2018-01-04Update 'mutool run' man page.Tor Andersson
2017-12-13Add 'clean' option to pdfclean to clean (but not sanitize) content streams.Tor Andersson
This goes well with the 'mutool clean -d' decompression option to debug content streams, without doing the sanitize optimization pass.
2017-11-22jni/js: Add support for annotation modification dates.Sebastian Rasmussen
2017-11-22jni/js: Use correct text encoding in annotation author and contents.Fred Ross-Perry
Also clarify that a copy of author/contents is returned, and that the caller must free them.
2017-11-22jni/js: Add interfaces for creating UTF-16BE and PDF byte strings.Sebastian Rasmussen
This mirrors the existing PDFObject.asByteString().
2017-11-22jni: Return correct quadpoints coordinates.Sebastian Rasmussen
2017-11-22jni: Return correct inklist coordinates.Sebastian Rasmussen
2017-11-22js: Return undef when not finding metadata.Sebastian Rasmussen
Previously when metadata was not found mupdf still tried to return a string to the caller, but the string was uninitialized.
2017-11-22Prefer using fz_snprintf over snprintf.Sebastian Rasmussen
This way the MuPDF library itself only uses fz_snprintf for consistent formatting.
2017-11-08Bug 698460: Mudraw: Set stdout to binary on windowsRobin Watts
2017-11-08Select and copy structured text by lines.Tor Andersson
2017-11-08Bug 698467: Honour resolution in text extraction.Robin Watts
This affects the given character bboxes.
2017-11-08Use fz_snprintf in preference to snprintf.Robin Watts
If nothing else, this avoids warnings on VS2005.
2017-11-08Fix TGA banded operation.Robin Watts
Also, fix mudraw messages about what types can be banded.
2017-11-08Pixmap writers for formats with alpha should handle premultiplied data.Robin Watts
Any pixmap writers that can handle data with an alpha plane should accept that data in premultiplied form, and write it out appropriately for the file format. This avoids the need to unpremultiply data in mudraw, and solves the issue we were seeing where we want the png writer to be able to cope with premultiplied data (such as for the debug blending routines) and unpremultiplied data (such as that given after mudraw has unpremultiplied the data).
2017-11-02Fixes for win32 build.Tor Andersson
2017-11-01Add separate fz_close_output step.Tor Andersson
Closing flushes output and may throw exceptions. Dropping frees the state and never throws exceptions.
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-10-24Improved overprint (simulation) control.Robin Watts
First, we add an fz_page_overprint function to detect if a page uses overprint. Only PDF implements this currently (other formats all return false). PDF looks for '/OP true' in any ExtGState entry. We make Mutool check this. If it finds it, and spot rendering is not completely disabled, then it ensures that the separation object passed to the pixmap into which we draw is non NULL. This causes the draw device to do overprint simulation. We ensure that mutool draw defaults to having the spot rendering mode default to simulation in builds that support it. Finally, we ensure that if an output intent is set by the document, and spot rendering is not completely disabled, then we ensure the seps object is non NULL so that we render to a group in the specified output intent, and THEN convert down to the required colorspace for the output. This should make us match acrobats behaviour.
2017-10-24Fix overprinting simulation in RGB output with no spots.Robin Watts
Running Ghent_V5.0/GWG010_CMYK_OP_x3.pdf to PNG produces 'X' marks, where Acrobat does not. This is expected if overprint similation is turned off, but not if it is enabled. The file does not define a colorspace for the initial page, uses no transparency, and has no spots defined. Accordingly, when we clone the page fz_separation object, we end up with no object at all. The draw device therefore doesn't even attempt to do overprint simulation. We fix this by ensuring that we always have a non-NULL separation object. Possibly we should make fz_page_separations return a non-NULL, but empty object? Even with this change, running to PNG still does not give the required rendering. This is because PNGs use RGB, rather than CMYK, and overprint is disabled for non-subtractive spaces. We therefore adjust the code in push_group_for_separations that decides whether it can avoid pushing an extra group. If the basic pixmap is RGB, then we never skip the extra group.
2017-10-24Add support for use of proofing profile.Robin Watts
This is a first cut to get us to demo-ability. There will likely be a few changes as we do a bit more testing with different scenarios with Gray, RGB, CMYK combos of destination, proof and output intent ICC profiles.
2017-10-24mudraw: Add ability to specify icc profile for target colorspace.Michael Vrhel
2017-10-13Simple PCLm device.Robin Watts
Both bandwriter and document_writer interfaces cope with multi page docs. Update mudraw to output pclm format too. Incorporates fixes from Tor.
2017-10-12Fix reference counting error in pdf_add_page.Tor Andersson
2017-10-12mutool run: Take reference to global colorspaces.Tor Andersson
Avoid double freeing the device colorspaces.
2017-10-12Add 'mutool sign' tool for verifying digital PDF signatures.Tor Andersson
2017-10-12Fix bug in murun when creating buffers from strings.Tor Andersson
The code only worked for string literals, not garbage collected or short strings.
2017-09-12Add -O flag to mudraw to control spots.Robin Watts
2017-09-12Fix merge error in murun.cTor Andersson
2017-09-07Make sure to always drop a fz_device even upon error.Sebastian Rasmussen
2017-09-07Initialize variables to appease clang scan-build.Sebastian Rasmussen