Solved

Coldfusion - cfpdf merge - automatically open pdf after it has been merged

Posted on 2013-05-14
3
794 Views
Last Modified: 2013-05-14
I an creating a dynamic pdf merge using CFPDF which works great.  It saves the merged pdf into the current active directory of the website, but I would like it to:

-merge the pdf's
-open the merged pdf without user intervention

How can I do this?

Max
0
Comment
Question by:MaxwellTurner
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 39166182
Try using the "name" attribute to send the merge results to a variable.  Then use cfcontent to display the contents in the browser. Something like

<cfpdf action = "merge"
      source="files to merge here"
      name="mergedPDFs" ...>

<cfheader name="Content-Disposition" value="inline; filename=someFile.pdf">
<cfcontent type="application/pdf" variable="#mergedPDFs#" reset="true">

Open in new window


In some versions you may have to wrap the pdf variable in ToBinary first:

    .. merge the pdfs ....
   <cfheader name="Content-Disposition" value="inline; filename=someFile.pdf">
   <cfcontent type="application/pdf" variable="#toBinary(mergedPDFs)#" reset="true">
0
 
LVL 1

Author Comment

by:MaxwellTurner
ID: 39166752
Oh I was sooo close!  I had to wrap it in toBinary.

Thanks again agx ... you make me look 'much smarter than I am' to the colleagues I do all this stuff for! ;)

Max
0
 
LVL 52

Expert Comment

by:_agx_
ID: 39167077
Aww, thanks... and you're welcome :)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now