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 - Set Font
  FAQ FAQ  Forum Search   Register Register  Login Login

Set Font

 Post Reply Post Reply
Author
Message
TomCollins88 View Drop Down
Beginner
Beginner
Avatar

Joined: 06 Jul 08
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote TomCollins88 Quote  Post ReplyReply Direct Link To This Post Topic: Set Font
    Posted: 06 Jul 08 at 9:24AM
Let's see what kind of response I can get on a Sunday. Big%20smile

I need to get some font info on text in the PDF document. If I do a GetPageText, I can get the name of the font, but not the ID.
If I want to use the GetTextWidth function, it uses the current selected font. But I don't see any method of actually selecting a font.

The purpose of this is to get the length of the text in question as sometimes the coordinates give me a length much, much longer than is correct.

Thanks for any help.

Tom
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: 07 Jul 08 at 3:11AM
Hi!

You can append/insert/select only few standard fonts (via FontID) to your pdf document... Backwards you can select (via FontID) one of the inserted Fonts.
...But there are many fonts in a document - not only the few standard fonts supported by QuickPDF - so there isn't a good way to determine the used fonts.

You can do it manually by separating each page, decrypt it, reading the content into a string and searching for the parts behind  '/BaseFont /' to get the embedded fonts.

Best regards,
Ingo
Back to Top
TomCollins88 View Drop Down
Beginner
Beginner
Avatar

Joined: 06 Jul 08
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote TomCollins88 Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jul 08 at 3:02PM
OK, thanks, but I still don't see a method of selecting a font.
For instance, if I use the Function FontName() then it returns the name of the selected font, or an empty string of no font is selected.

So I'm looking for a function something like: SetFont(FontID) or SetFont(FontName).

Any Ideas?

Thanks
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: 11 Jul 08 at 8:19AM
Hi!
If you want to set the font for the content of your new pdf-file you can do this ...
Have a look at the functions with Add...Font.
br,
Ingo
Back to Top
TomCollins88 View Drop Down
Beginner
Beginner
Avatar

Joined: 06 Jul 08
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote TomCollins88 Quote  Post ReplyReply Direct Link To This Post Posted: 11 Jul 08 at 10:28AM
I'm sorry, I having trouble conveying what I want to do.

I have an existing document already. I do not want to add any more fonts. I just want to set the current font to one already in the document. By using the font name would be preferable, but by using the font ID will work also.

This way I can use the GetTextWidth() function to see just how wide the text will be.

Thanks for your help. :-)

Tom
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: 11 Jul 08 at 11:23AM
Hi Tom!
 
There isn't any function in QuickPDF doing this.
See my posting here from 07.07.2008 ... you can search with own code.
Reading the pdf-content after decryption into string/stream and then searching for /BaseFont / ...
 
Best regards,
Ingo
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