PDF hint table fails to load if PDFDoc is opened with stream start offset != 0
Submitted by Ole Liabø
Assigned to poppler-bugs
Description
Created attachment 123139 Respect parent stream start offset when creating substream
The problem is that hints.cc create a substream from the original stream given to the PDFDoc class. The substream does not include the stream start offset in the original stream.
To reproduce:
- Create stream with startA != 0
- Create PDFDoc with stream as output.
- If PDF has hints tables it will output warnings:
Syntax Warning: Failed parsing hints table object Syntax Warning: Failed to get object num from hint tables for page 1 Syntax Warning: Failed parsing page 1 using hint tables Syntax Warning: Failed to get object num from hint tables for page 1 Syntax Warning: Failed parsing page 1 using hint tables Syntax Warning: Failed to get object num from hint tables for page 1
The attached patch fixes the issue.
Attachment 123139, "Respect parent stream start offset when creating substream":
file_95061.txt