We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Tabstops not working if TextFragment spans multiple lines

Hi Team,

I’m facing a problem around TextFragments and tab stops. They are working fine if the text in the TextFragment is short enough to fit in one line. However, if the text is a bit longer and gets wrapped into multiple lines, the tab characters are being written out as plain text and not replaced at all.

image.png (1.6 KB)
image.png (4.8 KB)

Also, is there a reason behind e.g. TabLeaderType.Solid not being rendered unless the textfragment’s text is underlined?

Regards,
Janos

@jkoromi

Are you using the latest version of the API? Would you please share the sample code snippet with us so that we can try to replicate the issue in our environment and address it accordingly?

Yes, I’m using 22.10.0.

var pdfDocument = new Document();
var tabStops = new TabStops();
tabStops.Add(new TabStop(200) { LeaderType = TabLeaderType.Solid });
var textFragment = new TextFragment("Very very very very very very very very very very very very very very very veryveryvery long text #$TAB", tabStops);
textFragment.TextState.Underline = true;
var page = pdfDocument.Pages.Add();
page.Paragraphs.Add(textFragment);
pdfDocument.Save("C:/Temp/output.pdf");

@jkoromi

We have logged an issue as PDFNET-53054 in our issue tracking system for further investigation. It has been linked with this forum thread as well. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Thank you for the quick response. Could you propose any workaround I could use until this is corrected?
Somehow I should be able to achieve a similar behavior.

@jkoromi

We are afraid that we cannot offer any workaround for this issue before it is properly investigated. Nevertheless, we will surely inform you as soon as we complete the investigation of the ticket and have some news about its fix ETA. Please spare us some time.

We apologize for the inconvenience.