We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89abf6d commit d1d79b0Copy full SHA for d1d79b0
src/UglyToad.PdfPig/Content/ResourceStore.cs
@@ -119,6 +119,13 @@ public void LoadResourceDictionary(DictionaryToken resourceDictionary)
119
120
namedColorSpaces[name] = new ResourceColorSpace(arrayNamedColorSpace, colorSpaceArray);
121
}
122
+ else if (parsingOptions.UseLenientParsing &&
123
+ DirectObjectFinder.TryGet(nameColorSpacePair.Value, scanner, out DictionaryToken? dict) &&
124
+ dict.TryGet(NameToken.ColorSpace, scanner, out NameToken? csName))
125
+ {
126
+ // See issue #1061
127
+ namedColorSpaces[name] = new ResourceColorSpace(csName);
128
+ }
129
else
130
{
131
throw new PdfDocumentFormatException($"Invalid ColorSpace token encountered in page resource dictionary: {nameColorSpacePair.Value}.");
0 commit comments