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 - Get Font ID Using Font Name
  FAQ FAQ  Forum Search   Register Register  Login Login

Get Font ID Using Font Name

 Post Reply Post Reply
Author
Message
BoHo View Drop Down
Beginner
Beginner


Joined: 03 Apr 14
Location: Montana
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote BoHo Quote  Post ReplyReply Direct Link To This Post Topic: Get Font ID Using Font Name
    Posted: 03 Apr 14 at 7:50PM
Hi,
I am evaluating the QuickPDF Library and I'm pretty new to using it.

What I'm doing right now is accessing text objects in a CAD vector file and then converting it to a PDF file in VB6. When I access the text object in the vector file I can get the font's name, size and alignment flags used with the text. Then, I add the font to the PDF document using AddTrueTypeFont().

What I need to know is if there is a way to determine if a font has already been added to the PDF document by using the font's name to search for it prior to adding another one. And then., to be able to get the font ID using the font's name. I thought that if I added a font that had already been added previously, using AddTrueTypeFont(), that it would just return the id of the existing font. But it doesn't. It returns a new id even though I know that that particular font had already been added once. And since it's a new id I'm guessing that it's doubling up the font information for that particular font.

Is there anyway to search the fonts already added to a document by using the fonts name? Or do I need to keep track of the font's Id/Names myself in VB6 to know if it has already been added?

Thanks for any help.
Back to Top
hrdware View Drop Down
Team Player
Team Player
Avatar

Joined: 16 May 13
Location: Oklahoma, USA
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote hrdware Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 14 at 1:34PM
The easiest way is going to be to keep track of the fonts and their ID numbers as you add them. 

If you are using an existing document, I think you should be able to use the FindFonts call to get the number of fonts in the document, then loop through that list calling GetFontID to create a list of FontID's, then go through your list of FontID's, select each font and call FontName to get the name associated with each FontID.
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