Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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