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

PDFObjectStreamParser doesnt use offset

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.20
    • Fix Version/s: 2.0.21
    • Component/s: Parsing
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: