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 Tobias Luikard <to...@exxcellent.de> on 2014/03/24 13:07:08 UTC
Blank Images produced by FOP 1.1.
Hello,
I'm trying to upgrade an existing application from fop 0.20.5 to 1.1.
We used to produce BufferedImages by the AWT Renderer. Now I try to make
it right. After lots of searching and trying now I have the following code:
======================
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new
StreamSource(
xslt));
setParameter(transformer, parameters, mitarbeiter);
Source src = new StreamSource(new StringReader(xml));
FOUserAgent userAgent = fopFactory.newFOUserAgent();
PageableRenderer renderer = new PageableRenderer(userAgent);
renderer.setScaleFactor(1);
userAgent.setTargetResolution(72);
userAgent.setRendererOverride(renderer);
Fop fop = fopFactory.newFop(userAgent);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
List images = new ArrayList();
for (int i = 0; i < renderer.getNumberOfPages(); i++) {
BufferedImage pageImage = renderer.getPageImage(i);
images.add(pageImage);
}
======================
The problem is, that FOP only produces blank images. I tried, I searched
and I debugged. But I have no glue what's going wrong...
Has anyone any hints?
Thanks
Tobi
P.S. I got the problem solved with 1.0 but this didn't work with
Webstart. :-(
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Blank Images produced by FOP 1.1.
Posted by Tobias Luikard <t....@exxcellent.de>.
Hi Stefan,
I tried you hint. It didn't work. But maybe you missunderstood my
problem. The image (actually just a little logo) inside the document is
there (as long as the document is produced as pdf). But when I try to
get a BufferedImage as FOP result there is only a blank image :-( The
hole image is blank. The logo, the text and the tables are missing...
Sorry for the confusion. Propably my first email wasn't clear enough.
Cheers
Tobi
Am 25.03.2014 13:14, schrieb Stefan Hinz:
> Hallo Tobias,
>
> Just a random guess, since we had a problem with blank images in FOP
> 1.1 recently, too. In our case, the "culprit" was Mac OS X, producing
> PNG images with header data that FOP 1.1 disliked. After pumping those
> images through ImageMagick convert, FOP found the PNGs much better,
> and displayed them properly.
>
> Cheers,
>
> Stefan
>
>
> Am 24.03.2014 13:07, schrieb Tobias Luikard:
>> Hello,
>>
>> I'm trying to upgrade an existing application from fop 0.20.5 to 1.1.
>>
>> We used to produce BufferedImages by the AWT Renderer. Now I try to make
>> it right. After lots of searching and trying now I have the following
>> code:
>>
>> ======================
>> TransformerFactory factory = TransformerFactory.newInstance();
>> Transformer transformer = factory.newTransformer(new
>> StreamSource(
>> xslt));
>> setParameter(transformer, parameters, mitarbeiter);
>> Source src = new StreamSource(new StringReader(xml));
>>
>> FOUserAgent userAgent = fopFactory.newFOUserAgent();
>> PageableRenderer renderer = new
>> PageableRenderer(userAgent);
>> renderer.setScaleFactor(1);
>> userAgent.setTargetResolution(72);
>> userAgent.setRendererOverride(renderer);
>> Fop fop = fopFactory.newFop(userAgent);
>>
>> Result res = new SAXResult(fop.getDefaultHandler());
>>
>> transformer.transform(src, res);
>> List images = new ArrayList();
>> for (int i = 0; i < renderer.getNumberOfPages(); i++) {
>> BufferedImage pageImage = renderer.getPageImage(i);
>> images.add(pageImage);
>> }
>> ======================
>>
>> The problem is, that FOP only produces blank images. I tried, I searched
>> and I debugged. But I have no glue what's going wrong...
>>
>> Has anyone any hints?
>>
>> Thanks
>>
>> Tobi
>>
>> P.S. I got the problem solved with 1.0 but this didn't work with
>> Webstart. :-(
>>
>> ---------------------------------------------------------------------
>> 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: Blank Images produced by FOP 1.1.
Posted by Stefan Hinz <st...@oracle.com>.
Hallo Tobias,
Just a random guess, since we had a problem with blank images in FOP 1.1
recently, too. In our case, the "culprit" was Mac OS X, producing PNG
images with header data that FOP 1.1 disliked. After pumping those
images through ImageMagick convert, FOP found the PNGs much better, and
displayed them properly.
Cheers,
Stefan
Am 24.03.2014 13:07, schrieb Tobias Luikard:
> Hello,
>
> I'm trying to upgrade an existing application from fop 0.20.5 to 1.1.
>
> We used to produce BufferedImages by the AWT Renderer. Now I try to make
> it right. After lots of searching and trying now I have the following code:
>
> ======================
> TransformerFactory factory = TransformerFactory.newInstance();
> Transformer transformer = factory.newTransformer(new
> StreamSource(
> xslt));
> setParameter(transformer, parameters, mitarbeiter);
> Source src = new StreamSource(new StringReader(xml));
>
> FOUserAgent userAgent = fopFactory.newFOUserAgent();
> PageableRenderer renderer = new PageableRenderer(userAgent);
> renderer.setScaleFactor(1);
> userAgent.setTargetResolution(72);
> userAgent.setRendererOverride(renderer);
> Fop fop = fopFactory.newFop(userAgent);
>
> Result res = new SAXResult(fop.getDefaultHandler());
>
> transformer.transform(src, res);
> List images = new ArrayList();
> for (int i = 0; i < renderer.getNumberOfPages(); i++) {
> BufferedImage pageImage = renderer.getPageImage(i);
> images.add(pageImage);
> }
> ======================
>
> The problem is, that FOP only produces blank images. I tried, I searched
> and I debugged. But I have no glue what's going wrong...
>
> Has anyone any hints?
>
> Thanks
>
> Tobi
>
> P.S. I got the problem solved with 1.0 but this didn't work with
> Webstart. :-(
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
--
Oracle <http://www.oracle.com>
Stefan Hinz | MySQL Documentation Manager | +49-30-82702940
Oracle MySQL <http://dev.mysql.com/doc>
Berlin, Germany
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org