You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (Jira)" <ji...@apache.org> on 2020/06/27 11:42:00 UTC

[jira] [Resolved] (PDFBOX-4897) PDFObjectStreamParser doesnt use offset

     [ https://issues.apache.org/jira/browse/PDFBOX-4897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-4897.
----------------------------------------
    Resolution: Fixed

I've backported the optimized behaviour of the object stream parser from 3.0

 

[~ssteiner] Thanks for the idea and the test case

> 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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org