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

CFFORM TO PDF

Guest
Jul 24, 2008 Jul 24, 2008

Copy link to clipboard

Copied

I am having trouble converting a form to pdf. I want the user to fill out a form and when they hit submit, I want it to be converted to a pdf and saved to my server. I will then email the pdf to an email address. I know that the cfdocument will convert it but not sure how to get it to work with the form. When I include it in the form it automatically converts the form without letting the user enter information into the form.

I just want the user to enter the information and convert that form (like a screen shot) into a pdf. I'm sure it's easy but I'm lost with this new CF8 feature. Please help...

what I have sorta setup is below.....

TOPICS
Advanced techniques

Views

500

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 Beginner ,
Aug 02, 2008 Aug 02, 2008

Copy link to clipboard

Copied

You can either save data to DBase and read back or populate direct.

Design a PDF form with fields using Adobe Acrobat professional, assign names to all fields, then populate same from CF as follows:
DO YOUR DATABASE QUERY. Make sure you are careful to follow field defenition and variable tags << /V(Variable) /T(Field Name) >>

This provides very robust method for populating fields in PDF form. If it hangs just remove the <CFSETTING> and <CFCONTENT> lines to check if CF is throwing an error, as PDF will just hang.

Ted Daniels

<body>
<CFOUTPUT>
<CFSETTING enablecfoutputonly="Yes" showdebugoutput="yes">
<CFCONTENT Type="application/vnd.fdf">
%FDF-1.2
1 0 obj
<<
/FDF
<<
/Fields
[
<< /V (<CFIF #GetAccident.Fatal# is 1>x</CFIF>)/T (Fatal)>>
<< /V (<CFIF #GetAccident.CMV# is 1>x</CFIF>)/T (CMV)>>
<< /V (<CFIF #GetAccident.SchoolBus# is 1>x</CFIF>)/T (SchoolBus)>>
<< /V (<CFIF #GetAccident.RailRoad# is 1>x</CFIF>)/T (RailRoad)>>
<< /V (<CFIF #GetAccident.MAB# is 1>x</CFIF>)/T (MAB)>>
<< /V (<CFIF #GetAccident.HitandRun# is 1>x</CFIF>)/T (HitAndRun)>>
<< /V (<CFIF #GetAccident.Supplement# is 1>x</CFIF>)/T (Supplement)>>
<< /V (#GetAccident.CountyName#)/T (CountyName)>>
<< /V (#GetAccident.CityName#)/T (CityName)>>
<< /V (#GetAccident.DistanceCity#)/T (DistanceCity)>>
<< /V (<CFIF #GetAccident.DirectionCity# is 'North'>x</CFIF>)/T (DirectionCity_N)>>
]
/F (PathName/PDF_FILE.pdf)

>>
>>
endobj
trailer
<</Root 1 0 R>>
%%EOF
</CFOUTPUT>
</body>

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
Explorer ,
Aug 04, 2008 Aug 04, 2008

Copy link to clipboard

Copied

LATEST
You could do like Ted Daniels said and save the information into a database and then read it back into a PDF Template that you create in Acrobat/Live Cycle. I would suggest getting the information from the database and then create an XML structure. You can then populate the template with the XML structure.

The nice thing about using the XML structure is that you don't have to put the fields in the exact order and if you have extra tags in the XML structure it doesn't matter to the template because it only cares about the tags that exactly match the field names. I think it's a bit easier to understand what's going on as well. Here is an example:

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