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!
Set Font |
Post Reply |
Author | |
TomCollins88
Beginner Joined: 06 Jul 08 Location: United States Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 06 Jul 08 at 9:24AM |
Let's see what kind of response I can get on a Sunday.
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
TomCollins88
Beginner Joined: 06 Jul 08 Location: United States Status: Offline Points: 3 |
Post Options
Thanks(0)
|
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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
|
|
TomCollins88
Beginner Joined: 06 Jul 08 Location: United States Status: Offline Points: 3 |
Post Options
Thanks(0)
|
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store