Major issue introduced in 20.7 - Text Segment TextState ignored

A fairly major bug has been introduced into Aspose PDF 20.7 and above. 20.6 and below work fine. This is a bug as we have iterated through each package since 19.x successfully and written code against this feature - which is also documented on this site.

If a TextFragment has any TextState attributed to it (For example setting it to a normal font style or specific color), and then you add or append any TextSegments which have their own TextStyles defined, these are then ignored and the entire fragment renders using the parent style.

This means that it is now impossible to have a Text Fragment and alter the style of a subset of it (For our usage we iterate over paragraphs and make certain words bold)

The code for this is below to replicate

  Document pdfDocument = new Document();
  Page pdfPage = (Page)pdfDocument.Pages.Add();

  var t = new TextFragment();
  t.TextState.FontStyle = FontStyles.Regular;
  t.TextState.ForegroundColor = Color.Blue;      
  var boldText = new TextSegment("I am red bold text.");
  boldText.TextState.FontStyle = FontStyles.Bold;
  boldText.TextState.ForegroundColor = Color.Red;
  var normalText = new TextSegment("I am normal text.");      
  t.Segments.Add(boldText);
  t.Segments.Add(normalText);
  pdfPage.Paragraphs.Add(t);
  pdfDocument.Save(@"C:\TEMP\ASPOSE.PDF");

In a working scenario this would yield

I am red bold text.I am normal text. (In red and blue)
Since 20.7 this yields
I am red bold text.I am normal text. , (all in blue)

As we have built a rather extensive tagging library around this feature for a large enterprise application this is fairly critical, and given that we have just renewed our licence and are unable to upgrade to accept other bug fixes this is now a blocker.

As a temporary measure I can stay on 20.7 but would need Aspose to fix this ASAP or refund part of the newly upgraded licence as we are unable to upgrade to the latest software due to this bug - Unless another workaround can be provided.

@R_C_D_T

We really apologize for the inconvenience you have been facing due to this issue. We were able to replicate the bug in our environment and logged it as PDFNET-48777 in our issue management system. We have also recorded your concerns and will keep them in view during investigation against the ticket. We will inform you as soon as we make some certain progress towards its resolution. Please give us some time.

We again apologize for the inconvenience.

Is there any update on this as we cannot upgrade to this months release to get another fix without this issue being present.

@R_C_D_T

We are afraid that earlier logged ticket is not yet resolved. We will surely investigate and resolve it on first come first serve basis. Once the investigation against it is completed, we will be able to share some updates with you regarding its resolution ETA. Please be patient and give us some time.

We are sorry for the inconvenience.

Is there any indication of the position in the queue for this?

As Aspose introduced this bug in 20.7 it means that we cannot update our system to use the latest versions
This means that we cannot make use of other fixes since 20.7, and more frustratingly we are paying a licence to cover 12 months of upgrades that we cannot accept

If this was an obscure issue I would understand having to wait, but as Aspose introduced this bug due to lack of testing this should be prioritized or a license renegotiation should occur - which your sales team don’t seem to understand.

@R_C_D_T

We are collecting the information regarding investigation results against the logged ticket and will soon try to share some ETA with you. We do understand the severity of the issue for you and humbly apologize for the inconvenience being faced. We have raised the issue priority to next level while considering your concerns. We will let you know soon about further updates. Please give us little time.

We are sorry for the delay and inconvenience.

@R_C_D_T

We would like to inform you that issue has been scheduled for investigation during next week and as soon as the analysis is completed, we will share updates about its ETA with you.

1 Like

I see that the item has been resolved, am I correct in thinking this will be in the 20.12 release which is imminent?

@R_C_D_T

Yes, you are right. The ticket has been fixed and will be included in upcoming release 20.12. We will update within this forum thread as soon as new release is available.

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