move the usages of cos object key to indirect reference

This commit is contained in:
Eliot Jones
2018-01-14 14:48:54 +00:00
parent b19b96604d
commit 36c0eedd7c
15 changed files with 102 additions and 73 deletions

View File

@@ -5,6 +5,7 @@
using Content;
using ContentStream;
using Cos;
using Exceptions;
using FileStructure;
using Filters;
using Fonts;
@@ -102,7 +103,7 @@
if (!(root is PdfDictionary rootDictionary))
{
throw new InvalidOperationException("Expected root dictionary, but got this: " + root);
throw new PdfDocumentFormatException("Expected root dictionary, but got this: " + root);
}
// in some pdfs the type value "Catalog" is missing in the root object
@@ -117,6 +118,8 @@
var caching = new ParsingCachingProviders(pool, bruteForceSearcher, resourceContainer);
var pdfScanner = new PdfTokenScanner(inputBytes, null);
return new PdfDocument(log, reader, version, crossReferenceTable, isLenientParsing, caching, pageFactory, pdfObjectParser, catalog, information);
}