You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "LEONARD Julien (Consulting for ACCOR Hotels)" <ju...@consulting-for.accor.com> on 2007/11/27 11:01:14 UTC

[S2] Image Generation

Hello all,
 
I want to develop an action that return an image. This image is based on
a image file and a text put in the middle of the image.
I've look at JasperReports and I think that is to complicated for my
use.
I think that I can do this with a simple xslt-fo and FOP to create a
PDF, but I don't see how to plug FOP in Struts2...
Maybe, I have to create a custom result type that use FOP?
 
Can somebody help me?
 
Julien


This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
********************************************************************** 
Ce message electronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci apres "le message" ), sont confidentiels et destines exclusivement a l'usage de la  personne a laquelle ils sont adresses. Si vous avez recu ce message par erreur, merci  de le renvoyer a son emetteur et de le detruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressement autorisees de ce message, sont interdites.
********************************************************************** 


Re: [S2] Image Generation

Posted by Martin Gainty <mg...@hotmail.com>.
agreed

If you want a simple, easy to configure and works great in Tomcat PDF
Rendering Engine use FOP 0.94
http://www.eu.apache.org/dist/xmlgraphics/fop/source/

Ping me offline if you have any questions with fop..

M--
----- Original Message -----
From: "Ted Husted" <hu...@apache.org>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, November 27, 2007 9:34 AM
Subject: Re: [S2] Image Generation


> There's also an example on the Ajax page.
>
>  * http://struts.apache.org/2.x/docs/ajax.html
>
> The Ajax example is returning text, but it could just as easily stream
> back a PDF.
>
> --  HTH, Ted
> <http://www.husted.com/ted/blog/>
>
> On Nov 27, 2007 6:37 AM, Omkar Patil <os...@gmail.com> wrote:
> >
> > I'm sorry the example is messed up as it contains xml. Here is the link
for
> > it -
> >
> > http://struts.apache.org/2.x/docs/stream-result.html
> >
> >
> >
> > Omkar Patil wrote:
> > >
> > > Julien,
> > >
> > > I could be completely off-mark here. If I understand correctly you are
> > > planning to generate a PDF (or an image) and then send it to the
browser.
> > > This can be achieved using the Stream Result. Here is the code snippet
> > > from the S2 documentation -
> > >
> > > <result name="success" type="stream">
> > >   image/jpeg
> > >   imageStream
> > >   filename="document.pdf"
> > >   1024
> > > </result>
> > >
> > > Hope this helps.
> > >
> > > - Omkar
> > >
> > >
> > > Julien Leonard-2 wrote:
> > >>
> > >> Hello all,
> > >>
> > >> I want to develop an action that return an image. This image is based
on
> > >> a image file and a text put in the middle of the image.
> > >> I've look at JasperReports and I think that is to complicated for my
> > >> use.
> > >> I think that I can do this with a simple xslt-fo and FOP to create a
> > >> PDF, but I don't see how to plug FOP in Struts2...
> > >> Maybe, I have to create a custom result type that use FOP?
> > >>
> > >> Can somebody help me?
> > >>
> > >> Julien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Image Generation

Posted by Ted Husted <hu...@apache.org>.
There's also an example on the Ajax page.

 * http://struts.apache.org/2.x/docs/ajax.html

The Ajax example is returning text, but it could just as easily stream
back a PDF.

--  HTH, Ted
<http://www.husted.com/ted/blog/>

On Nov 27, 2007 6:37 AM, Omkar Patil <os...@gmail.com> wrote:
>
> I'm sorry the example is messed up as it contains xml. Here is the link for
> it -
>
> http://struts.apache.org/2.x/docs/stream-result.html
>
>
>
> Omkar Patil wrote:
> >
> > Julien,
> >
> > I could be completely off-mark here. If I understand correctly you are
> > planning to generate a PDF (or an image) and then send it to the browser.
> > This can be achieved using the Stream Result. Here is the code snippet
> > from the S2 documentation -
> >
> > <result name="success" type="stream">
> >   image/jpeg
> >   imageStream
> >   filename="document.pdf"
> >   1024
> > </result>
> >
> > Hope this helps.
> >
> > - Omkar
> >
> >
> > Julien Leonard-2 wrote:
> >>
> >> Hello all,
> >>
> >> I want to develop an action that return an image. This image is based on
> >> a image file and a text put in the middle of the image.
> >> I've look at JasperReports and I think that is to complicated for my
> >> use.
> >> I think that I can do this with a simple xslt-fo and FOP to create a
> >> PDF, but I don't see how to plug FOP in Struts2...
> >> Maybe, I have to create a custom result type that use FOP?
> >>
> >> Can somebody help me?
> >>
> >> Julien

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Image Generation

