xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego Medina <hall...@gmail.com>
Subject Re: Getting a jpeg output with fop
Date Thu, 03 Dec 2009 19:11:36 GMT
Hi Venkat

Thanks for your response. I need this renderer to support GIF and JPEG, 
I was looking the code of TIFF Renderer to adapt it to a JPEG and GIF 
renderer, and I saw that "stopRenderer()" was the best place to write 
code using ImageIO to convert Java2D/AWT renderer work.

The most of the work was change the static strings of types 
(image/tiff), and I create the corresponding maker, configurator ,etc ...

If someone need it, I attach the classes here.

Here I leave a example of use the renderer:

Thanks for all. I'm pleased to help a little.

// OutputStream out = what you want
            FopFactory fopFactory = FopFactory.newInstance();
            RendererFactory rendererFactory = null;
            FOUserAgent foUserAgent = null;

            rendererFactory = fopFactory.getRendererFactory();
            rendererFactory.addRendererMaker(new 
MultiRendererMaker("jpeg"));
            foUserAgent = fopFactory.newFOUserAgent();
            rendererFactory.createRenderer(foUserAgent, "image/jpeg");
   
            Fop fop = fopFactory.newFop("image/jpeg", foUserAgent, out);

//Use fop as normal case



Venkat Reddy escribió:
> Hi,
>
> As per the below documentation, Java2D/AWT renderer used in FOP only 
> supports PNG/TIFF output formats. For more information, read the 
> following document...
> http://xmlgraphics.apache.org/fop/trunk/output.html#bitmap
>
> Venkat.
>
> Diego Medina wrote:
>> Hi everyone
>>
>> I have been using Fop from long time ago, and to start I have to say 
>> thanks for that great job. Now recently, I have a new need to get 
>> another output different of pdf. In later versions I see that 
>> mimeType image/jpeg is a valid constant to output format (but I don't 
>> test this functionality until now) but in versión 0.95 said  " Don't 
>> know how to handle "image/jpeg" as an output format". I was studding 
>> the fop config file and other configuration issues, but all my test 
>> didn't works. Is possible to render a jpeg output without adding 
>> another render to fop 0.95?. In case of not, how can I add my own 
>> renderer to render a image/jpeg?.
>>
>> Thanks so much.
>>
>> ---------------------------------------------------------------------
>> 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
>

Mime
View raw message