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 - Problem with Fonts
  FAQ FAQ  Forum Search   Register Register  Login Login

Problem with Fonts

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

Joined: 29 Oct 05
Location: Germany
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote hkoestner Quote  Post ReplyReply Direct Link To This Post Topic: Problem with Fonts
    Posted: 08 Oct 07 at 10:06AM
Hi all,

I want to replace the Font of the Formfields on my Form.

The Code is:

QP := TiSEDQuickPDF.Create;
QP.UnlockKey('Key');
Pfad := ExtractFilePath(Application.Exename);
OpenDialog1.InitialDir := Pfad + 'Forms\';
try
    if OpenDialog1.Execute then begin
      Test := QP.LoadFromFile(OpenDialog1.FileName);
      Test := QP.AddStandardFont(8);
      Test := QP.SaveToFile(OpenDialog1.FileName);
      Test := QP.LoadFromFile(OpenDialog1.FileName);
      for I := 1 to QP.FormFieldCount do begin
        Test := QP.SetFormFieldFont(i, 3)
      end;
    end;
    Test := QP.SaveToFile(OpenDialog1.FileName);
except
end;

The original document has 2 Fonts. After adding the new font and saving the document ther are correct 3 Fonts embedded. The update from the formfieldfont faild, when i use the font number 2 then i become Wingdings, although Wingdings is not in the embedded fonts contained or when i use font number 3 (what was correct) the font dont change.

Can help any one?
Back to Top
hkoestner View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Oct 05
Location: Germany
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote hkoestner Quote  Post ReplyReply Direct Link To This Post Posted: 11 Oct 07 at 10:22AM
Hi

nobody any idea??

Horst
Back to Top
ukobsa View Drop Down
Senior Member
Senior Member


Joined: 29 May 06
Location: Germany
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote ukobsa Quote  Post ReplyReply Direct Link To This Post Posted: 11 Oct 07 at 3:39PM
Hi Horst,

unfortunatly not. Can you give a sample pdf? You can send it to: support@quickpdf.org

best regards,
Uli
Back to Top
marian_pascalau View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 28 Mar 06
Location: Germany
Status: Offline
Points: 278
Post Options Post Options   Thanks (0) Thanks(0)   Quote marian_pascalau Quote  Post ReplyReply Direct Link To This Post Posted: 18 Oct 07 at 9:05AM
Hi there,
I believe I was not meant when you send the test file but because I am also behind the support email address I have an answer for you :-)
 
You wrote something like this:
 
    Test  := Pdf.AddStandardFont(8);
    for i := 1 to Pdf.FormFieldCount do
        Test := Pdf.SetFormFieldFont(i, 3);
 
And I write something different:
 
    hFont  := Pdf.AddStandardFont(8);
    ASSERT(hFont  <> 0); 
        // this function add a new font to PDF Contents and Dictionaries.
        // The return is kind of Handle for Font !!!
    idFont := Pdf.AddFormFont(hFont);
    ASSERT(idFont <> 0); 
        // this function make Font available for FormFields !!! 
        // The return value is the ID of your FormFieldFont !!!
        // Only now you can use this ID in your program
        // (in your case it should have value 3)
    for nIndex := 1 to Pdf.FormFieldCount do
    begin
        Test := Pdf.SetFormFieldFont(nIndex, idFont);
        ASSERT(Test = 1);
 
        { do the rest of your job }
    end;
If this works then please pay more attention on the types of return codes and use variable names depending on their purpose. This makes your program more visible and will avoid missunderstandings by default.
 
Best regards, Marian
Back to Top
hkoestner View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Oct 05
Location: Germany
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote hkoestner Quote  Post ReplyReply Direct Link To This Post Posted: 18 Oct 07 at 10:01AM
Hi Marian,

it works great.

Thanks for your help
Horst
Back to Top
marian_pascalau View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 28 Mar 06
Location: Germany
Status: Offline
Points: 278
Post Options Post Options   Thanks (0) Thanks(0)   Quote marian_pascalau Quote  Post ReplyReply Direct Link To This Post Posted: 18 Oct 07 at 11:59AM
You are welcome :-)
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