0

I need to run a pdf in cfm page.
It needs to run the standard program (acrobat reader ,...) and then, open my PDF file.

How can i do this?
Thanks

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by arrgh
0

... a pdf in cfm page.
It needs to run the standard program (acrobat reader ,...) and then, open my PDF file

Just to be clear, you can't control what happens on the user's computer from the CF server. What you *can* do is serve the pdf in such a way that it will most likely be opened by Acrobat. However, for that to happen, the user must have Acrobat installed on _their_ computer. Most people do have it installed - but again, that's not something you can control.

Anyway, if you already have an _existing_ pdf, use <cfcontent> with the correct mime type to serve the pdf to the user's browser.

<cfcontent type="application/pdf" file="c:\pathTo\yourFile.pdf">

If you prefer, you can use <cfheader> (first) to tell the browser whether the pdf should be treated as an "attachment" or displayed "inline" ie witin the browser window.

<cfheader name="content-disposition" value="attachment; filename="desiredFileName.pdf"/>
<cfcontent type="application/pdf" file="c:\pathTo\yourFile.pdf">

You can read more about both tags in the online documentation
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_c_11.html

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.