Solved

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

Posted on 2013-05-14
3
801 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

15 Experts available now in Live!

Get 1:1 Help Now