-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
- Windows version: (
22H2 19045.2364) - Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
Problem description:
{StaticResource} references on Path elements are not loaded in FixedPage after recent security patch.
Actual behavior:
FixedPage fails to load Path elements that have static resource references. Path data is set to null so those elements are not rendered with RenderTargetBitmap for example.
Expected behavior:
Path references are loaded.
Minimal repro:
- Make sure
December 13, 2022, security updates for .NET Frameworkis installed - Load attached xps file: p1.zip
var filePath = "<path>";
var doc = new XpsDocument(filePath, FileAccess.Read);
var seq = doc.GetFixedDocumentSequence();
foreach (var docRef in seq.References)
{
var fixedDoc = docRef.GetDocument(false);
foreach (var page in fixedDoc.Pages)
{
var fixedPage = page.GetPageRoot(false);
foreach (var element in fixedPage.Children)
{
Debug.Assert(((System.Windows.Shapes.Path)element).Data != null);
}
}
}You can probably reproduce this by printing most PDF files with some text to Microsoft XPS Document Writer and then trying to present it in a WPF app (that is not Windows XPS Viewer).
Workaround:
Alternate Workaround from kb5022083 (allowing all XPS types) works. I haven't figured out which type needs to be specifically allowed for this particular case. The script they have in the first part to allow certain types explicitly doesn't work.