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!
Problem with Fonts |
Post Reply |
Author | |
hkoestner
Beginner Joined: 29 Oct 05 Location: Germany Status: Offline Points: 7 |
Post Options
Thanks(0)
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? |
|
hkoestner
Beginner Joined: 29 Oct 05 Location: Germany Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi
nobody any idea?? Horst |
|
ukobsa
Senior Member Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
Post Options
Thanks(0)
|
Hi Horst,
unfortunatly not. Can you give a sample pdf? You can send it to: support@quickpdf.org best regards, Uli |
|
marian_pascalau
Debenu Quick PDF Library Expert Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
Post Options
Thanks(0)
|
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 |
|
hkoestner
Beginner Joined: 29 Oct 05 Location: Germany Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi Marian,
it works great. Thanks for your help Horst |
|
marian_pascalau
Debenu Quick PDF Library Expert Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
Post Options
Thanks(0)
|
You are welcome :-)
|
|
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