Incorrect input string passed for font - TextFragmentAbsorber

Hello,

We are performing some operation on the attached pdf e5d69e9b-48db-49ea-8cfb-f51b407cccd8.pdf (173.2 KB)

Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(strFilePath);
TextFragmentAbsorber textAuditLogFragmentAbsorber = new TextFragmentAbsorber(“Audit Log”);
// Accept the absorber for all the pages
pdfDocument.Pages.Accept(textAuditLogFragmentAbsorber);

We are getting the below error on the above bold line of code.

Aspose.PDF - File Version 19.9.0.0
Incorrect input string passed for font FAAABG+TimesNewRomanPSMT-Identity-H
System.IndexOutOfRangeException: Index was outside the bounds of the array.

Aspose.PDF v 22.7.0.0
Index was outside the bounds of the array.

Can you please help?

Thanks,
Varun

@varun.arora

We have logged this problem in our issue tracking system as PDFNET-52152. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thanks Tahir.

Is there any ETA by dev team on this issue?
Our customers are waiting on this.

Thanks,
Varun

@varun.arora

Currently, this issue is pending for analysis. We will share the ETA of this issue with you after completing the analysis.

for (TextFragment textFragment : textFragment Collection) {
    textFragment.setText(someText);
}

throws:

com.aspose.pdf.internal.l6f.lI: Incorrect input string passed for font MDFKRC+DejaVuSans

BTW, the font is present on the system (Ubuntu 22.04):

:~# fc-list | grep 'DejaVuSans'
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-Oblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSans-ExtraLight.ttf: DejaVu Sans,DejaVu Sans Light:style=ExtraLight
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf: DejaVu Sans Mono:style=Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-BoldOblique.ttf: DejaVu Sans Mono:style=Bold Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-BoldOblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-Bold.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSans-Oblique.ttf: DejaVu Sans:style=Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSans-BoldOblique.ttf: DejaVu Sans:style=Bold Oblique

SDK version - 24.9

@MindControl

Looks like the font does not support the text or symbols you may have been trying to add. Can you please share minimal code snippet with hardcoded text values that you are trying to add and facing an exception? Please also share the sample document if you are adding text in an existing PDF.

I’m replacing the text using

textFragment.setText(someText);

Is there a way to determine that symbols are not supported with current font?

It can be done with:

Font currentFont = textFragment.getTextState().getFont();
if (!currentFont.doesFontContainAllCharacters(destText)) {
  //your code
}

@MindControl

Its nice to know that you have been able to resolve the issue. Please feel free to open a new topic in case you need further information.