[
https://issues.apache.org/jira/browse/PDFBOX-2079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14008359#comment-14008359
]
Tilman Hausherr commented on PDFBOX-2079:
-----------------------------------------
I wrote a writer that swallows a final CR LF or LF (but not a final CR) when
writing the stream, and this one wraps around the stream that is used by
readUntilEndStream(). Ideally, there should exist something like a
"PullbackOutputStream" class but there isn't.
readUntilEndStream() exists twice in PDFBox; however they are slightly
different and I didn't do any DRY refactoring this time. I'm not sure if the
one from BaseParser is correct; the one from NonsequentialParser had a bugfix
in rev 1551220.
This was done in rev 1597428 and 1597431 for the trunk and rev 1597429 and
1597435 for the 1.8 branch.
> Extra new line characters extracted in 1.8.5 for embedded files leading to
> ZipFile exception in Java 1.6
> --------------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-2079
> URL: https://issues.apache.org/jira/browse/PDFBOX-2079
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.8.5, 1.8.6, 2.0.0
> Reporter: Tim Allison
> Assignee: Tilman Hausherr
> Priority: Minor
> Fix For: 1.8.6, 2.0.0
>
> Attachments: PDFBOX-2079-TEST_CASE.patch, embedded_zip.pdf
>
>
> For the test file I'll attach shortly, PDFBox 1.8.4 extracts 17660 bytes from
> an embedded zip (well, docx) file. PDFBox 1.8.5 extracts 17662 bytes --
> "\r\n" at the end of the stream. This leads to a ZipException for ZipFile(s)
> in Java 1.6, but not Java 1.7.
--
This message was sent by Atlassian JIRA
(v6.2#6252)