I added my returnvar where I though it should fit in and get the following 
error;

Variable BAOSPDF is undefined. 

here is the modified code:

<cfsilent>
<cfscript>
  mPdf = createObject("java", "java.io.ByteArrayOutputStream").init();  
  mPdf = #docLite2#;
  MyVariable = baosPDF.toString("ISO-8859-1");
</cfscript>
<cfcontent type="application/pdf; charset=ISO-8859-1">
<cfheader name="Content-Disposition" value="filename=RM.pdf">
</cfsilent>

<CFSCRIPT>writeOutput(MyVariable);</cfscript>





> Try this, I think it should work, but I don't know anything about your 
> getPolicyDocument method, and why there are special characters there. 
> Also, just as a note you misspelled webservice(not sure if that 
> matters at all)
> 
> <cfsilent>
> <cfscript>
>       mPdf = createObject("java", "java.io.ByteArrayOutputStream").
> init();       
>       mPdf = webserivce.getPolicyDocument(…);
>       MyVariable = baosPDF.toString("ISO-8859-1");
> </cfscript>
> <cfcontent type="application/pdf; charset=ISO-8859-1">
> <cfheader name="Content-Disposition" value="filename=RM.pdf">
> </cfsilent><CFSCRIPT>writeOutput(MyVariable);</cfscript>
> 
> P.S. You'll need to watch for whitespace when doing things like this, 
> it could mess up the pdf when viewing, that is why I added the 
> cfsilents, but you'll need to do the same in your application.cfm
> 
> -----Original Message-----
> From: Torrent Girl [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 08, 2007 11:51 AM
> To: CF-Talk
> Subject: Re: binary to PDF
> 
> No not using iText
> 
> 
> here is the java equivilant of what i need to do in CF
> 
> 
> resp.setHeader("Content-Disposition", "filename=RM.pdf");
> 
> resp.setContentType("application/pdf");
> 
            
> 
> 
> byte[] mPdf = webserivce.getPolicyDocument(…); // This is what you 
> are getting
> 
> ServletOutputStream out = resp.getOutputStream();
> 
> out.write(mPdf);
> 
> out.close();
> 
> 
> 
> 
> 
> > Are you using iText? In the past, I created pdf's on the fly using 
> > byte arrays, so that I don't have to write to disk.
> > 
> > To display them, I did the following
> > <cfscript>
> > //all of my itext code
> > 
> > MyVariable = baosPDF.toString("ISO-8859-1"); </cfscript> <cfcontent 
> 
> > type="application/pdf; charset=ISO-8859-1"><cfheader 
> > name="Content-Disposition" value="filename=blahblah.
> > pdf"><CFSCRIPT>writeOutput(MyVariable);</cfscript>
> > 
> > Hope this helps
> > Seth
> > 
> > -----Original Message-----
> > From: Torrent Girl [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, February 08, 2007 9:02 AM
> > To: CF-Talk
> > Subject: Re: binary to PDF
> > 
> > Ok I will look at binaryDecode()
> > 
> > 
> > The formal term for what I am receiving is "array of bytes 
> (byte[])"
> > 
> > Specifically - "an array of bytes (byte[]) having contents of the
> > PDF(s) requested"
> > 
> > 
> > >Anyways, you will need to know the encoding format in order to 
> encode
> > 
> > >the data back into it's binary format. Take a look at 
> binaryDecode()
> > >
> > >Doug B.
> > >
> > >
> > >
> > >----- Original Message -----
> > >From: "Leitch, Oblio" <[EMAIL PROTECTED]>
> > >To: "CF-Talk" <[email protected]>
> > >Sent: Thursday, February 08, 2007 6:48 AM
> > >Subject: RE: binary to PDF
> > >
> > >
> > >>
> > 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:269210
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to