You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by is...@cocoondev.org on 2004/12/10 11:28:29 UTC

[JIRA] Created: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Core operations
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Fri, 10 Dec 2004 4:27 AM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[JIRA] Updated: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Posted by is...@cocoondev.org.
The following issue has been updated:

    Updater: Johannes Schaefer (mailto:josch@uidesign.de)
       Date: Tue, 22 Feb 2005 8:37 AM
    Comment:
OK, the last one works since it contains a *wide* image. Sorry.
Here's the one that does break (high-image.gif).
Note: Now I put in the same image as GIF and the behaviour is the same,
so jimi is not needed.

    Changes:
             Attachment changed to murks.fo
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.cocoondev.org//browse/FOR-413?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Core operations
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Tue, 22 Feb 2005 8:37 AM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[JIRA] Commented: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Posted by is...@cocoondev.org.
The following comment has been added to this issue:

     Author: Johannes Schaefer
    Created: Mon, 21 Feb 2005 10:46 AM
       Body:
See also:
http://mail-archives.eu.apache.org/mod_mbox/forrest-user/200502.mbox/%3c421A0687.6080908@uidesign.de%3e

---------------------------------------------------------------------
View this comment:
  http://issues.cocoondev.org//browse/FOR-413?page=comments#action_12059

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Core operations
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Mon, 21 Feb 2005 10:46 AM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[JIRA] Updated: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Posted by is...@cocoondev.org.
The following issue has been updated:

    Updater: Johannes Schaefer (mailto:josch@uidesign.de)
       Date: Tue, 22 Feb 2005 8:33 AM
    Comment:
I think I circled it, see attachment. See detailed FOP output below.

The surprising thing is that everything works fine, i.e. the page renders with FOP, if there is neither padding-before nor padding-after set in this line:
         <fo:block padding-before="18pt"> 

With a wide instead of a high image the page renders fine, too.

Is anybody in touch with FOP to check if this is a bug in FOP?

FOP output (note: jimi-1.0.jar must be present):
-- 
fop-0.20.5>fop murks.fo murks.pdf
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] FOP 0.20.5
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] building formatting object tree
[INFO] setting up fonts
[INFO] [1]
[INFO] JAI support was not installed (read: not present at build time). Trying to use Jimi instead
[INFO] [2]
[INFO] [3]
[INFO] [4]
[INFO] [5]
and so on ........... ad infinitum.
-- 


    Changes:
             Attachment changed to murks.fo
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.cocoondev.org//browse/FOR-413?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Core operations
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Tue, 22 Feb 2005 8:33 AM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[JIRA] Commented: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Posted by is...@cocoondev.org.
The following comment has been added to this issue:

     Author: Johannes Schaefer
    Created: Mon, 21 Feb 2005 10:57 AM
       Body:
Image width seems not to be a problem, screenshots with 1024x768 are included correctly although they're too high. It seems that FOP (?) scales them down because of width. High but narrow images cause problems. Seems like FOP cannot handle these ...
---------------------------------------------------------------------
View this comment:
  http://issues.cocoondev.org//browse/FOR-413?page=comments#action_12060

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Core operations
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Mon, 21 Feb 2005 10:57 AM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[JIRA] Commented: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Posted by is...@cocoondev.org.
The following comment has been added to this issue:

     Author: Johannes Schaefer
    Created: Tue, 22 Feb 2005 8:43 AM
       Body:
Just to clarify: padding-before="0pt" renders fine.

---------------------------------------------------------------------
View this comment:
  http://issues.cocoondev.org//browse/FOR-413?page=comments#action_12076

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Core operations
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Tue, 22 Feb 2005 8:43 AM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[JIRA] Updated: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Posted by is...@cocoondev.org.
The following issue has been updated:

    Updater: Johannes Schaefer (mailto:josch@uidesign.de)
       Date: Tue, 22 Feb 2005 8:38 AM
    Comment:
Here are the images I used, see attachment murks.zip.
    Changes:
             Attachment changed to murks.zip
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.cocoondev.org//browse/FOR-413?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Core operations
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Tue, 22 Feb 2005 8:38 AM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[JIRA] Updated: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Posted by is...@cocoondev.org.
The following issue has been updated:

    Updater: Dave Brondsema (mailto:brondsem@apache.org)
       Date: Wed, 9 Mar 2005 6:21 PM
    Changes:
             Component changed to Plugin: pdf-output
             Component changed from Core operations
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.cocoondev.org//browse/FOR-413?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Plugin: pdf-output
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Wed, 9 Mar 2005 6:21 PM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[JIRA] Commented: (FOR-413) PDF: rendering fails when graphics too big - workaround inside

Posted by is...@cocoondev.org.
The following comment has been added to this issue:

     Author: Johannes Schaefer
    Created: Tue, 22 Feb 2005 9:04 AM
       Body:
See on the FOP mailing-list: 
  http://marc.theaimsgroup.com/?l=fop-user&w=2&r=1&s=infinite+loop&q=b
most notably
  http://marc.theaimsgroup.com/?l=fop-user&m=107875799629370&w=2

These are the FOP bugs for "infinite loop"
   http://makeashorterlink.com/?D28F3288A

Nothing seems to really fit, but maybe the murks.fo helps fixing anyway?!
---------------------------------------------------------------------
View this comment:
  http://issues.cocoondev.org//browse/FOR-413?page=comments#action_12077

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-413

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-413
    Summary: PDF: rendering fails when graphics too big - workaround inside
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
 Components: 
             Core operations
   Versions:
             0.6

   Assignee: 
   Reporter: Olivier Jacques

    Created: Fri, 10 Dec 2004 4:27 AM
    Updated: Tue, 22 Feb 2005 9:04 AM

Description:
When "forresting" a document that has embedded images, the PDF rendering sometimes stops with this error message:

BROKEN: org.apache.fop.apps.FOPException: No meaningful layout in block after many attempts.  Infinite loop is assumed.  Processing halted.

I've found that this is caused by images that are too big to fit in the PDF page (took me some times :) )
I temporary "solved" it by modifying the document2fo.xsl. When I specify the "width" or "height" attribute to the img, then the value is taken and divided by 2. WARNING: the value has to be an integer and a "px" (pixels) size.

We should find a way to reduce the size automatically.

$ diff -bruN document2fo.xsl~ document2fo.xsl
--- document2fo.xsl~    2004-12-09 17:51:42.486185200 +0100
+++ document2fo.xsl     2004-12-09 22:03:32.465852800 +0100
@@ -755,10 +755,14 @@
       </xsl:variable>
       <fo:external-graphic src="{$imgpath}">
         <xsl:if test="@height">
-          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+          <xsl:variable name="reducedheight"
+                        select="number(@height)" />
+          <xsl:attribute name="height"><xsl:value-of select="concat(number($reducedheight) div 2,'px')"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@width">
-          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+          <xsl:variable name="reducedwidth"
+                        select="number(@width)" />
+          <xsl:attribute name="width"><xsl:value-of select="concat(number($reducedwidth) div 2,'px')"/></xsl:attribute>
         </xsl:if>
       </fo:external-graphic>
       <!-- alt text -->



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira