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 - Updating fields on a LiveCycle form using Delphi
  FAQ FAQ  Forum Search   Register Register  Login Login

Updating fields on a LiveCycle form using Delphi

 Post Reply Post Reply
Author
Message
zbrd View Drop Down
Beginner
Beginner


Joined: 25 Oct 09
Location: Indiana, USA
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote zbrd Quote  Post ReplyReply Direct Link To This Post Topic: Updating fields on a LiveCycle form using Delphi
    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.
Back to Top
conner View Drop Down
Beginner
Beginner


Joined: 16 Oct 09
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote conner Quote  Post ReplyReply Direct Link To This Post Posted: 02 Nov 09 at 2:12PM
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
Back to Top
zbrd View Drop Down
Beginner
Beginner


Joined: 25 Oct 09
Location: Indiana, USA
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote zbrd Quote  Post ReplyReply Direct Link To This Post Posted: 02 Nov 09 at 4:04PM
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.
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