Skip to main content
Inspiring
February 24, 2010
Answered

CFCONTENT pdf error

  • February 24, 2010
  • 2 replies
  • 842 views

Hi

I recieve an error when I open the pdf generated in CF using the following code...

<cfcontent type="application/pdf">
<cfheader name="Content-Disposition" value="filename=test.pdf">
123

The error i recieve in Acrobat Reader reads as follows:

"Adobe Reader could not open test.pdf because it is either not a supported file type or because the file has been damaged (for example it was sent as an email attachment and it wasnt correctly decoded).

Please can someone explain why i keep getting this error.It works perfectly when i create dynamic XLS documents.

Thanks

Regards

Delon

    This topic has been closed for replies.
    Correct answer insuractive

    My guess is your problem is due to the fact that your content (123) is not a valid postscript document, which is the format that PDF documents are written in.

    2 replies

    February 26, 2010

    We had many problems with this under CF8... We finally decided that PDF's hate form elements, so we removed them and rendered them to LOOK like form elements instead of actually being form elements...  That worked for us...

    In your test PDF, remove EVERYTHING except plain text and then see if it still fails...

    If not then add things back in until it does...  This method, I virtually guarantee, will identify the issue for you, even if it is slow and tedious.

    D.

    insuractiveCorrect answer
    Inspiring
    February 26, 2010

    My guess is your problem is due to the fact that your content (123) is not a valid postscript document, which is the format that PDF documents are written in.