Text is being changed and erased


When we create link with text color change, the text of other than link area is being Changed and Erased. We are replicated this in AsposePDF v19.4.0.0(this issue exits in AsposePDF v18.10.0.0 also)

Please see the attached “before.pdf”(before creating the link the pdf like this) and “after.pdf”(after creating the link the pdf changed to).

after.pdf (129.1 KB)
before.pdf (133.1 KB)

I used following code to create link with text color change using Aspose.PDF v19.4.0.0

//***Code Start
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.Embedded = true;
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(textBox1.Text);
Aspose.Pdf.Page page = pdf.Pages[1];
Aspose.Pdf.Rectangle AnnotRect = new Aspose.Pdf.Rectangle(80, 540, 270, 560);
LinkAnnotation link = new LinkAnnotation(page, AnnotRect);
XYZExplicitDestination mag = new XYZExplicitDestination(page, 0, page.MediaBox.Height, 0);
link.Action = new GoToAction(mag);
System.Drawing.Color color2 = System.Drawing.ColorTranslator.FromHtml("#008000");
link.Color = Aspose.Pdf.Color.FromRgb(color2);
Border border = new Border(link);
border.Style = Aspose.Pdf.Annotations.BorderStyle.Solid;
link.Border = border;
foreach (Annotation annotation in page.Annotations)
if (annotation is LinkAnnotation)
Aspose.Pdf.Rectangle rect = annotation.Rect;
TextFragmentAbsorber absorber = new TextFragmentAbsorber();
absorber.TextSearchOptions.Rectangle = rect;
foreach (TextFragment textFragment in absorber.TextFragments)
System.Drawing.Color color = System.Drawing.ColorTranslator.FromHtml("#FF0000");
textFragment.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(color);
MessageBox.Show("The PDF File is saved at the location of @“D:\test\after.pdf”);
catch(Exception ex)
//***Code End

Can you please look into this issue and Let me know is there issue in Aspose.PDF or Am I doing something incorrect her?
Please let me know if you need any more information on this. Immediate response is appreciable!



Thank you for contacting support.

We have attached the PDF document generated with Aspose.PDF for .NET 19.6 where the text 4.4.4, 4.4.5, D01 and a trea are incorrectly red. Would you please confirm the same on your end with latest version so that we may proceed further.



Also, please compare the document you sent(after_19.6.pdf) with original document(before.pdf attached as part of original question). Notice that at the end of page, the whole section is missing.

Could you please let us know possible workarounds?



Thank you for verifying and elaborating it further.

We have logged a ticket with ID PDFNET-46705 in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.



Any updates on this issue…?



Please note that the ticket is logged under free support model where tickets are scheduled on first come first serve basis. So the resolution of this ticket may take several months. We appreciate your patience and comprehension in this regard.

Moreover, we also offer Paid Support, where issues are used to be investigated with higher priority. Our customers, who have paid support subscription, report their issue there which are meant to be investigated urgently. In case your reported issue is a blocker, you may please consider subscribing for Paid Support. For further information, please visit Paid Support FAQs.