Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4897

PDFObjectStreamParser doesnt use offset

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.20
    • 2.0.21
    • Parsing
    • None

    Description

      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

      public class PDFObjectStreamParserTest {
      @Test public void testOffsetParsing() throws IOException {
      COSDictionary dict = new COSDictionary();
      dict.setItem(COSName.N, COSInteger.ONE);
      COSStream stream = new COSStream(dict);
      OutputStream outputStream = stream.createUnfilteredStream();
      outputStream.write("0 7 -1 true".getBytes());
      outputStream.close();
      PDFObjectStreamParser objectStreamParser = new PDFObjectStreamParser(stream, null);
      objectStreamParser.parse();
      Assert.assertEquals(objectStreamParser.getObjects().get(0).getObject(), COSBoolean.TRUE);
      }
      }

      Attachments

        Activity

          People

            lehmi Andreas Lehmkühler
            ssteiner Simon Steiner
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: