Empty XPS documents are being created / XPS printing is broken
Symptoms
- When printing you experience that the output contains only text and images/visuals have been removed.
- When creating XPS files with a File Printer channel in a Print&Share CQ profile all generated XPS files are empty.
- WPF applications that print don't print any images.
Cause
An issue after installing the December 13, 2022 or February 14, 2023 security updates or the January 19th, 2023 updates for .NET Framework and .NET may cause issues with the rendering of XPS documents.
Resolution
March 1st, 2023: it is expected that a fix will be provided via Windows Update. At this time of writing you have to try one of the workarounds described below.
Follow the workaround steps described at KB5022083 Change in how WPF-based applications render XPS documents.
The first workaround uses a PowerShell script. The second workaround described changes some registry settings.
Note: many customers reported that only the second workaround did the trick.
See also
- .NET Framework December 2022 Security and Quality Rollup Updates [https://devblogs.microsoft.com/dotnet/dotnet-framework-december-2022-security-and-quality-rollup-updates/]
- February 14, 2023 Security update (KB5022842) https://support.microsoft.com/en-us/topic/february-14-2023-security-update-kb5022842-c5f53080-d4aa-4c0e-ade8-62cb35acbd98
- January 19, 2023-KB5022406 Cumulative Update Preview for .NET Framework 3.5 and 4.8 for Windows 11 https://support-uat.microsoft.com/en-us/topic/january-19-2023-kb5022406-cumulative-update-preview-for-net-framework-3-5-and-4-8-for-windows-11-89bce37f-4635-4766-b5a7-c4d548f45cc5
- KB5022083 Change in how WPF-based applications render XPS documents https://support.microsoft.com/en-us/topic/kb5022083-change-in-how-wpf-based-applications-render-xps-documents-a4ae4fa4-bc58-4c37-acdd-5eebc4e34556
- references are broken for XPS Paths after December2022 security patch #7436 https://github.com/dotnet/wpf/issues/7436
- KB5022083 - Broken XPS prinintg in WPF Applications https://developercommunity.visualstudio.com/t/KB5022083---Broken-XPS-prinintg-in-WPF-A/10233950