Thread: Handling PDF

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    17
    Rep Power
    0

    Handling PDF


    I have a link that returns a PDF.

    sample link: www.sample.com\servlet?account=1234567

    How will I instantly display this link on a page without using HREF?

    I tried cfhttp.filecontent but it only displays random stuff like you open a PDF in a notepad.

    I currently use IFRAME to display the link and work fine.

    <IFRAME width="1100" height="800" src="www.sample.com\servlet?account=1234567"></IFRAME>

    Problem is, I need to have a print functionality. But using IFRAME, it doesnt show me the PDF.

    I think i need to use something like the filecontent.

    Can anyone please help me?
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,264
    Rep Power
    968
    Not sure what this has to do with ColdFusion, but as far as I know your only option to display the PDF inline on the page is with an iframe. For printing it, you can try some of the JavaScript techniques documented elsewhere.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    17
    Rep Power
    0
    Originally Posted by kiteless
    Not sure what this has to do with ColdFusion, but as far as I know your only option to display the PDF inline on the page is with an iframe. For printing it, you can try some of the JavaScript techniques documented elsewhere.
    Sorry for not mentioning. I am really coding at coldfusion. Sadly I cant use cfpdf and cfdocument cause im using ver 6.1. So i have no choice but to use java script.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    84
    Rep Power
    10
    Not sure of your exact requirements, but this might be useful:

    Code:
    <cfheader name="Content-Disposition" value="filename=#filename#">
    <cfcontent file="#pathToFile#" type="application/pdf">

IMN logo majestic logo threadwatch logo seochat tools logo