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.

Wed Dec 24, 2025 8:33 am

I'm using following code to extract text from .pdf file:

Code: Select all
    static void test(string filePath)
    {
      byte[] data = File.ReadAllBytes(filePath);
         using var doc = new PdfDocument(data);
         foreach (PdfPageBase page in doc.Pages)
         {
            PdfTextFinder textFinder = new(page);
            List<PdfTextFragment> txtList = textFinder.FindAllText();
            txtList.ForEach(t => Debug.WriteLine(t.Text));
         }
      }


It works fine except for specific files like attached one.
I'm using Spire.Office ver. 8.12.2.

Can you find out what's the problem?

Regards, Brane

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

Wed Dec 24, 2025 9:56 am

Hello,

Thank you for your inquiry.
I reproduced your issue and logged it into our bug tracking system with the ticket SPIREPDF-7892. Our dev team will investigate and fix it, once it is resolved or there is any update, I will notify you immediately. Additionally, I noticed that the PDF file you provided uses the Triglav TheSans font. To assist us in further investigation, would it be possible for you to share the corresponding font file with us? Apologize for the inconvenience caused.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Tue Jan 20, 2026 9:50 am

I received file from outer source so I have no idea how to acquire Triglav TheSans font to share with you.

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

Wed Jan 21, 2026 1:36 am

Hello,

Thank you for your feedback.
Regarding the issue SPIREPDF-7892, our Dev team has completed the relevant investigation and no longer requires the font file at this stage. They are now focused on optimizing and adjusting the internal code. We appreciate your attention to this matter.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Thu Jan 22, 2026 9:59 am

Hello,

Thank you for your patience.
We just release official version(Hotfix:Spire.Pdf Version:12.1.6) which fixed the issue(SPIREPDF-7892), welcome to test. Please note that the garbled characters appearing in the text extracted by the new version are fundamentally due to the fact that the original PDF document lacks a proper mapping between its fonts and text content. If you use Adobe software to extract the text from this PDF into a TXT file, the result will also contain garbled characters. Thank you for your understanding.
Website link: https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
NuGet link:https://www.nuget.org/packages/Spire.PDF/12.1.6
https://www.nuget.org/packages/Spire.PDFfor.NETStandard/12.1.6
Sincerely,
Talia
E-iceblue support team
User avatar

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

Return to Spire.PDF