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!
Updating fields on a LiveCycle form using Delphi |
Post Reply |
Author | |
zbrd
Beginner Joined: 25 Oct 09 Location: Indiana, USA Status: Offline Points: 7 |
Post Options
Thanks(0)
Posted: 25 Oct 09 at 3:42PM |
I am using LiveCycle 8 to create a form. I am utilizing QPDF 7.15 and Delphi 7 under WinXP.
I want to use LiveCycle to create a form because the form design is very easy and fast. The form doesn't have to have complex code, but it does have graphics, lines and text fields in it.
I then want to use this form as a template and copy it to a new name before updating the new form with QPDF calls.
After creating new form (from the template) I need to update the fields from Delphi7. I can not get this to work. I am trying to grab the fields by name, update and save but I can't seem to get it to find the fields. Here is the simple code I am trying to use:
if UnlockResult = 1 then begin
FileHandX := PDF.LoadFromFile(TestFName); if (FileHandX = 0) then // Error message goes here PDF.SetNeedAppearances(1);
wkInt := PDF.SetFormFieldValueByTitle('form1.Page1.Body.xAccountName1', 'Testing PDFLib by filling in Account Name'); PDF.UpdateAppearanceStream(1); SaveRC := PDF.SaveToFile(TestFName); if (SaveRC = 0) then // Error message goes here I have tried several combinations of the field name but still it does not update the field. It does save the document and I can open in Reader.
Any help would be appreciated.
|
|
conner
Beginner Joined: 16 Oct 09 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
First argument for UpdateAppearanceStream is index number to the field, is 'form1.Page1.Body.xAccountName1' your only form field? You can use FindFormFieldByTitle to get index i believe.
Dont really know about LiveCycle but could it be it uses XFA, tried SetXFAFormFieldValue? What does FormFieldCount and GetXFAFormFieldCount return?
Tried listing the names in the document, is there in fact a 'form1.Page1.Body.xAccountName1'?
for i := 1 to QPDF.FormFieldCount do
Memo1.Lines.Add( FQPDF.GetFormFieldTitle(i) );
Dont know if this helps
|
|
zbrd
Beginner Joined: 25 Oct 09 Location: Indiana, USA Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Thanks,
I was able to get it working by using the FindFormFieldBy Title then SetFormFieldValue with the index. I do find it interesting I have to use the full name for these LiveCycle forms (ie 'form1[0].Page1[0].xAdministrator1[0]').
I would have thought the name without the LiveCycle index would have worked.
I then flatten the fields at the end of updating.
|
|
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