Hi all,
I have patched the COSWriter and I would ask you to test it please. I
attached the patch.
Due to temp. lacking access to my apache webspace, I uploaded the
patched jar on my private server.
http://media-nation.de/~rayman2200/pdfbox-1.9.0-SNAPSHOT.jar
Best regards
Thomas
If no one complain I would commit it.
Zitat von Thomas Chojecki <[email protected]>:
Zitat von Andreas Lehmkuehler <[email protected]>:
Hi,
Hi Andreas,
Am 04.04.2013 16:41, schrieb Maruan Sahyoun:
Hi Andreas,
it's related to PDFBOX-1551 as you already guessed. In addition
PDF-1556 is related to PDFBOX-1551. I linked them in Jira.
Thanks.
I ran a quick test. As suggested I simply load and save a pdf and got 2
different results:
- cweb.pdf (from our testsuite) works fine
- one of the pdfs attached to PDFBOX-1551 fails (the trailer is missing)
The reason is the trailer. The first pdf uses a xref table the second a xref
xstream. After saving the second the trailer is missing. The regression was
introduced with PDFBOX-1513.
I don't look at the file but as you already suggested, this changes
come with PDFBOX-1513. I will take a look and try to fix it.
I'm still investigating the details ... any help is appreciated.
BR
Andreas Lehmkühler
Best regards
Thomas
Index: pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
===================================================================
--- pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (revision 1464668)
+++ pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (working copy)
@@ -1139,7 +1139,7 @@
}
// the trailer section should only be used for xref tables not for xref streams
- if (!doc.isXRefStream() || hybridPrev != -1)
+ if (!incrementalUpdate || !doc.isXRefStream() || hybridPrev != -1)
{
doWriteTrailer(doc);
}