• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Merge data and flaten a PDF form.

Valorous Hero ,
Jun 03, 2011 Jun 03, 2011

Copy link to clipboard

Copied

I am working for the first time on using ColdFusion to populate PDF forms.

I have a simple PDF form I created with my Acrobat 9 Pro tool.  Using the following code, pretty much straight from the documentation, I can easily populate the fields in the PDF with data and save a new PDF file with that data.

<cfpdfform
    source="#getDirectoryFromPath(getCurrentTemplatePath())#QP-ExpiringLetter.pdf"
    destination="#getDirectoryFromPath(getCurrentTemplatePath())#test.pdf"
    action="populate">
    <cfpdfformparam name="bus_name" value="123 PEST CONTROL">
    <cfpdfformparam name="bus_address" value="1234 MAIN STREET">
    <cfpdfformparam name="bus_city_state_zip" value="HOMETOWN, CA  98765">
</cfpdfform>

But the file is still a "Form" file with the fields editable.  I do not want this.  I want a static PDF file with the fields filled in with the data I provided.  Looking at the documentation, it seems the <CFPDF...> tag has functionality to flatten such form files and do what I want.  What I can not find documentation for, or guess at, is HOW to combine these two tags.  I know I could work with a PDF variable in the <CFPDF...> tag, but I see no way to capture the output of the <CFPDFFORM...> tag into such a variable, I can only send the output to the browser or a file.

Is that the only way to do this?  Send the output to a file, then read that file with the <CFPDF...> tag to flatten it to another file?  That seems a bit IO overhead heavy for what I feel should be able to be done in memory with just one file write.

TIA

Ian

TOPICS
Advanced techniques

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 03, 2011 Jun 03, 2011

Copy link to clipboard

Copied

I thibk the overhead isn't too bad with the memory filesystem. But you could also use DDX directly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 03, 2011 Jun 03, 2011

Copy link to clipboard

Copied

Ok, so now I just need to ALSO learn how to use a memory file system AND|OR DDX.  Two other features of which I am aware, but have never used before.  Off to the documentation I go again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 03, 2011 Jun 03, 2011

Copy link to clipboard

Copied

Well, it looks like RAM disk is out.  Apparently it is not supported in the <cfpdfform...> and|or <cfpdf...> tags.  When I tried, I was getting "file not found" errors.  Then I see in the documentation that these tags are not listed in the supported tags.

Using in-memory files in tags

The following tags are supported for in-memory files:

  • cfcontent

  • cfdocument

  • cfdump

  • cfexchange

  • cfexecute

  • cffeed

  • cfhttp

  • cfftp

  • cfimage

  • cfloop

  • cfpresentation

  • cfprint

  • cfreport

  • cfzip

I guess I am off to see how difficult this will be to do with DDX.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 03, 2011 Jun 03, 2011

Copy link to clipboard

Copied

It looks like I am back to square one.

DDX is part of the Life Cycle tool set.  As Far As I know, I am not working with Life Cycle here.

cfpdfform

Description

Manipulates existing forms created in Adobe® Acrobat® and Adobe® LiveCycle® Designer

I created my sample form with Adobe Acrobat 9 Pro Version 9.4.4.  Does that mean I have an Acrobat or a LiveCycle form?

ColdFusion supports two types of interactive forms: forms created in Adobe Acrobat 6.0 or earlier, and forms created in Adobe LiveCycle. In Adobe Acrobat Professional and Standard 7.0, Adobe introduced Adobe® LiveCycle® Designer for creating PDF forms.

And if I do have a LiveCycle form, what or how do I get a DDX version of it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 05, 2011 Jun 05, 2011

Copy link to clipboard

Copied

You can use DDX commands from CF with any PDF. DDX is a scripting language used by LiveCycle Assembler, which is a LiveCycle server component. CF includes a subset of LiveCycle Assembler.

http://www.adobe.com/devnet/coldfusion/articles/ddx_pdf.html

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 29, 2011 Jun 29, 2011

Copy link to clipboard

Copied

LATEST

With CFPDFForm there is an undocumented attribute name which you can use instead of destination, after that you can use the CFPDF with that name as the source before writing the flattened file out as a destination.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation