Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Embed XFA form in Acrobat PDF form

Avatar

Level 4

I have a LiveCycle form to which I want to add a button that saves the file with a new filename by grabbing data from four fields. I can't find a way to do this using XFA javascript. I came across this possible alternative: embed the XFA form in an Acrobat PDF. Is this possible? Then in the Acrobat PDF, I could add a button and some javascript that I know works in Acrobat, and my problem is solved. I've attached the XFA form for reference.

6 Replies

Avatar

Level 10

Hi,

If you set up an Acrobat PDF (maybe with instruction as to how to fill out the form), then attach the XFA form to the PDF. The use could open the attachment; fill in the form; save it (back to the PDF) and then your Acrobat save as button will save the PDF.

The difficulty will be getting the users' input in the XFA form fields back into the PDF form, in order to affect the filename.

I was given a tip for a app.Media method (examples attached), which works for XFA forms. Information that is typed into Form 1, will automatically appear in Form 2 when it is opened. For example you may be able to get the XFA form to "broadcast" the values of the fields you want, but I am not sure if you can get the AcroForm to receive them (I expect you can because the script is using event.target).

Good luck,

Niall

Avatar

Level 4

Thank you, Niall. I'll check out the PDFs you attached. Thank you for the suggestions.

Avatar

Level 10

Hi,

OK, I couldn't let it go!! Here is a PDF AcroForm with an XFA Form attached. When the information is inputted into the attached XFA form, it will appear in the read-only fields in the PDF form.

Now there is calculation script in the Name field, but is not firing, so I temporarily put in an "update" button, which updates the values.

Really the form does not do much, other than show that you can script values from a XFA form into an AcroForm.

Good luck,

Niall 

Avatar

Level 4

Thank you! I want to see this in action! Now since I don't know all of the client's requirements, can you think of any reason why using field values in an AcroForm (in contrast to an XFA form which outputs XML and XDP or whatever) would NOT be a solution the client can live with? Is there something unique about XML/XDP?

Avatar

Level 10

Hi,

If I understand you correctly, you are checking if you develop the form in Acrobat or LiveCycle (?)

Acrobat is fine for developing forms, but does not have all of the dynamic abilities of LC. Personnaly I find it easier to design forms in LC, because for one you have the hierarchy view and the different panels to design each object.

Also I am (now) more comfortable with the LC flavour of Javascript.

LC is also better (I think) at talking to databases.

I think your main problem was the way Adobe deal with security issues in Acrobat / LC. I hope I have got question right. Glad you got the other .js working; you are welcome!

Good luck,

Niall

Avatar

Level 4

That is an excellent point! When I became involved with this form, it was almost finished, but no one told me that they developed in LC. So I started out in Acrobat! That confusion led to some testy moments. But we're OK now. The other js is doing exactly what the client wants (I think!), and my Plan B of embedding the form is now a moot point. A couple of adjustments to the scripting of that form, and we should be done! And I've learned a lot about LC, thanks to you!