From 3416c60fe9ec4a6ad5c1e08a757bd63a4699a5a5 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 18 Jan 2010 03:37:01 +0000 Subject: save pass1 patch git-svn-id: svn+q:///qpdf/trunk@931 71b93d88-0707-0410-a8cf-f5a4172ac649 --- TODO | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 6 deletions(-) (limited to 'TODO') diff --git a/TODO b/TODO index d5112443..333ecf6d 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,3 @@ -2.1 -=== - - * Remove rc1 from version; search for rc1 in release notes as - well...just change rc1 to 2.1 and update the date. - 2.2 === @@ -21,6 +15,54 @@ General ======= + * For debugging linearization bugs, consider adding an option to save + pass 1 of linearization. This code is sufficient. Change the + interface to allow specification of a pass1 file, which would + change the behavior as in this patch. + +------------------------------ +Index: QPDFWriter.cc +=================================================================== +--- QPDFWriter.cc (revision 920) ++++ QPDFWriter.cc (working copy) +@@ -1958,11 +1960,15 @@ + + // Write file in two passes. Part numbers refer to PDF spec 1.4. + ++ FILE* XXX = 0; + for (int pass = 1; pass <= 2; ++pass) + { + if (pass == 1) + { +- pushDiscardFilter(); ++// pushDiscardFilter(); ++ XXX = fopen("/tmp/pass1.pdf", "w"); ++ pushPipeline(new Pl_StdioFile("pass1", XXX)); ++ activatePipelineStack(); + } + + // Part 1: header +@@ -2037,7 +2043,8 @@ + t_lin_first, first_half_start, first_half_end, + first_trailer_size, + hint_length + second_xref_offset, +- hint_id, hint_offset, hint_length); ++ hint_id, hint_offset, hint_length, ++ (pass == 1)); + int endpos = this->pipeline->getCount(); + if (pass == 1) + { +@@ -2187,6 +2194,8 @@ + + // Restore hint offset + this->xref[hint_id] = QPDFXRefEntry(1, hint_offset, 0); ++ fclose(XXX); ++ XXX = 0; + } + } + } +------------------------------ + * Handle embedded files. PDF Reference 1.7 section 3.10, "File Specifications", discusses this. Once we can definitely recongize all embedded files in a docucment, we can update the encryption -- cgit v1.2.3-54-g00ecf