[
https://issues.apache.org/jira/browse/PDFBOX-4897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146944#comment-17146944
]
ASF subversion and git services commented on PDFBOX-4897:
---------------------------------------------------------
Commit 1879267 from [email protected] in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1879267 ]
PDFBOX-4897: backported the optimized behaviour of the object stream parser
from 3.0 as proposed by Simon Steiner
> PDFObjectStreamParser doesnt use offset
> ---------------------------------------
>
> Key: PDFBOX-4897
> URL: https://issues.apache.org/jira/browse/PDFBOX-4897
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.20
> Reporter: Simon Steiner
> Assignee: Andreas Lehmkühler
> Priority: Major
> Fix For: 2.0.21
>
>
> pdfbox 3 reads using offset in PDFObjectStreamParser
> pdfbox 2 reads using object number in PDFObjectStreamParser, should this
> change be backported to help reading pdfs
>
> I wrote a test case since i cant share my pdf
> {color:#000080}public class {color}PDFObjectStreamParserTest {
> {color:#808000}@Test{color} {color:#000080}public void
> {color}testOffsetParsing() {color:#000080}throws {color}IOException {
> COSDictionary dict = {color:#000080}new {color}COSDictionary();
> dict.setItem(COSName.{color:#660e7a}N{color},
> COSInteger.{color:#660e7a}ONE{color});
> COSStream stream = {color:#000080}new {color}COSStream(dict);
> OutputStream outputStream = stream.createUnfilteredStream();
> outputStream.write({color:#008000}"0 7 -1 true"{color}.getBytes());
> outputStream.close();
> PDFObjectStreamParser objectStreamParser = {color:#000080}new
> {color}PDFObjectStreamParser(stream, {color:#000080}null{color});
> objectStreamParser.parse();
>
> Assert.assertEquals(objectStreamParser.getObjects().get({color:#0000ff}0{color}).getObject(),
> COSBoolean.{color:#660e7a}TRUE{color});
> }
> }
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]