Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / August 2007



Tip: Looking for answers? Try searching our database.

CFContent fails with output from CFPDF???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daemach2 - 28 Aug 2007 20:36 GMT
I had a situation where I had to create a PDF containing a dynamic cover sheet
and supporting documents, which are in pdf format.  I used CFDocument to create
the cover sheet, stored it in a variable, then used cfpdf with cfpdfparam to
specify that cover sheet variable, then looped over the files.  CFDump says
that worked correctly.

I then tried using cfcontent to display the resulting file.  I would have
expected that to work.  Intead it throws this:

 [b]Attribute validation error for tag cfcontent.[/b]

 [i]coldfusion.pdf.PDFDocWrapper is not a supported variable type.[/i] The
variable is expected to contain binary data.
 
The error occurred in
E:\WebRoot\www.missionincrease.com\wwwroot\active\Admin\MinistryGrants\fundingRe
quest.cfm: line 99

97 :    
98 :     <cfheader name="Content-Disposition" value='inline;
filename=#URLEncodedFormat("FundingRequest.pdf")#'>
99 :     <cfcontent reset="yes" variable="#pdfOut#" type="application/pdf">
100 : </cfif>

Is this a bug or am I doing something wrong?

<cfdocument format="pdf" marginbottom=".15" margintop=".15" marginleft=".15"
marginright=".15" name="report">
...
    <tbody>
    <tr><td colspan="2"><hr /></td></tr>
    <tr class="bold"><td align="right">Total: </td><td
align="right"><cfoutput>#DollarFormat(grandTotal)#</cfoutput></td></tr>
    </tbody>
    </table>
    </body>
    </html>
    </cfdocument>
   
    <cfpdf action="merge" name="pdfOut">
       <cfpdfparam source="report">
        <cfloop query="getFiles">
            <cfpdfparam
source="#Application.DocumentRoot##iif(Len(FilePath),DE('\#FilePath#'),DE(''))#\
#fileName#">
        </cfloop>
    </cfpdf>
   
   
    <cfheader name="Content-Disposition" value='inline;
filename=#URLEncodedFormat("FundingRequest.pdf")#'>
    <cfcontent reset="yes" variable="#pdfOut#" type="application/pdf">
Pepe - 30 Aug 2007 05:26 GMT
Hello.

I have a sample that you might be looking.

http://codfusion.shigeru-nakagaki.com/cf_samples/

Tree menu
 => cfpdf
   => pdfForm01

thanks

Shigeru ( Shigeru-Nakagaki.com )

> I had a situation where I had to create a PDF containing a dynamic cover sheet
> and supporting documents, which are in pdf format.  I used CFDocument to create
[quoted text clipped - 47 lines]
> filename=#URLEncodedFormat("FundingRequest.pdf")#'>
>         <cfcontent reset="yes" variable="#pdfOut#" type="application/pdf">
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.