summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-01-05Enable saving of encrypted PDF files.Robin Watts
We need both RC4 and AES encryption. RC4 is a straight reversable stream, and our AES library knows how to encrypt as well as decrypt, so it's "just" a matter of calling them correctly. We therefore expose a generic "encrypt this data" routine (and a matching "how long will the data be once encrypted" routine) within pdf-crypt.c. We then extend our our PDF object output routines to call these. This is enough to get encrypted data preserved over calls to mutool clean. Unfortunately the created files aren't readable, due to 2 further problems, also fixed here. Firstly, mutool clean does not preserve the Encrypt entry in the trailer. This is a simple fix. Secondly, we are required NOT to encrypt the Encrypt entry. This requires us to spot the crypt entry and to special case it.
2018-01-05Fix "being able to search for redacted text" bug.Robin Watts
A customer reports that even after text has been redacted, we can still search for the redacted text. The example file supplied had many instances of the word 'words', and 4 instances of 'apple'. The 'apple' instances were redacted, and the document saved out. 2 such instances were on the first page; when we searched for 'apple' acrobat would find the word after the first removed instance of apple, then find the word 2 after the second removed instance of apple. After much head scratching and cutting down of the file, it appears that the information genuinely isn't in the file. Acrobat is somehow remembering it. It appears to be doing this using the 'ID' entries in the trailer dict. My suspicion is that Acrobat has cached the text extraction from the original document, and is using this on all files that match the IDs. Change the IDs (or remove them) and the problem goes away. The spec says that the ID should be 2 bytestrings in an array. The first is supposed to stay the same in all versions of a file (i.e. it shows the *original* version of the file, and it is the one that is used by encrypt). The second bytestring is supposed to change more often, so here we simply return a new random string on each writing.
2018-01-04Update 'mutool run' man page.Tor Andersson
2018-01-04Bug 698836: Fix build with FZ_ENABLE_JPX=0.Tor Andersson
2018-01-04Add portable pseudo-random number generator based on the lrand48 family.Tor Andersson
2018-01-02Fix thread debugging code to always use ms_clock()Robin Watts
2017-12-29Update LCMS2 with optimisations from GS.Robin Watts
2017-12-20Bug 698827: Correct reference counting when creating pixmap from pixmap.Sebastian Rasmussen
Previously the copy had as many reference counts as the original pixmap which lead to leaks of pixmaps.
2017-12-20Bug 698826: Plug leak of font names when parsing appearance string.Sebastian Rasmussen
Previously if a variable text annotation with a default appearance string had multiple 'Tf' operators all but the last font name would leak.
2017-12-19Bug 698825: Do not drop borrowed colorspaces.Sebastian Rasmussen
Previously the borrowed colorspace was dropped when updating annotation appearances, leading to use after free warnings from valgrind/ASAN.
2017-12-13Initialize generation numbers when saving a new pdf.Tor Andersson
2017-12-13Validate that /Size in trailer is in range.Sebastian Rasmussen
2017-12-13PDF object numbers need not be int64_t, int is sufficient.Sebastian Rasmussen
This is true because they are now limited below PDF_MAX_OBJECT_NUMBER.
2017-12-13Define constant INT64_MAX where int64_t is declared.Sebastian Rasmussen
2017-12-13Move xref section recursion check, simplifying code.Sebastian Rasmussen
2017-12-13Rephrase messages, clarify variable names and remove unused code.Sebastian Rasmussen
2017-12-13Never write negative xref offsets when saving to PDF.Sebastian Rasmussen
2017-12-13Bugs 698804/698810/698811: Keep PDF object numbers below limit.Sebastian Rasmussen
This ensures that: * xref tables with objects pointers do not grow out of bounds. * other readers, e.g. Adobe Acrobat can parse PDFs written by mupdf.
2017-12-13Update MuJS submodule.Tor Andersson
2017-12-13Add 'tar.xz' to "make tarball" script.Tor Andersson
2017-12-13Don't pass -Wdeclaration-after-statement to C++ compiler.Tor Andersson
2017-12-13Parse XML using pool allocator.Tor Andersson
This needs adding a fz_xml_doc type to hold the pool.
2017-12-13Fix 698785: Catch malformed numbers in PDF lexical scanner.Tor Andersson
Return error tokens when parsing numbers with trailing garbage rather than ignoring the extra characters. Also handle error tokens more gracefully in array and dictionary parsing. Treat error tokens as the 'null' keyword and continue parsing.
2017-12-13Fix 698787: avoid using "system()" to copy files.Tor Andersson
2017-12-13Put extra apps in separate (non-default) makefile build target.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-12-13gl: Tell glut to return from main loop when the window closes.Tor Andersson
This allows us to clean up memory so we can check for memory leaks. Also fix one memory leak.
2017-12-13Import FreeGLUT fixes for clipboard and unicode input.Tor Andersson
Fixes issues with dead keys in unicode input.
2017-12-08Fix SEGV in redaction code due to TJ with no chars.Robin Watts
If the first TJ we meet in a file has an adjustment, but no chars, then we end up calling 'adjustment' without ever having set fontdesc. This causes a crash. Fix it here.
2017-12-06Ensure that our ICC base spaces have colorant names.Robin Watts
2017-12-06Update fz_convert_separation_colors to cope with unnamed separations.Robin Watts
Well, at least not to crash.
2017-12-06Bug 698801: Always copy background in when clipping an imagemask.Robin Watts
Don't attempt to rely on alpha, as it is incompatible with the way we clip through the mask at the end.
2017-11-23Bump version number to 1.12.0.Tor Andersson
2017-11-23Update CHANGES.Tor Andersson
2017-11-23Allow RGB based proofing profile and output intentMichael Vrhel
Also do not do the extra group push if the destination pixmap is in the proper color space and has all the required sep support.
2017-11-23Workaround freetype synthesizing unicode cmaps.Tor Andersson
2017-11-23Make time stamps 64-bit integers.Tor Andersson
Future proof the API for the Year 2038 problem.
2017-11-22Remove unused annotation function.Tor Andersson
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: Remove unnecessary PDFObject.asByteName().Sebastian Rasmussen
2017-11-22Add pdf_new_text_string utility function.Tor Andersson
Create a PDF 'text string' type string from a UTF-8 input string. If the input is plain ASCII, keep it as is, otherwise re-encode it as UTF-16BE.
2017-11-22jni: Make sure to dirty annotation whenever it changes.Fred Ross-Perry
2017-11-22jni: Silence warning by casting boolean to integer.Sebastian Rasmussen
2017-11-22jni: Fix bugs in StructuredText_getBlocks().Fred Ross-Perry
When iterating through blocks, make sure to include text blocks. After building the char array for a given line, be sure to add it to the line object.
2017-11-22jni: Put destination coordinates into Outline object.Fred Ross-Perry
2017-11-22jni: Free quadpoints and vertices upon JNI error.Sebastian Rasmussen
2017-11-22jni: Only keep the reference when the java constructor succeeds.Sebastian Rasmussen
2017-11-22jni: Check for exception after allocating objects.Sebastian Rasmussen