Solved

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

Posted on 2013-05-14
3
822 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Title # Comments Views Activity
iPhone looses session info 5 36
How can I use a ColdFusion function that is on the same page as a script? 4 103
CFIf Syntax and Logic 27 65
Problem with data displaying 2 29
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…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

679 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