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!
![]() |
SetFormFieldValue |
Post Reply
|
| Author | |
HMArnold
Beginner
Joined: 03 Jun 09 Location: Texas Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: SetFormFieldValuePosted: 03 Jun 09 at 12:48AM |
|
When I run the following code, I get a count of 19 fields available, but after I run it I get a new PDF but the fields have no data:
procedure TForm1.ScanButtonClick(Sender: TObject);
var Fields, x : integer; ExptFile : string; PDF : TQuickPDF0712; begin ExptFile := 'Test.pdf'; PDF := TQuickPDF0712.Create; try if PDF.UnlockKey('xx') <> 1 then Raise EInvalidOp.Create('invalid unlock code'); if PDF.LoadFromFile(MasterPDF) <> 1 then Raise EInvalidOp.Create('unable to open PDF file : '+MasterPDF); PDF.SetNeedAppearances(1); Fields := PDF.FormFieldCount; ListBox1.Items.Add('Form Fields : '+IntToStr(Fields)); for x := 1 to Fields do begin if PDF.SetFormFieldValue (x,'Test '+IntToStr(x)) = 1 then ListBox1.Items.Add('ok'); PDF.UpdateAppearanceStream(x); end; if PDF.SaveToFile(ExptFile) <> 1 then Raise EInvalidOp.Create('unable to save PDF file : '+ExptFile); ListBox1.Items.Add('File saved : '+ExptFile); except Raise EInvalidOp.Create('PDF operation error'); end; end; Does anyone have example code?
Thanks
|
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 Jun 09 at 6:17AM |
|
Hi!
With your code the values are inside the formfields ... but not visible. If you want to make formfield-content visible you have to change the content to text. Please read about the function "FlattenFormField" that's what you need. Cheers, Ingo |
|
![]() |
|
HMArnold
Beginner
Joined: 03 Jun 09 Location: Texas Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 Jun 09 at 12:43PM |
|
I saw that in an earlier post of your and had tried that with no effect. After I checked the encyption status I saw the original PDF was protected, so I used the DecryptFile function first, and that allowed me to change the fields.
Thanks for your help!
Hank
|
|
![]() |
|
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