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);
}
}