Posted by Omkar Patil <os...@gmail.com>.
I'm sorry the example is messed up as it contains xml. Here is the link for
it - 

http://struts.apache.org/2.x/docs/stream-result.html


Omkar Patil wrote:
> 
> Julien,
> 
> I could be completely off-mark here. If I understand correctly you are
> planning to generate a PDF (or an image) and then send it to the browser.
> This can be achieved using the Stream Result. Here is the code snippet
> from the S2 documentation - 
> 
> <result name="success" type="stream">
>   image/jpeg
>   imageStream
>   filename="document.pdf"
>   1024
> </result>
> 
> Hope this helps. 
> 
> - Omkar
> 
> 
> Julien Leonard-2 wrote:
>> 
>> Hello all,
>>  
>> I want to develop an action that return an image. This image is based on
>> a image file and a text put in the middle of the image.
>> I've look at JasperReports and I think that is to complicated for my
>> use.
>> I think that I can do this with a simple xslt-fo and FOP to create a
>> PDF, but I don't see how to plug FOP in Struts2...
>> Maybe, I have to create a custom result type that use FOP?
>>  
>> Can somebody help me?
>>  
>> Julien
>> 
>> 
>> This e-mail, any attachments and the information contained therein ("this
>> message") are confidential and intended solely for the use of the
>> addressee(s). If you have received this message in error please send it
>> back to the sender and delete it. Unauthorized publication, use,
>> dissemination or disclosure of this message, either in whole or in part
>> is strictly prohibited.
>> ********************************************************************** 
>> Ce message electronique et tous les fichiers joints ainsi que  les
>> informations contenues dans ce message ( ci apres "le message" ), sont
>> confidentiels et destines exclusivement a l'usage de la  personne a
>> laquelle ils sont adresses. Si vous avez recu ce message par erreur,
>> merci  de le renvoyer a son emetteur et de le detruire. Toutes diffusion,
>> publication, totale ou partielle ou divulgation sous quelque forme que se
>> soit non expressement autorisees de ce message, sont interdites.
>> ********************************************************************** 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Image-Generation-tf4880807.html#a13969168
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Image Generation

Posted by Omkar Patil <os...@gmail.com>.
Julien,

I could be completely off-mark here. If I understand correctly you are
planning to generate a PDF (or an image) and then send it to the browser.
This can be achieved using the Stream Result. Here is the code snippet from
the S2 documentation - 

<result name="success" type="stream">
  image/jpeg
  imageStream
  filename="document.pdf"
  1024
</result>

Hope this helps. 

- Omkar


Julien Leonard-2 wrote:
> 
> Hello all,
>  
> I want to develop an action that return an image. This image is based on
> a image file and a text put in the middle of the image.
> I've look at JasperReports and I think that is to complicated for my
> use.
> I think that I can do this with a simple xslt-fo and FOP to create a
> PDF, but I don't see how to plug FOP in Struts2...
> Maybe, I have to create a custom result type that use FOP?
>  
> Can somebody help me?
>  
> Julien
> 
> 
> This e-mail, any attachments and the information contained therein ("this
> message") are confidential and intended solely for the use of the
> addressee(s). If you have received this message in error please send it
> back to the sender and delete it. Unauthorized publication, use,
> dissemination or disclosure of this message, either in whole or in part is
> strictly prohibited.
> ********************************************************************** 
> Ce message electronique et tous les fichiers joints ainsi que  les
> informations contenues dans ce message ( ci apres "le message" ), sont
> confidentiels et destines exclusivement a l'usage de la  personne a
> laquelle ils sont adresses. Si vous avez recu ce message par erreur, merci 
> de le renvoyer a son emetteur et de le detruire. Toutes diffusion,
> publication, totale ou partielle ou divulgation sous quelque forme que se
> soit non expressement autorisees de ce message, sont interdites.
> ********************************************************************** 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Image-Generation-tf4880807.html#a13969166
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org