You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Pete Allison <ma...@aol.com> on 2009/01/07 17:59:26 UTC

RE: Servlet Output Filename

All,

I cannot figure out how to specify the output filename when calling FOP from
a servlet. I extended the example servlet that came with the distribution.

I confess I know just enough JAVA to be dangerous, but that didn't stop me
from successfully using FOP. However, on this I'm stumped and I must be able
to allow the user to specify the outfile name.

I have search the FAQs, the internet, and tried to use setOutfile.

I'm using 0.94.

Thanks,
Pete Allison
"Do or do not. There is no 'try.' " - Yoda



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Servlet Output Filename

Posted by Pete Allison <ma...@aol.com>.
Thanks, I had just figured this out. Same technique.

Took me a little while the find the proper spot in the Servlet (remember I'm
JAVA-challenged) but have got it working.

Thanks,
Pete Allison

-----Original Message-----
From: Steve Quirk [mailto:squirk@ieee.org] 
Sent: Wednesday, January 07, 2009 12:03 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Servlet Output Filename




On Wed, 7 Jan 2009, Pete Allison wrote:

> All,
>
> I cannot figure out how to specify the output filename when calling 
> FOP from a servlet. I extended the example servlet that came with the
distribution.
>
> I confess I know just enough JAVA to be dangerous, but that didn't 
> stop me from successfully using FOP. However, on this I'm stumped and 
> I must be able to allow the user to specify the outfile name.
>
> I have search the FAQs, the internet, and tried to use setOutfile.

I'm not familiar with the servlet example, but normally in a servlet you'd
set the content-disposition header:

     HttpServletResponse aResponse;   // assume you have this
     aResponse.setContentType("application/octet-stream");
     aResponse.addHeader("Content-Disposition", "attachment; filename=\"" +
aName + ".pdf\"");

Steve

>
> I'm using 0.94.
>
> Thanks,
> Pete Allison
> "Do or do not. There is no 'try.' " - Yoda
>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Servlet Output Filename

Posted by Steve Quirk <sq...@ieee.org>.


On Wed, 7 Jan 2009, Pete Allison wrote:

> All,
>
> I cannot figure out how to specify the output filename when calling FOP from
> a servlet. I extended the example servlet that came with the distribution.
>
> I confess I know just enough JAVA to be dangerous, but that didn't stop me
> from successfully using FOP. However, on this I'm stumped and I must be able
> to allow the user to specify the outfile name.
>
> I have search the FAQs, the internet, and tried to use setOutfile.

I'm not familiar with the servlet example, but normally in a servlet you'd 
set the content-disposition header:

     HttpServletResponse aResponse;   // assume you have this
     aResponse.setContentType("application/octet-stream");
     aResponse.addHeader("Content-Disposition", "attachment; filename=\"" + aName + ".pdf\"");

Steve

>
> I'm using 0.94.
>
> Thanks,
> Pete Allison
> "Do or do not. There is no 'try.' " - Yoda
>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org