Hello.
On some machines we are getting following exception when trying to open XPS file:
"Cannot find any fonts installed on the system."
at #=z0wu1kzQMV1b1NNCoN27SHDEjXCnb.#=zL3PUHSzybB0X(String #=zibFGOzs=, FontStyle #=zKRrS19Q=, String #=zjS8gERYv7mrf)\r\n
at #=z0wu1kzQMV1b1NNCoN27SHDEjXCnb.#=zlEuB$hjl3hPX(String #=zibFGOzs=, Single #=z$nGqjV9z7y1_, FontStyle #=zKRrS19Q=, String #=zjS8gERYv7mrf)\r\n
at #=z0wu1kzQMV1b1NNCoN27SHDEjXCnb.#=zlEuB$hjl3hPX(String #=zibFGOzs=, Single #=z$nGqjV9z7y1_, FontStyle #=zKRrS19Q=)\r\n
at #=z3l_3xwPpDwe6$Rm66aUAJCoSIpP_n9ToA5FTnyY=.#=zLTHUG70=()\r\n
at #=z3l_3xwPpDwe6$Rm66aUAJCoSIpP_n9ToA5FTnyY=..ctor()\r\n
at #=zQsWaDX6yhFjlxKfoFv9kTNQxfgPh.#=zU36mrOjSxVyY(Stream #=znfr3wBEBtFfE, Document #=z08DK$b8gmeZT, XpsLoadOptions #=zb0_yJ8Y=, Boolean #=zkniKRotEsyEe)
Our source code is simple:
public void SaveXpsToPdf(Stream inputXpsStream, Stream outputPdfStream)
{
using (var document = new Document(inputXpsStream, new XpsLoadOptions()))
{
document.Save(outputPdfStream, SaveFormat.Pdf);
}
}
We render WPF controls to XPS and afterwards we use Aspose library for converting XPS to PDF.
Reproduced with:
Aspose.PDF 24.5.1
Runtime: .NET 8
OS: Microsoft Windows Server 2022 Standard 10.0.20348 N/A Build 20348
I attached XPS file that causes this error (it’s not PDF, you need to change extension to XPS).
TestXps1.xps.pdf (78.7 KB)