The School for Champions is an educational website that shows you how to achieve your dreams.



Other ColdFusion topics:

Basics

Overview of ColdFusion

ColdFusion Features

Development methods

Setting up ColdFusion

ColdFusion Development Steps

Specific applications

Using Session Variables

Combining the Form and Action Pages

Using Drop-Down Lists

Converting ColdFusion to PDF

Dealing with Dates and Times

Sending a Flash Animation with ColdFusion Email

Changing Data to Telephone Format

Populating a New Database Table from an Old Table

Populating a Matrix Table

Sorting a Table Listing in ColdFusion

Also see:

Weekly Feedback Blog

ColdFusion Survey Results

Flash Development

Website Development

eLearning


SfC Home > ColdFusion >

Reader questions and feedback on ColdFusion Development. Also refer to markup language, CFML, Macromedia, Dreamweaver, code, web site, Ron Kurtus, School for Champions. Copyright © Restrictions

Answers to Readers' Questions on ColdFusion Development:

PDF

The following 16 comments and questions have been sent in. They are listed according to date.

List of first 10 items

Next 10


Had trouble with CF to PDF method

Question

January 17, 2008

i have used your cf to pdf demo but i must be doing something stupid as it is just producing the spill and not writing any file.
can you see for me.
http://www.maxmoment.co.uk/test/pdf_input.cfm

i have copied your example to the letter.
thanks

Ben - Australia

15155

Answer

The method is difficult to do. Unfortunately, your code did not come through my email system. You can try again.

If your server is CF MX7, you can use the tag:
xxxx

This makes the process much easier. The other method was a work-around.

Back to top


Help me to create PDF from HTML

Question

January 6, 2006

hi there,
i am new in Cold fusion. can you help me to create PDF from HTML using CF5.

thx.

shashi - India

9567

Answer

The code given in our lesson combines ColdFusion with the PDF mark-up language. It is very sensitive. You can try to duplicate what we have listed.

Note that servers with CF MX now have a tag that creates PDF files. That is the wave of the future.

Back to top


PDF file did not come up

Question

September 28, 2005

Greetings, I was looking at the following page http://www.school-for-champions.com/coldfusion/cftopdf2.cfm and it seemed a likely solution, however, no matter which browser I use to try this page, instead of returning a pdf, it downloads the fdf file. Is this a problem witht he way the server is set up ?

Thanks

David - USA

8328

Answer

That is interesting. I just tried it and it seems to work fine. Do you have any problems opening a PDF file from another site? Perhaps some security setting?

Note that if your server has CF MX 7.0, you can easily create a PDF file from any form without having to go through all the coding.

Back to top


I have a problem with PDF

Question

September 10, 2005

Hi;

I wil test your code but i have a problem with PDF can I have a copy from your pdf file

Your site is very interresting

Thanks

Fella - Canada

8067

Answer

The coding is very difficult to do with this method. Note that you need to create a PDF form to use it.

The new version of ColdFusion MX now has a simple method to convert pages to PDF.

Back to top


Problems using method

Question

May 13, 2005

Hi I tried out your code on my CF servers and had some intersting results. The first time when I entered just the pdf name "/F(test.pdf)" CF said it could not find the form and asked if I wanted to browse to it. I said yes and just pointed to a copy of the same file on my desktop. It then opened the PDF with the submitted data. Awesome!

But I then went to correct the file path issue and entered
"/F(http://ozone.ohsu.edu/ais/test.pdf)
This time it found the PDF and opened it but didn't pass in the form data.

Any idea why this isnt working??
Oh, lastly your sample code page that has a sample submit seems to have the same problem. It opens up your sample PDF but the form data didnt come across.
http://www.school-for-champions.com/coldfusion/cftopdf2.cfm

Also you mention needing activePDF Toolkit. I don't have it and this still seems to work.

David - USA

6968

Answer

This code is meant to be a free work-around instead of speading $$$ on activePDF Toolkit. Unfortunately, it is very touchy.

If your server is using ColdFusion MX version 7, there is now a CF tag that automatically creates a PDF . That is much easier to use.

Back to top


Doesn't work

Question

May 10, 2005

The contents of input.cfm is as follows


First Name


Last Name







The contents of output.cfm is as follows




