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.

Sat Jun 17, 2017 10:54 pm

Hello!

I am attempting to get a list of embedded fonts in an imported PDF. I can pull in non-embedded fonts just fine, however, if there is an embedded font, it fails with a NullReferenceException. This failure occurs on line 3 and with any PDF I attempt to get a list of fonts for if they are embedded.

My code:
Code: Select all
Dim PDF As PdfDocument = New PdfDocument
PDF.LoadFromFile("C:\Sample.pdf")
Dim Fonts As PdfUsedFont() = PDF.UsedFonts()
Dim ListOfFonts As New List(Of String)
For Each Font As PdfUsedFont In Fonts
ListOfFonts.Add(Font.Name + " - " + Font.Style.ToString() + " - " + Font.Type.ToString())
Next


Any advice would be greatly appreciated!

amg
 
Posts: 1
Joined: Fri Jun 16, 2017 11:10 pm

Mon Jun 19, 2017 2:55 am

Hello,

Thanks for your inquiry.
If you were using the old version, please first upgrade it to the latest hotfix(Spire.PDF Pack(Hot Fix) Version:3.9.141). If the issue still exists after that, please send your sample file to us via email(support@e-iceblue.com) for a better investigation.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Jun 27, 2017 3:16 am

Hello,

Thanks for sharing your files with us via email. Now the issue of getting embedded fonts has been resolved and the hotfix is available now, please download Spire.PDF Pack(Hot Fix) Version:3.9.181 and have a test.
 
Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.PDF