PDF Text color issue

Please let me know the progress on the ETA you mentioned in your reply?

@IqviaPal

We have investigated the issue and found a source of the problem. The point is that in PDF vector graphics objects (including font glyphs) may have two colors. The first one is color for non-stroking operations. Also, it can be named a “fill color”. Usually, when talking about the “foreground color”, they mean the fill color e.g. “color for non-stroking operations” in the terms of PDF.

The second color is the color for stroking operations. Also, it can be named a “border color” or a “line color”. If the document creator sets the border color to a different color than the fill color, and additionally sets a large (>10% of the glyph height) borderline thickness, then the entire glyph will look like it is filled with the border color.

This is what is observed in the document for the characters “1” and “2”. We have the StrokingColor property in the TextState and it returns the correct - blue color.

However, given that users are rarely aware of the details of glyph rendering, we have decided to change the mechanics of the ForegroundColor property. Starting from Aspose.PDF 23.4 it will returns “observed color” for the cases like this.

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

Hi

      I have another document, wherein, when we try to process the text items like changing the text color, the Text gets corrupted, can you please look into this issue as well, if required I will provide the Test PDF.

@IqviaPal

Sure. please share your sample PDF with us along with the code snippet that you are using. We will test the scenario in our environment and address it accordingly.

Here I am sending the text file, one is before applying changes using Aspose
(Test document-Before Process.pdf), and anther is after applying text color change using Aspose Library
(Test document-After Process with Aspose.pdf),
And the code parts related to the above is as mentioned below.

 Aspose.Pdf.Text.TextFragmentAbsorber textFragmentAbsorbernew = new Aspose.Pdf.Text.TextFragmentAbsorber();
 Aspose.Pdf.Rectangle rect = annot.Rect;
textFragmentAbsorbernew.TextSearchOptions = new TextSearchOptions(rect);
string LinkTextColor....//Here we assinging the desired text color string;
 try
{
	foreach (Aspose.Pdf.Text.TextFragment TextFrag in textFragmentAbsorbernew.TextFragments)
	{
		System.Drawing.Color color1 = System.Drawing.ColorTranslator.FromHtml(LinkTextColor);
		TextFrag.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(color1);
		//TextFrag.TextState.ForegroundColor = Aspose.Pdf.Color.Black;
	}
	isDocSave = true;
}

the above code working fine for other PDFs, but for the attached file, it creating issue. please verify this issue.
Test document-After Process with Aspose.pdf.pdf (177.3 KB)
Test document-Before Process.pdf (178.1 KB)

@IqviaPal

We were unable to use this code snippet. It is incomplete. Can you please share the complete code snippet that we can use to replicate the issue in our environment?

Here is the code snippet used to change the Link text color, on applying the text color (e.g. to blue color), and saving the pdf, the text in the pdf gets corrupted. Please look into the issue and help me to fix the issue.
AnnotationCollection annots = pdfDoc.Pages[SourcePage].Annotations;
for (int index = 1; index <= annots.Count; index++)
{
Annotation annot = annots[index];
string Aname = annot.GetType().Name;

            if (Aname.Equals("LinkAnnotation"))
            {
                Aspose.Pdf.Page page = pdfDoc.Pages[SourcePage];
				Aspose.Pdf.Text.TextFragmentAbsorber textFragmentAbsorbernew = new Aspose.Pdf.Text.TextFragmentAbsorber();
				Aspose.Pdf.Rectangle rect = annot.Rect;
			   
				textFragmentAbsorbernew.TextSearchOptions = new TextSearchOptions(rect);
				textFragmentAbsorbernew.Visit(page);
				try
				{
					foreach (Aspose.Pdf.Text.TextFragment TextFrag in textFragmentAbsorbernew.TextFragments)
					{
					   TextFrag.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(0,0,256);
					   
					}
				   
				}
				catch (NullReferenceException ex)
				{

				}
                    
                
            }
        }

@IqviaPal

We are checking it and will get back to you shortly.

@IqviaPal

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-55347

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.

Any updates on this issue?

@IqviaPal

The ticket was recently logged in our issue tracking system. Therefore, it is not yet investigated. We will be analyzing and resolving it on a first come first serve basis. As soon as we make some progress towards ticket resolution, we will update you via this forum thread. Please be patient and spare us some time.

We are sorry for the inconvenience.

Any updates on this ticket please?

@IqviaPal

We are afraid that the ticket could not get resolved due to other pending issues in the queue. Nevertheless, we have recorded your concerns already and will let you know as soon as we make some progress in this regard. We apologize for the inconvenience.

Can you please let us know, how long will it take to resolve this issue.

@IqviaPal

The tickets in free support model - as shared earlier - are resolved on first come first serve basis. The resolution time of the tickets depends upon the number of issues logged prior to it as well as the complexity level of the problem. We will surely inform you once the ticket is fully investigated and we have some news about its resolution ETA. Please spare us some time.

We apologize for the inconvenience.

Can you let us know, any updates on this issue?

@IqviaPal

We are afraid that the ticket has not been yet resolved. We will let you know within this forum thread as soon as we make some progress. We apologize for the inconvenience.

This is a long pending issue, can we expect the resolution on this ASAP

@IqviaPal

We do understand the severity of the issue for you. However, we are afraid that we can only raise the issue priority to a certain level inside free support model and that has been done already. We have recorded your concerns as well and as soon as some progress is made or we have any information about ETA, we will share with you. We highly appreciate your patience in this matter.