Gibberish text after changing text color in Aspose

I noticed an issue when changing color of text within link rectangle using AsposePDF v18.10.0.0

Please see attached “input.pdf” and “output.pdf”.
input.pdf : Before changing color of text within link rectangle
output.pdf: After changing color of text using v18.10.0.0
Description: When we compare output.pdf file, after the word “from” having more space and word
“minutes” is overlapped(Gibberished)
I used following code to change color of a text using Aspose.PDF v18.10.0.0

//***Code Start

private void btnChangeColor_Click(object sender, EventArgs e)
               Aspose.Pdf.License license = new Aspose.Pdf.License();
                license.Embedded = true;
                Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(@"D:\test\inputput.pdf);
                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\output.pdf");
            catch (Exception ex)
                MessageBox.Show("Some Error Encountered" + ex.toString());

//***Code End
input.pdf (34.9 KB)
output.pdf (61.2 KB)

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

1 Like


Thanks for contacting support.

We have tested the scenario in our environment with using Aspose.PDF for .NET 19.1 and were able to notice the issue. We have logged it as PDFNET-45921 in our issue tracking system for the sake of correction. We will further look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.


Any update on this issue “PDFNET-45921”?, I did not see this is fixed in most recent release.




We regret to share that your issue is not yet resolved. Please note that issues are resolved on first come first serve basis and we have been investigating/resolving other issues which were logged prior to yours. As soon as we have some definite news about resolution of your issue, we will share with you. Please spare us little time.

We are sorry for the inconvenience.


Any updates on this issue…?


We are afraid that earlier logged ticket is not yet resolved. We will surely let you know as soon as there is some news on issue resolution. Please spare us little time.

We are sorry for the inconvenience.


What is the updates of this issue …?


We regret to share that your issue could not get resolved yet due to other high priority issues. However, we have recorded your concerns and will definitely consider them during issue investigation. We will inform you as soon as some definite updates are available regarding rectification of your issue. Please spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-45921) have been fixed in Aspose.PDF for .NET 20.2.