summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-write.c
AgeCommit message (Collapse)Author
2014-01-13More fixes for PDF clean.Robin Watts
Avoid negative indirections. Don't make indirections to objects that aren't going to be used. Also improve pdf-write.c so that it doesn't call renumberobj on objs that are going to be dropped.
2014-01-10Solve SEGV in mutool clean with fuzzed file.Robin Watts
While attempting to debug a valgrind issue with: 013b2dcbd0207501e922910ac335eb59_asan_heap-oob_a59696_5952_500.pdf I found that mutool -difggg on it failed with a SEGV. This is due to us parsing an array with a large invalid indirection in it (e.g. [123456789 0 R]) and then the renumbering code assuming this is valid and accessing off the end of an array.
2014-01-06fix various MSVC warningsSimon Bünzli
Some warnings we'd like to enable for MuPDF and still be able to compile it with warnings as errors using MSVC (2008 to 2013): * C4115: 'timeval' : named type definition in parentheses * C4204: nonstandard extension used : non-constant aggregate initializer * C4295: 'hex' : array is too small to include a terminating null character * C4389: '==' : signed/unsigned mismatch * C4702: unreachable code * C4706: assignment within conditional expression Also, globally disable C4701 which is frequently caused by MSVC not being able to correctly figure out fz_try/fz_catch code flow. And don't define isnan for VS2013 and later where that's no longer needed.
2013-09-30make pdf_write_document again accept NULL for fz_optsSimon Bünzli
In order to prevent this from breaking again, a fz_write_options struct with default values is allocated locally and used whenever fz_opts is NULL.
2013-09-27preserve /Encrypt for documents with streamed xrefsRobin Watts
If /Encrypt is not present on an updated xref of an encrypted document, that document can no longer be opened. This is required for incremental saving. Note: Streams aren't encrypted by pdf_write_document and can't thus currently be appended to an encrypted document. In that case, saving non-incrementally will produce a working (non-encrypted) document.
2013-09-13Fix various compile warnings spotted by the cluster.Robin Watts
2013-08-27A few updates to signing supportPaul Gardiner
2013-08-22Add support for writing of xref streamsPaul Gardiner
Use of the feature is currently enabled only in the case that a file that already contains xref streams is being updated incrementally. To do so in that case is necessary because an old-style xref is then not permitted. This fixes bug #694527
2013-08-13Signature creationPaul Gardiner
2013-07-19Initial work on progressive loadingRobin Watts
We are testing this using a new -p flag to mupdf that sets a bitrate at which data will appear to arrive progressively as time goes on. For example: mupdf -p 102400 pdf_reference17.pdf Details of the scheme used here are presented in docs/progressive.txt
2013-07-11Implement dynamic page tree lookups.Tor Andersson
No more caching a flattened page tree in doc->page_objs/refs. No more flattening of page resources, rotation and boxes. Smart page number lookup by following Parent links. Naive implementation of insert and delet page that doesn't rebalance the trees. Requires existing page tree to hook into, cannot be used to create a page tree from scratch.
2013-07-04Update pdf_write_document to support incremental updatePaul Gardiner
2013-07-03Rename pdf_set_objects_parent_num to pdf_set_obj_parentRobin Watts
2013-07-02Fix "mutool clean -ggg" operation.Robin Watts
When moving an object from one xref to a new xref, ensure firstly that we only drop each object once (by setting it to NULL) and secondly that it has the correct parent pointer.
2013-06-28Add array_insert_drop and array_delete functions.Tor Andersson
Also add index argument to array_insert.
2013-06-28Ensure altered objects are moved to the incremental xref sectionPaul Gardiner
2013-06-27Move to using a flags bit rather than "Dirty" dict entries.Robin Watts
Correct the naming scheme for pdf_obj_xxx functions.
2013-06-26Silence compiler warnings.Tor Andersson
2013-06-25Rid the world of "pdf_document *xref".Robin Watts
For historical reasons lots of the code uses "xref" when talking about a pdf document. Now pdf_xref is a separate type this has become confusing, so replace 'xref' with 'doc' for clarity.
2013-06-25Update pdf_obj's to have a pdf_document field.Robin Watts
Remove the fz_context field to avoid the structure growing.
2013-06-21Initial PDF editing/page creation commitRobin Watts
2013-06-20Rearrange source files.Tor Andersson