sorry, i was assuming itext, i didn't see you were using cfdocument.  i don't 
know much about that tag

-----Original Message-----
From: Turetsky, Seth [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 14, 2006 10:46 AM
To: CF-Talk
Subject: RE: Create CF web service to return a PDF file


Funny, I'm tweaking a cfc to do this right now.
I use either a savePath attribute or a binary String return var

I find saving it is much more reliable.  Then you can redirect to it or use an 
iframe to view the pdf.
But, if you really must stream it to the browser, try something like this:
<cfcontent type="application/pdf; charset=ISO-8859-1"><cfheader 
name="Content-Disposition" 
value="filename=test.pdf"><CFSCRIPT>writeOutput(MyVariable);</cfscript>

in the cfc, i use this:
        binaryPDF = baosPDF.toString("ISO-8859-1");
        return binaryPDF;

-----Original Message-----
From: sonicDivx [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 14, 2006 10:11 AM
To: CF-Talk
Subject: Create CF web service to return a PDF file


I am trying to determine if I can create a web service that generates
a PDF document. Then call the web service to return the PDF.

Here is the basic web service I wrote

<cfcomponent displayname="printpdf">
        <cffunction name="printme" returntype="binary" access="remote" 
output="no">
                <cfargument name="myArgument" type="string" required="yes">
                 <cfdocument format="pdf" name="myResult">
                 test
                 </cfdocument>
                <cfreturn myResult>
        </cffunction>
</cfcomponent>

On the calling page I  just do a basic cfinvoke.  The data returned is
binary, but not sure how to get it to render as a PDF.  I've tried
<cfcontent type="application/pdf">  and nothing happens renders.

Any help would be much appreciated.

Thanks
Kevin





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:243450
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to