This article discusses a problem in which you can't successfully print large documents when you use a Windows Presentation Foundation (WPF) application.
Symptoms
Consider the following scenario:
- You use a WPF application in Windows 10 or later versions to print a range of pages.
- You run the
XpsDocumentobject to process the print job by usingVisualsToXpsDocument,DocumentPaginator, or another method.
In this scenario, the print process fails after you print some pages.
Cause
When you print pages by using a WPF application in Windows 10 or later, the font information is allocated on a page-by-page basis. If you're using this method to print a range of pages in a runtime, the process may increase memory usage by the operating system.
For example, if you're printing more than 8,000 pages, the process may stop because of a temporary increase in memory usage. This error indicates that an IOException occurred because of failed access to the font file.
After all the pages finish printing, memory can be freed for allocation.
Solution
To resolve this issue apply the January 2025 Cumulative Update Preview or a later update for .NET Framework.
Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
