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 - Help Using AddTrueTypeSubsettedFont
  FAQ FAQ  Forum Search   Register Register  Login Login

Help Using AddTrueTypeSubsettedFont

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

Joined: 18 Oct 19
Location: US
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote mmaclean Quote  Post ReplyReply Direct Link To This Post Topic: Help Using AddTrueTypeSubsettedFont
    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?
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: 18 Oct 19 at 10:48PM
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

Back to Top
mmaclean View Drop Down
Beginner
Beginner
Avatar

Joined: 18 Oct 19
Location: US
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote mmaclean Quote  Post ReplyReply Direct Link To This Post Posted: 21 Oct 19 at 1:18PM
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.
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 21 Oct 19 at 2:53PM
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.
Back to Top
Renaud View Drop Down
Beginner
Beginner
Avatar

Joined: 12 Feb 20
Location: France
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Renaud Quote  Post ReplyReply Direct Link To This Post Posted: 03 Jul 20 at 3:11PM
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 );


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