Description
I updated a string with line break via TextFragment.Text
, but the output file ignored line break.
Code
var doc = new Aspose.Pdf.Document(@"C:\Users\XCL\Desktop\test\1.pdf");
var textFragmentAbsorber = new TextFragmentAbsorber("1");
doc.Pages.Accept(textFragmentAbsorber);
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
foreach (TextFragment textFragment in textFragmentCollection)
{
textFragment.Text = $"1.{Environment.NewLine}";
//textFragment.Text = "1.\n"; Not working too.
}
doc.Save(@"C:\Users\XCL\Desktop\test\1-out.pdf");
Received Result
image.png (23.2 KB)
Expected Result
image.png (32.6 KB)
Test File
test.zip (239.7 KB)