Creating a Dynamic Adobe PDF Using ColdFusion - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Creating a Dynamic Adobe PDF Using ColdFusion

Description:

In this course students will study advanced concepts in computer architecture. ... What Computer Architecture brings to table ... – PowerPoint PPT presentation

Number of Views:358
Avg rating:3.0/5.0
Slides: 29
Provided by: randy6
Category:

less

Transcript and Presenter's Notes

Title: Creating a Dynamic Adobe PDF Using ColdFusion


1
Creating a Dynamic Adobe PDF - Using ColdFusion
  • Randy Brown
  • brownra_at_msu.edu
  • Michigan State Univerisity
  • University Development

2
What You Will Need
  • Adobe Acrobat v5.0 (v4.0 or v3.0 will work)
  • Cold Fusion Studio or Text Editor (notepad)
  • Cold Fusion Application Server

3
What The Client Will Need
  • Acrobat 5.0 Reader (This will work with v3.0 or
    v4.0)
  • Acrobat Plug-In Compatible Browser (Preferably IE
    v5.0 or greater)

4
FIRST STEPYou will need to create a PDF document
5
Create a PDF Document
Step 1. Create a PDF Document using Adobe
Acrobat from any Windows application by selecting
the PDFWriter as your output device
Step 2. Print/Save PDF to the Web Server.
6
NEXT STEP You will need to create a PDF form
7
Create a PDF Form
Step 1. Use the existing PDF created.
Step 2. Insert Form Fields using Adobe Acrobat
Step 3 . Re-save PDF to Web Server.
8
Things to remember when Creating a PDF Form
  • Always give form fields a name
  • Do not use spaces in name
  • Always set the font and size
  • The border is optional but good to have

9
NEXT STEP Now you have a PDF form, how does it
work with a Web Server?
10
What happens when a Client request a PDF?
Client Requests PDF Doc
Client Receives PDF Doc
No magic here, the server handles
this request similar to a standard
html request.
Server Receives PDF Doc Request
Server Sends PDF Doc
11
NEXT STEP How do you create the data file (FDF)
to populate the PDF fields?
  • A FDF file is a standard DOS/ASCII file
  • This file holds all the data that will be merged
    with PDF form fields
  • Most importantly it holds the /F switch
    information

12
Create a FDF File
Step 1. Create a FDF file This can be accompli
shed with CF Studio, a text editor or more advanc
ed with a CFM.
Step 2. Save as filename.fdf to the Web Server
13
NEXT STEP We are going to take a closer look at
the base components and syntax of a FDF file?
14
Form Data File (FDF)
PDF-1.2 1 0 obj FDF File Header
15
Form Data File (FDF)
PDF-1.2 1 0 obj
Anywhere) /V(East Lansing, MI 48823)
Body (Field Definitions)
16
Form Data File (FDF)
PDF-1.2 1 0 obj
Anywhere) /V(East Lansing, MI 488233) /F(reg
istration.pdf)
PDF Filename
17
Form Data File (FDF)
/FDF /V(Purple Place) ) /V(123 Anywhere) StateZip) /V(East Lansing, MI 48823)
/F(registration.pdf) endobj tra
iler EOF
FDF File Footer
18
NEXT STEP Now you have a FDF file, how does it
works with a PDF and the Web Server?
19
What happens when a Client request a FDF file?
Client Requests FDF Doc
Client Receives FDF Doc
No magic here, the server handles
this request similar to a standard
html request.
Server Receives FDF Doc Request
Server Sends FDF Doc
Note FDF file has been created and saved on se
rver
already.
20
Overview of how the FDF file works with a PDF
Form
Client Requests Specified PDF Doc
Client Receives Merges PDF Doc w/ FDF file
  • After receiving FDF file from Server, the browser
    (per the Adobe Acrobat Reader) requests the PDF
    form specified in the /F line
  • Once received, the PDF is merged with the FDF
    file to create a final document
  • Hint This is the magic -).

Server Receives PDF Doc Request
Server Sends PDF Doc
21
NEXT STEP Now you understand the MAGIC of how
the PDF and FDF work together. Lets review how
ColdFusion handles a file request and how it fits
into this puzzle.
22
Overview of the ColdFusion file request system
Client Requests CFM File
Client Receives CFAS HTML Response
  • Web Server passes CFM page request to CFAS.
  • CFAS processes and returns (typically) HTML
    response.
  • Web Server passes on what appears to be a file

Server Receives CFM File Request
Server Sends CFAS HTML Response
Web Server sends CFM file to CFAS for Processing
CFAS sends back to web server an HTML formatted
response
23
ColdFusion FDF Integration
Client Receives CFAS FDF Response
Client Requests CFM File
  • Web Server passes CFM page request to CFAS.
  • CFAS processes and returns FDF response instead.

Server Receives CFM File Request
Server Sends CFAS FDF Response
Web Server sends CFM file to CFAS for Processing
Web Server passes on what appears to be an FDF
file
CFAS sends back to web server an FDF formatted
response
24
Overview of how the FDF file works with a PDF
Form(again)
Client Requests Specified PDF Doc
Client Receives Merges PDF Doc w/ FDF file
  • After receiving FDF file from Server, the browser
    (per the Adobe Acrobat Reader) requests the PDF
    form specified in the /F line
  • Once received, the PDF is merged with the FDF
    file to create a final document

Server Receives PDF Doc Request
Server Sends PDF Doc
25
LAST STEPHow do we automate this process using
ColdFusion
26
How to create the code to make a FDF on the fly
showdebugoutput"No" n/vnd.fdf" FDF-1.2 1 0 obj FDF /V(Purple Place) other fields
/F(registration.pdf) endobj tr
ailer EOF
27
How to add a Query to pull data from a database

SELECT FROM tblPeople WHERE PersonID k
id cfsetting enablecfoutputonly"Yes
" showdebugoutput"No" ion/vnd.fdf" FDF-1.2 1 0 obj /FDF /V(myQuery.Company) dress) /V(myQuery.Address)
28
Additional Resources
  • www.adobe.com
  • www.planetpdf.com
  • www.peakforms.com
  • www.pdfzone.com
Write a Comment
User Comments (0)
About PowerShow.com