ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 30th, 2004, 02:53 PM
kikkid97 kikkid97 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 26 kikkid97 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 13 sec
Reputation Power: 0
Need to convert dynamically populated forms to pdf

I have some forms that are dynamically populated from queries from an Oracle database. These pages are displayed to the user as .cfm files. I'd like to convert the filled-in form to pdf. Any suggestions?

Reply With Quote
  #2  
Old June 30th, 2004, 03:14 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
There are numerous solutions to creating PDFs dynamically. You can look at ActivePDF or PDFLib. Or, if you're willing to dive into some Java, you can generate PDFs with something like Apache FOP. I also think there might be some custom tags at the Macromedia Exchange that do basic PDF generation.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old July 1st, 2004, 02:10 PM
kikkid97 kikkid97 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 26 kikkid97 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 13 sec
Reputation Power: 0
Thanks! I checke out ActivePDF because it looked really good. However, the customer support there was awful and I gave up after ActiveServer failed to install properly.

Reply With Quote
  #4  
Old July 5th, 2004, 12:47 PM
web_programmer web_programmer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 web_programmer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking Integration from Cold Fusion to PDF is easy!

Integrating to PDF is like integrating with RTF (Microsoft's language for the code that makes up MS Word docs) to dynamically create an MS Word doc.

The code that PDF docs is composed of actually can be edited directly inside of a text editor like Word Pad, DreamWeaver or any text file editor. It is called FDF and as long as you can create a file in a text editor and save it as .PDF you will be able to dynamically create a PDF doc.

How do I create a PDF doc using their language? Simple, you first create the PDF doc using your Adobe software as you normally would, then you export the FDF code into a text editor and can see it.

It is ugly and a huge coding nightmare, but nonetheless you can see the places of code here and there where your dynamic text is going to go into.

So, say for example, I have some FDF code in my notepad that looks like this:

///PDF 1}6} First Name: \\ Marc

I can only assume that all I am going to be doing is putting a nice and easy <cfoutput>#form.firstname#</cfoutput> in place of where it currently says "Marc". All the rest of their freakly looking code I am not going to touch (nor do I want to touch it because it will mess up my PDF doc big time).

You will do this for as many places as you can find in the FDF code where you need to make dynamic replacements like that.

Now, how do you get this document to load as a PDF doc?

Well, you will be dynamically creating the file on the server in real-time using the cffile tag.

Here is an example called create_file.cfm that is an action page. In other words, you are taking your form data and posting it here.

<form action="create_file.cfm" method="post"> and so on on the first page.

Now here is your second page below...................

<!----on the page before I asked for firstname and lastname in my Web form, so now I want to take those fields, load them into a PDF file and then open the PDF viewer/doc in a browser---->

<!----take your ugle FDF code and mix it in with some cold fusion code to get the overall parsed out code I want to turn into a PDF---->
<cfset my_code = "///PDF 1}6} First Name: #form.firstname# Last Name: #form.lastname#">

<!----make a random file name so other people won't share the same doc---->
<cfset the_file_name = "#randRange(100,500)#-#dateFormat(now(), "yyyymmdd")#-#randRange(100,500)#">

<!----create the file and stick the newly composed FDF code into it---->
<cffile action="write" file="c:\inetpub\e-commerce_scripts\some_folder\pdfs\#the_file_name #.FDF" output="#my_code#" addnewline="yes" nameconflict="overwrite">

<!----email the file if you want---->
<cfmail to=someone@somewhere.com from=support@medao.com subject="Your PDF Doc that just got created dynamically" type="html" mimeattach="c:\inetpub\e-commerce_scripts\some_folder\pdfs\#the_file_name #.FDF">

Check out the cool PDF doc that Medao Software Engineering just made dynamically

</cfmail>

<!----now present the file to the user on the HTML page---->
<p>Here is your file you just created! Just click here <a href="http://www.medao.com/e-commerce_scripts/some_folder/pdfs/#the_file_name#.FDF">#the_file_name#</a> to get it!

Marc
Software Engineer
Medao Corporation
Quick and Professional Web and Database Outsourcing for fellow Programmers
(519) 250-5787
support@Medao.com
www.Medao.com

Reply With Quote
  #5  
Old July 5th, 2004, 06:28 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
I think most folks would like something more simple and manageable than writing out FDF files manually. But if you don't mind being down "in the weeds" so to speak, then this might be a valid option. I prefer Apache FOP.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Need to convert dynamically populated forms to pdf


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT