Env
- Windows 11 with .NET Framework 4.7
- Aspose.PDF for .NET 25.3
Code
var doc = new Aspose.Pdf.Document(@"C:\Users\hello\Desktop\test\1.pdf");
var textFragmentAbsorber = new TextFragmentAbsorber("微信公众号", new TextSearchOptions(true));
doc.Pages.Accept(textFragmentAbsorber);
var textFragmentCollection = textFragmentAbsorber.TextFragments;
foreach (var textFragment in textFragmentCollection)
{
textFragment.Text = "我们";//throw error, but if set to "We", is OK.
}
Files
test.zip (629.6 KB)