You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Johannes Schaefer <jo...@uidesign.de> on 2005/02/21 17:04:23 UTC

PDF output High image errors

Hi!

We have some difficulties with high images in PDF output.
This is probably FOP related, maybe someone may forward
mail this to their list, thanks!

Images higher than about 600px (basically part of
screenshots) that are not scaled down because of width
will produce errors:
   1. FOPException: No meaningful layout ...
   2. java.lang.OutOfMemoryError
   3. endless swapping (if forrest.maxmemory is high)

The first one is still somewhat legible but the 2nd
and 3rd take some time to discover. They happen e.g.
if the image is enclosed in a table. See example code
below. This happens for PNG and GIF images.

The only workaround we found usable is to decrease
the height of the image upfront. Setting height="400px"
works, too, but the HTML quality is very poor.

Since scaling for wide images works well I hope
that there's a fix for this.

Shall I file a forrest bug for this?

Cheers
Johannes


<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2002-2004 The Apache Software Foundation

   Licensed under the Apache License, Version 2.0 (the 
"License");
   you may not use this file except in compliance with the 
License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in 
writing, software
   distributed under the License is distributed on an "AS 
IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
express or implied.
   See the License for the specific language governing 
permissions and
   limitations under the License.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation 
V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
   <header>
     <title>Welcome to MyProj</title>
   </header>
   <body>
     <section>
       <title>Congratulations</title>
       <p>You have successfully generated and rendered an <a
           href="ext:forrest">Apache Forrest</a> site.
         This page is from the site template. It is found in
 
<code>my-site/src/documentation/content/xdocs/index.xml</code>
         Please edit it and replace this text with content 
of your own.</p>
         <table>forrest.maxmemory=64m
         <tr><td><img height="400px" 
src="images/high-image.png" alt="High images break PDF 
generation"/></td></tr>
         <tr><td>Figure: High images break PDF 
generation</td></tr>
         </table>
     </section>
   </body>
</document>



-- 
User Interface Design GmbH * Teinacher Str. 38 * D-71634 
Ludwigsburg
Fon +49 (0)7141 377 000 * Fax  +49 (0)7141 377 00-99
Geschäftsstelle: User Interface Design GmbH * 
Lehrer-Götz-Weg 11 * D-81825 München
www.uidesign.de

Buch "User Interface Tuning" von Joachim Machate & Michael 
Burmester
www.user-interface-tuning.de

Besuchen Sie uns auf der Hannover Messe 11.-15. April 2005
Halle 2, Stand C14 auf dem MMI Gemeinschaftsstand
www.uidesign.de/hmi2005

Nächstes TAE-Seminar zu User Interface Design
Ostfildern-Nellingen, 07.-08. April 2005
www.tae.de TAE-Veranstaltung Nr. 31189

Re: PDF output High image errors

Posted by Johannes Schaefer <jo...@uidesign.de>.
Ross, thanks for pointing out!

I haven't found FOR-413 and I still believe this may be
fixed in FOP, will try to investigate ... where is image
scaling done in PDF output for image width?
Anybody knows?

FOR-296 would be a Cocoon/Forrest solution for the problem
if implemented, right. We still work around by resizing the
images :-(

Cheers
Johannes



Ross Gardler wrote:
> Johannes Schaefer wrote:
> 
>> Hi!
>>
>> We have some difficulties with high images in PDF output.
>> This is probably FOP related, maybe someone may forward
>> mail this to their list, thanks!
>>
>> Images higher than about 600px (basically part of
>> screenshots) that are not scaled down because of width
>> will produce errors:
>>   1. FOPException: No meaningful layout ...
>>   2. java.lang.OutOfMemoryError
>>   3. endless swapping (if forrest.maxmemory is high)
>>
>> The first one is still somewhat legible but the 2nd
>> and 3rd take some time to discover. They happen e.g.
>> if the image is enclosed in a table. See example code
>> below. This happens for PNG and GIF images.
>>
>> The only workaround we found usable is to decrease
>> the height of the image upfront. Setting height="400px"
>> works, too, but the HTML quality is very poor.
>>
>> Since scaling for wide images works well I hope
>> that there's a fix for this.
>>
>> Shall I file a forrest bug for this?
> 
> 
> See http://issues.cocoondev.org/browse/FOR-413 and 
> http://issues.cocoondev.org/browse/FOR-296 and add any comments you have.
> 
> With respect to the latter (which you created by the way ;-) there was 
> some recent talk on the Cocoon dev list about enhancements to the image 
> generator to do scaling. I've not revisited to see if anything has been 
> implemented.
> 
> Ross
> 
> 


-- 
User Interface Design GmbH * Teinacher Str. 38 * D-71634 
Ludwigsburg
Fon +49 (0)7141 377 000 * Fax  +49 (0)7141 377 00-99
Geschäftsstelle: User Interface Design GmbH * 
Lehrer-Götz-Weg 11 * D-81825 München
www.uidesign.de

Buch "User Interface Tuning" von Joachim Machate & Michael 
Burmester
www.user-interface-tuning.de

Besuchen Sie uns auf der Hannover Messe 11.-15. April 2005
Halle 2, Stand C14 auf dem MMI Gemeinschaftsstand
www.uidesign.de/hmi2005

Nächstes TAE-Seminar zu User Interface Design
Ostfildern-Nellingen, 07.-08. April 2005
www.tae.de TAE-Veranstaltung Nr. 31189

Re: PDF output High image errors

Posted by Ross Gardler <rg...@apache.org>.
Johannes Schaefer wrote:
> Hi!
> 
> We have some difficulties with high images in PDF output.
> This is probably FOP related, maybe someone may forward
> mail this to their list, thanks!
> 
> Images higher than about 600px (basically part of
> screenshots) that are not scaled down because of width
> will produce errors:
>   1. FOPException: No meaningful layout ...
>   2. java.lang.OutOfMemoryError
>   3. endless swapping (if forrest.maxmemory is high)
> 
> The first one is still somewhat legible but the 2nd
> and 3rd take some time to discover. They happen e.g.
> if the image is enclosed in a table. See example code
> below. This happens for PNG and GIF images.
> 
> The only workaround we found usable is to decrease
> the height of the image upfront. Setting height="400px"
> works, too, but the HTML quality is very poor.
> 
> Since scaling for wide images works well I hope
> that there's a fix for this.
> 
> Shall I file a forrest bug for this?

See http://issues.cocoondev.org/browse/FOR-413 and 
http://issues.cocoondev.org/browse/FOR-296 and add any comments you have.

With respect to the latter (which you created by the way ;-) there was 
some recent talk on the Cocoon dev list about enhancements to the image 
generator to do scaling. I've not revisited to see if anything has been 
implemented.

Ross