Getting an IncorrectFontUsageException (Document error: TJ operator without preceding Tf - no font set for the text segment) thrown when using page.Accept(TextAbsorber).
To reproduce, run the following code on the attached anthropic.pdf.zip (5.6 MB)
:
protected List<IText> GetTexts(Document pdfDocument, CancellationToken cancellationToken)
{
List<IText> list = new List<IText>();
int num = 1;
foreach (Page page in pdfDocument.Pages)
{
cancellationToken.ThrowIfCancellationRequested();
TextAbsorber textAbsorber = new TextAbsorber();
page.Accept(textAbsorber);
string text = textAbsorber.Text;
list.Add(new Text(num, text.Trim()));
num++;
}
return list;
}
@Buffer2018
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-61825
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.
1 Like
I am also getting the similar error for same code logic, hope we get the fix asap.
@gomesnayagam
We have attached the same ticket with your original forum thread. We will keep you posted with the status of its resolution. We are sorry for the inconvenience.
any update on this ticket?
@gomesnayagam
Nothing new, unfortunately.
Any updates on PDFNET-61825?
@craigrecordsure
I see no visible updates. I’ve requested a status from developers but so far it still seems unresolved