Skip to main content
Known Participant
May 20, 2010
Question

Reading Data into a PDF form with <cfpdfform and <cfpdfformparam

  • May 20, 2010
  • 2 replies
  • 3499 views

I have been trying to read data from a query into a PDF form. I have the application setup to generate a new pdf file for every record in the database table which is working perfectly, but when I try to have the application pre-populate the form fields in the pdf form they remain empty. I have included a snippet of the code that creates the PDF documents. I am using Adobe LiveCycle Designer 8.0 to create the PDF form.

Snippet Example:

<cfoutput query="renewals">
<cfset new_file = "#reportnumber#.pdf" />
<cfpdfform action = "populate" source = "beta.pdf" destination = "#new_file#">
  <cfpdfformparam name="Legal_Contact_Name" value="#LegalContactName#">
</cfpdfform>
<cfpdf action = "write" source = "#new_file#" destination = "#new_file#" flatten = "yes" overwrite  = "yes" />
</cfoutput>

All help is greatly appreciated...

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    August 30, 2011

    Has someone any experience inserting images in pdf forms?

    I have it working with a form created in LiveCycle Designer but the image disapears once I convert the pdf form with cfpdf action="write" flatten="yes" while the dynamic text is nicely converted to static text.  Why doesn't it work with images?

    Participating Frequently
    October 14, 2011

    I'm interested in this same topci?  Did you find a resolution to inserting images into a pdf form?  IF so, can you share it?

    Thanks

    st

    Participating Frequently
    October 14, 2011

    I'll get back to you next monday as the source code for this is at the office.

    I have indeed a working solution inspired by cfSearching's tips where I was finally able to output an image.  But as you can read from my previous post, the image mysteriously disapears when the form is being converted to static pdf :-\

    Inspiring
    May 20, 2010

    IIRC, LiveCycle often uses subforms. So perhaps you are not using the right syntax to access the form fields. For an example of using subforms, see the code at the bottom of this page.

    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_p-q_03.html

    webhead_1Author
    Known Participant
    May 20, 2010

    cfSearching

    I did try the <cfpdfsubform name="form1"> which returned the same result also if I wrap the <cfpdfform>  <cfdocument format="pdf">  I cannot use the destination attrabute of the <cfpdfform> tag.

    Inspiring
    May 20, 2010

    Well, the form is not necessarily going to be named "form1". )Though that is probably the default.) Every pdf is different. Yours may have a totally different structure. First - did you dump the pdf information to see its structure and field names?