%FDF-1.2
1 0 obj <<
/FDF <<
/Fields
[
<<
/T(date)
/V(#date#)
>>
<<
/T(fname)
/V(#form.fname#)
>>
<<
/T(lname)
/V(#form.lname#)
>>
]
/F(http://www.yoursite.com/pdf/file_name.pdf)
>>
>>
endobj
trailer
<>
%%EOF



I have tried out the code you have provided for converting the cfm to pdf. But I am getting the following error. "The file is damaged and could not be repaired". In fact there is no file is getting generated

Hearty - INDIA

6918

Answer

I assume that at http://www.yoursite.com/pdf/file_name.pdf you put in the URL of your site instead of "www.yoursite.com "and have a folder named "PDF".

Also, note that if the server is using ColdFusion version 7, you can print out the PDF directly, bypassing this code. Let me know if you have CF 7 and I'll tell you the new code.

Back to top


Using CF on a MAC

Question

April 25, 2005

I was wondering if it was possible to create a form to do the same thing but using a different database language. I do my web design on a Mac and I don't have access to a PC to run Cold Fusion. I basically need to create a form that will populate a standardized document with personalized information. I was wondering if there was another way to do it. I really enjoyed your site and the tutorials on it. Keep up the good work!

Thanks,
Jack daMac

Jack - USA

6765

Answer

You can install ColdFusion on a MAC for testing purposes. But the server that your site is on must have ColdFusion installed. I typcially test pages off the server instead of my PC.

Note that if the server has CF MX (version 7) you can create a PDF by simply using the new tag surrounding the output of your query.

Back to top


Populating without activePDF

Question

January 25, 2005

On The "Simple Method to Populate a PDF File with ColdFusion" Is there a way to go from a CFML (ColdFusion) page to PDF without using activePDF Toolkit? If so how would you go about doing so?

Thank you for your time,
Piet

- USA

5727

Answer

The method and code stated on the page:
http://www.school-for-champions.com/coldfusion/cftopdf2.cfm uses CFML and PDF code. It does not need activePDF.

Back to top


Doesn't work with IE

Question

November 12, 2004

Hi,
I've read your article about filling pdf forms using coldfusion and fdf. I've trie d to do the same:
- First, I've created a simple PDF form.
- Second, I've created the cfm templates as you explained.
- Third, I tested my own system. But when Acrobat is loading, microsoft explorer warns me and then if I click both "open file" or "Save" internet explorer tells me that the file doesn't exist.

Whats wrong? I've tried with mozilla Firebird and it works well, but I need it to work with internet explorer.

- EH

5000

Answer

Does the sample I have at
http://www.school-for-champions.com/coldfusion/cftopdf2.cfm work in your browser?

If it works in Mozilla, your code is correct. There must be a setting in IE that is affecting PDF files. Have you have trouble viewing a PDF from another source?

One thought is that it may have to do with your path. Internet Explorer can be a pain to work with.

Let me know what you find out.

Back to top


Does not seem to work in CF 6.1

Question

November 8, 2004

Hi Ron Kurtus,

Excellent article on CF to PDF.

I would love you to check out if Coldfusion MX 6.1 breaks this ability though. I had it working on my home machine, tried it at work.. no luck. The only difference I can see is CF MX 6.0 to 6.1. I even upgraded my development machine at home to 6.1 and yes, it seems to not work anymore!

Keep getting the error "The file is damanged and cannot be repaired" via the acrobat plugin.

- Canada

4957

Answer

Interesting. I believe the server we're using is 6.0. But I'm not sure why it would not work in 6.1. Note that the new version of CF will have the CF to PDF feature built in.

Back to top

Next 10

Summary

Hopefully, this reader feedback has helped provide information about ColdFusion issues.


Always do your best


Resources

The following are some resources on this topic.

Websites

ColdFusion Resources

Books

Top-rated books on ColdFusion


What do you think?

Do you have any questions, comments, or opinions on this subject? If so, send an email with your feedback. We will try to get back to you as soon as possible.

Feel free to establish a link from your website to pages in this site.


Where can you go from here?

School for Champions

ColdFusion topics

Answers to Readers' Questions


The School for Champions helps you become the type of person who can be called a Champion.