recover from invalid cross reference position

if we are reading a cross reference offset which contains a number we assumed it was a stream object. if it's not we now brute-force the entire file looking for an 'xref' token. this should be combined with a search for cross-reference streams and should run when we read neither the numeric token or an 'xref' token but for now this fixes the observed issue.

also adds number of images to the page api to prevent consumers needing to enumerate.
This commit is contained in:
Eliot Jones
2020-01-28 18:07:05 +00:00
parent 29061b1fd2
commit 8ab2838063
4 changed files with 107 additions and 6 deletions

View File

@@ -30,6 +30,8 @@
public IReadOnlyList<PdfPath> Paths { get; }
public int NumberOfImages => images.Count;
internal PageContent(IReadOnlyList<IGraphicsStateOperation> graphicsStateOperations, IReadOnlyList<Letter> letters,
IReadOnlyList<PdfPath> paths,
IReadOnlyList<Union<XObjectContentRecord, InlineImage>> images,