Skip to main content
October 22, 2009
Answered

Streaming result of <cfpdf> merge to browser, NOT file on server

  • October 22, 2009
  • 1 reply
  • 1095 views

Hi guys, as my title suggests...I have a PDF document that was created with cfdocument...I then have used cfpdf to merge the results of that PDF with 2 other PDF's to make a final document...my question is, how to do get this resulting PDF to open in the browser (as it can with cfdocument) instead of writing a physical PDF file on the server?  I just need the user to be able to see and print the file, not actually save it on the server itself.

Something like:

<cfdocument format="pdf" name="pdfsource">

stuff here

</cfdocument>

<cfpdf action="merge" destination="temp/test.pdf" overwrite="yes">
    <cfpdfparam source="pdfsource">
    <cfpdfparam source="includes/nlv_affidavit.pdf">
    <cfpdfparam source="includes/nlv_certapp.pdf">
</cfpdf>

So far my research has turned up nothing on this particular instance, strangely.

Thanks in advance!

T

This topic has been closed for replies.
Correct answer -__cfSearching__-

I believe you can save the results to a variable, and then stream the variable to the browser using cfcontent. Though this entry is on watermarking, it does use the same variable/cfcontent technique. See the last two lines of the code

http://www.coldfusionjedi.com/index.cfm/2007/7/13/ColdFusion-8-Working-with-PDFs-Part-3

1 reply

-__cfSearching__-Correct answer
Inspiring
October 22, 2009

I believe you can save the results to a variable, and then stream the variable to the browser using cfcontent. Though this entry is on watermarking, it does use the same variable/cfcontent technique. See the last two lines of the code

http://www.coldfusionjedi.com/index.cfm/2007/7/13/ColdFusion-8-Working-with-PDFs-Part-3

October 23, 2009

Yep perfect! Thanks!!

Now I'm having another issue after that that I'll post separately.