Part of Characters cannot be Seen after Replacing Text

Env

  • Windows 11
  • Aspose.PDF for .NET 24.1

Code

void Test()
{
	var doc = new Aspose.Pdf.Document(@"C:\Users\Administrator\Desktop\test\test.pdf");
	var textFragmentAbsorber = new TextFragmentAbsorber("XXXX");
	doc.Pages.Accept(textFragmentAbsorber);
	var textFragmentCollection = textFragmentAbsorber.TextFragments;
	foreach (var textFragment in textFragmentCollection)
	{
		//If add this line, it's OK.
		//textFragment.TextState.Font = Aspose.Pdf.Text.FontRepository.FindFont("Arial");
		textFragment.Text = "ABCDEFG";
		textFragment.TextState.Font.Dump();
		Aspose.Pdf.Text.FontRepository.FindFont("SimSun").Dump();
	}
	doc.Save(@"C:\Users\Administrator\Desktop\test\out.pdf");
}

Files

image.png (92.0 KB)
before.png (58.6 KB)

after.png (62.2 KB)

test.zip (392.9 KB)

@xucongli1989

Would you kindly make sure that the fonts are installed in your system that support Chinese characters? You can install Arial Unicode MS and SimSun fonts and try again. In case issue still persists, please let us know.

Thanks, I’ve re-updated the question.

@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-56388

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.