mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 11:44:51 +08:00
#82 make resource store state local to the page and operation being processed
resources such as fonts are linked to page content operations using name labels, e.g. "/F1", these resource labels can be reassigned on different pages or inside form xobjects. we now clear the entire resource state for each page which is parsed and after form xobject operations which use resource dictionaries.
This commit is contained in:
@@ -336,7 +336,8 @@
|
||||
* 5. Restore the saved graphics state, as if by invoking the Q operator.
|
||||
*/
|
||||
|
||||
if (formStream.StreamDictionary.TryGet<DictionaryToken>(NameToken.Resources, pdfScanner, out var formResources))
|
||||
var hasResources = formStream.StreamDictionary.TryGet<DictionaryToken>(NameToken.Resources, pdfScanner, out var formResources);
|
||||
if (hasResources)
|
||||
{
|
||||
resourceStore.LoadResourceDictionary(formResources, isLenientParsing);
|
||||
}
|
||||
@@ -368,6 +369,11 @@
|
||||
|
||||
// 5. Restore saved state.
|
||||
PopState();
|
||||
|
||||
if (hasResources)
|
||||
{
|
||||
resourceStore.UnloadResourceDictionary();
|
||||
}
|
||||
}
|
||||
|
||||
public void BeginSubpath()
|
||||
|
Reference in New Issue
Block a user