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!
![]() |
Help Using AddTrueTypeSubsettedFont |
Post Reply ![]() |
Author | |
mmaclean ![]() Beginner ![]() ![]() Joined: 18 Oct 19 Location: US Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 18 Oct 19 at 3:03PM |
I have a programming loop that adds Unicode strings to a PDF file. When I call AddTrueTypeSubsettedFont() function I get a new fontID each time and my file size get very large. Does this mean that QuickPDF is adding a new font for each sting I add? Would calling UpdateTrueTypeSubsettedFont() make a smaller sized file? What font is updated when I call this function? Does anyone have a clear example of how to use these two functions?
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi mmaclean,
inside there's a special chapter having to do with "PDF Fonts": http://www.debenu.com/docs/pdf_library_developer_guide/foxit_quick_pdf_library_15_developer_guide.pdf Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
![]() |
|
mmaclean ![]() Beginner ![]() ![]() Joined: 18 Oct 19 Location: US Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Hello Mr. Ingo, Thank you for the information, however, I have read that section and in fact most of the QuickPDF developer's guide and function reference manual and they have not come close to answering the questions I have, which is why I posted on this site. Perhaps some kind programmer will have already figured out what I am asking by trial and error.
|
|
![]() |
|
tfrost ![]() Senior Member ![]() Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
![]() ![]() ![]() ![]() ![]() |
The documentation for UpdateTrueTypeSubsettedFont() clearly says that it updates the selected font. So, add the characters you want, select the font, update it with more characters. No trial and error should be involved, just trial in your own program, and see if the file size is reduced. My guess is that it will be; but like many users here I have not used every function in the library, including this one.
|
|
![]() |
|
Renaud ![]() Beginner ![]() ![]() Joined: 12 Feb 20 Location: France Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
Hello Everyone,
I wouldlike to share some experience about AddTrueTypeSubsettedFont and UpdateTrueTypeSubsettedFont using active X version 16.13 of quick pdf. function seems to always return 0 ( even when it worked) if you AddTrueTypeSubsettedFont with option 2, 4, 5 UpdateTrueTypeSubsettedFont works until you close the file. when you LoadFromfile a PDF containing a subsetted font added with AddTrueTypeSubsettedFont and you FontSelect this font, AddTrueTypeSubsettedFont do not work. something like that do not work : $fid = $qp->AddTrueTypeSubsettedFont("Arial Unicode MS","A" , 2); $qp->SaveToFile("out.pdf"); $doc_id = $qp->SelectedDocument(); $qp->RemoveDocument($doc_id); $qp->LoadFromFile(__DIR__ ."\\out.pdf",""); $totalfont =$qp->FindFonts(); $ffid =0; for ($f = 1 ; $f<= $totalfont; $f++){ $fid =$qp->GetFontID($f); $qp->SelectFont($fid); if ((strpos($qp->FontName(), 'Arial Unicode MS') !== false)&&$fid!=0) { $ffid = $fid ; } } $qp->SelectFont($ffid) $textRussian = "toto Нет никого, кто любил бы боль саму по себе, кто искал бы её и кто хотел бы иметь её просто потому, что это боль"; $qp->UpdateTrueTypeSubsettedFont($textRussian); $qp->DrawText(10, 180, $textRussian ); |
|
![]() |
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