Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Jul 07, 2025 7:24 pm

I'm trying to extract text with location from attached .pdf document.
I'm using following code:

Code: Select all
using Spire.Pdf;
using Spire.Pdf.Texts;

void test()
{
  try
  {
    var fPath = @"C:\Temp\test_2.pdf";
    byte[] data = File.ReadAllBytes(fPath);

    using PdfDocument doc = new(data);
    var page = doc.Pages[0];
    PdfTextFinder textFinder = new(page);
    List<PdfTextFragment> txtList = textFinder.FindAllText(); // here exception occures
    txtList.ForEach(Console.WriteLine);
  }
  catch (Exception ex)
  {
    Diag.AddException(ex, pdfFile);
  }
}


Spire.Pdf.Texts.PdfTextFinder.FindAllText() yields exception:

System.Exception: illegal Subtype "Type2" in font dictionary.
at spr궑.옛(sprⓉ A_0)
at spr궑.옛(sprⓉ A_0, spr겐 A_1)
at spr莧.옛(sprⓉ A_0)
at sprꃄ.픪(spr嘻 A_0)
at sprꃄ.턦()
at sprꋆ.옛(spr圼 A_0)
at sprꋆ.옛()
at sprꋆ..ctor(PdfPageBase A_0, spr鳀 A_1)
at Spire.Pdf.Texts.PdfTextFinder.옛()
at Spire.Pdf.Texts.PdfTextFinder.FindAllText()

I'm using Spire.Office for .NET 8.12.2.
Is this issue already resolved in newest version?

Regards, Brane

bbrodnik
 
Posts: 20
Joined: Sat Jan 09, 2021 10:38 am

Tue Jul 08, 2025 3:31 am

Dear Brane,

Thank you for your inquiry.

I'm sorry that the issue you mentioned still exists in the latest version. I have urged Our Dev team to do further investigation and fix it. I will inform you immediately as soon as there is any progress.

We sincerely apologize for any inconvenience this may have caused.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Wed Aug 13, 2025 1:20 am

Dear Brane,

Thank you for your patience.
We just release official version(Hotfix:Spire.Pdf Version:11.8.0) which fixed the issue you encountered, welcome to test. Looking forward to your testing feedback.
Website:
https://www.e-iceblue.com/Download/down ... t-now.html
Nuget:
https://www.nuget.org/packages/Spire.PDF/11.8.0
https://www.nuget.org/packages/Spire.PD ... ard/11.8.0
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Return to Spire.PDF

cron