summaryrefslogtreecommitdiff
path: root/source/tools
AgeCommit message (Collapse)Author
2018-09-05Use colorspace type enum instead of magic profile names.Tor Andersson
2018-09-05mutool run: Pass script path and arguments as scriptPath and scriptArgs.Tor Andersson
2018-09-04Check for missing filename when saving gproof.Sebastian Rasmussen
2018-08-14Fix leak of PDF object in mutool show.Sebastian Rasmussen
2018-08-10Rejig pdf_update_page and pdf_update_annot.Tor Andersson
The intent is for a user to iterate over the annotations on a page calling pdf_update_annot for each one. If this function returns true, then the annotation has changed since the last time it was called, and the user needs to re-render. pdf_update_page is a simple loop over the annotations on a page, for use if you only care about page level granularity. Users should no longer look at or change the pdf_annot.has_new_ap field.
2018-07-06Fix muraster and mu-office-lib.Robin Watts
These got broken during the fz_rect/fz_matrix pass-by-value changes.
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-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-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-02mutool show: Add support for wildcards in path syntax.Tor Andersson
Example: mutool show $PDF pages/*/Resources/Fonts/*/Subtype
2018-05-17mutool extract: Remove spurious 'break' statement and fix double free.Tor Andersson
2018-05-16Don't use pdf_load_object in pdfextract.cTor Andersson
2018-05-16js: Add Shade.bound function and bbox device example.Tor Andersson
2018-05-09Fix windows: strsep is missing on MSVC, use fz_strsep instead.Tor Andersson
2018-05-03Add selector syntax to 'mutool show'.Tor Andersson
2018-05-03Tweak 'mutool show ... grep' output.Tor Andersson
2018-05-02Improve error handling in murun shell and update MuJS submodule.Tor Andersson
2018-04-27Use pdf_dict_get_int, etc.Tor Andersson
2018-04-25Don't use WMode as part of CJK font lookup.Tor Andersson
Return TTC subfont index from fz_lookup_noto_font.
2018-04-25Support creating both serif and sans-serif CJK fonts in mutool create.Tor Andersson
Also support Vertical WMode.
2018-04-25Add CMap processing scripts, and turn cmapdump into mutool.Tor Andersson
A dumping script written in python. A flattening script written in python (for easier editing). A subsetting script written in shell to minimize CMaps by reusing subsets. Use 'mutool cmapdump' to bootstrap or verify cmap dumps.
2018-04-25Remove document argument from pdf_new_primitive functions.Tor Andersson
Also remove useless pdf_new_null and pdf_new_bool functions. Use the PDF_NULL, PDF_TRUE, and PDF_FALSE macros instead.
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-23Avoid SEGV when mudrawing to SVG.Robin Watts
Belt and braces: 1) Don't attempt to close a NULL output stream. 2) If an output stream is NULL when we do close it, don't SEGV.
2018-04-11For mutool create the encoding is not actually required.Sebastian Rasmussen
Also update the comment in the code to mention the optional encoding argument.
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