Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Problems with Type1 Font info (as returned by QP)
  FAQ FAQ  Forum Search   Register Register  Login Login

Problems with Type1 Font info (as returned by QP)

 Post Reply Post Reply
Author
Message
Ruturaaj View Drop Down
Team Player
Team Player
Avatar

Joined: 12 Aug 09
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ruturaaj Quote  Post ReplyReply Direct Link To This Post Topic: Problems with Type1 Font info (as returned by QP)
    Posted: 22 Jun 10 at 5:01AM
Hello!

I'm having a PDF file with Type1 fonts embedded in it. I can see "(Embedded)" when viewed the Document Properties in Adobe Reader. However, when I attempt to get the Font information of Document using QuickPDF Lib, the FontType for the selected Type1 fonts is returned as "6", which means "Type1" font. So, this does not give me any hint whether the Font is embedded or not (or am I missing any basic concepts here?).

Since the FontType returned is not "4" (Embedded TrueType), the fonts are not saved to file using SaveFontToFile function. Is this the default limitation of QuickPDF or is there any other method to get this to work?

Waiting for your valuable reply...

Regards,

Ruturaaj.

Back to Top
Ruturaaj View Drop Down
Team Player
Team Player
Avatar

Joined: 12 Aug 09
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ruturaaj Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jun 10 at 5:38AM
I think there some problem with the SaveFontToFile function or something is wrong with my code or PDF file may be; not sure. I attempted to view the extracted TTF fonts with Windows Font Viewer and it says those are not valid Font files. It's also apparent from the icons ... the extracted TTF files does not show proper TTF file icon.

Am I expecting something too much from this function? Please explain.

Here is my simple VB6 code for your ready reference:


Set oPDF = New PDFLibrary
   
    With oPDF
   
        .UnlockKey UNLOCK_KEY
       
        .LoadFromFile txtPDFFile.Text
       
        .FindFonts
       
        For iCnt = 1 To .FontCount
           
            lFontID = .GetFontID(iCnt)
            .SelectFont lFontID
           
            If .FontType = 4 Then
                sSaveAs = txtSaveAsFolder.Text & "\" & .FontName & ".ttf"
                lRet = .SaveFontToFile(sSaveAs)
            End If
           
            DoEvents
           
        Next iCnt
           
    End With
   
Set oPDF = Nothing

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jun 10 at 8:59AM
Hi!

Please read the online-reference.
This function works only with truetype-fonts - not type1.

Cheers, Ingo

Back to Top
Ruturaaj View Drop Down
Team Player
Team Player
Avatar

Joined: 12 Aug 09
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ruturaaj Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jun 10 at 10:47AM
Hi!

Yes, I read about it ... is this limitation of QuickPDF or simply no method available to extract Type1 fonts from PDF?

Secondly, this method does extract the TTF fonts but the font files are treated invalid. I was expecting this function to extract font to TTF file which then I can take to my other computer and install the extracted font. However, there is some problem with the SaveFontToFile function ... did you try it? Were you able to extract TTF font to a valid font file? Try QuickPDF manual PDF file for example. Or am I doing anything wrong?

Regards,

Ruturaaj.

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jun 10 at 11:54AM
Hi!

I would think that they've started implementing methods
for saving fonts ... and first they want to do it with truetype
'cause it's the more wanted type. So perhaps later this
function will be enhanced?

Cheers, Ingo

Back to Top
Ruturaaj View Drop Down
Team Player
Team Player
Avatar

Joined: 12 Aug 09
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ruturaaj Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jun 10 at 1:54PM
Thanks for your reply! I continued to search for this issue as I wanted to trace why my Font files are not saved as valid Font Files. Yes, I'm talking about the TrueType Fonts and still they are not saved as valid Font File.

While searching, I landed on a Blog and found following text about embedded fonts in PDF:
Quote When a font is embedded in a PDF, not all of the font data are included. Obviously the font outline data are included as well as the font width tables. Other information, such as data about ligatures, are irrelevant within the PDF so those data do not get enclosed in a PDF.


So, I think the font information that's extracted to File is not the complete font, but just the outline of it and not the real character table and glyphs. So, when QP returned this information and saved to file, it didn't appear as valid font for Windows OS.

I'm not sure if this is the reason; just guessing that it's the reason. Any thoughts on this?

If QP continues to evolve on SaveFontToFile function scope then that's great ... but we cannot recreate the missing information to build a valid font file. So, if PDF is not carrying the entire Font file information for some obvious Font copyright issues then SaveFontToFile function looks of no use. Instead, if Developers concentrate to transfer the embedded font information from one PDF to another thereby allowing developers to simply copy the embedded fonts from one PDF to another then it will be more useful and practical too. This will especially prove helpful in case of splitting PDF files or merging one PDF file into a newly created PDF file.

In fact, I never paid attention to the Font issue when merging two PDF files with QP before! If you find any information related to "Font Extraction to a valid TrueType Fonts" then please share with me.

Regards,

Ruturaaj.




Edited by Ruturaaj - 22 Jun 10 at 1:55PM
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jun 10 at 4:46AM
For some reason I seem to remember that the font name may say embedded if retrieved through QP. Give that I try.

Just a thought
Wheeley
Back to Top
Ruturaaj View Drop Down
Team Player
Team Player
Avatar

Joined: 12 Aug 09
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ruturaaj Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jun 10 at 7:40AM
Hi Wheeley,

Thanks for your reply. In my all tests, I didn't face any problem in retrieving Font names; all names are correctly returned by QP. The issue is related to the Font file when saved with SaveFontToFile function. Give it a try and let me know if you could import/install the extracted font correctly in your OS.

Regards,

Ruturaaj.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store