|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Need to convert dynamically populated forms to pdf |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|