Throw Error when Open PDF File if Set an Exist Default Font Name

Description

When I save a PDF file and set DefaultFontName to a valid and existing font name, the saved PDF prompts a font error when opened with Adobe.

Env

  • Windows 11
  • Aspose.PDF for .NET 24.2

Code

void Test()
{
	var fontName="SimSun";
	var doc = new Aspose.Pdf.Document(@"C:\Users\Administrator\Desktop\test\1.pdf");
	doc.Save(@"C:\Users\Administrator\Desktop\test\out.pdf", new Aspose.Pdf.PdfSaveOptions() {
		DefaultFontName=fontName // It's OK if you change it to a random and non-existent name.
	});
	
	Aspose.Pdf.Text.FontRepository.FindFont(fontName).Dump();
}

Test File

test.zip (388.3 KB)

@xucongli1989
The problem has been reproduced - I will create a task for the development team. Thank you for writing to us about this.

@xucongli1989
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56667

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.