lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lmi] help with orphan-control in xsl-fo


From: Vaclav Slavik
Subject: RE: [lmi] help with orphan-control in xsl-fo
Date: Sat, 16 May 2009 21:36:06 +0200

Hi,

On Fri, 2009-05-15 at 16:48 -0400, Boutin, Wendy wrote:
> It fixes the collision of column values and footer text, but it caused 
> a grave problem for reg_d_individual.xsl and text in other *.xsl files 
> to change regressively. For the most grave example:
> 
> cd /opt/lmi/data
> cp reg_d_individual.xsl illustration_reg.xsl
> 
> cd /opt/lmi/bin
> ./lmi_cli_shared \
>   --accept \
>   --cnsfile=/opt/lmi/src/lmi/sample.cns \
>   --data_path=/opt/lmi/data \
>   --emit=emit_pdf_file \
>   2>&1 |less

I can't even run this, I get errors with fop-0.95 (and it doesn't make
to use <0.95 with my patch):

        javax.xml.transform.TransformerException:
        org.apache.fop.fo.ValidationException:
        file:/tmp/sample.000000001.fo.xml:144:68: Error(144/68):
        fo:page-sequence is missing child elements. 

Is this what I am supposed to see or is the problem something else?

BTW, this is unrelated to my patch, I get the same errors with
unmodified sources and fop-0.95.

> To see the text that's moved to its own page:
> 
> cd /opt/lmi/data
> cp nasd.xsl illustration_reg.xsl
> 
> cd /opt/lmi/bin
> ./lmi_cli_shared \
>   --accept \
>   --cnsfile=/opt/lmi/src/lmi/sample.cns \
>   --data_path=/opt/lmi/data \
>   --emit=emit_pdf_file \
>   2>&1 |less
> 
> I now see the last two lines of the 'Premium Outlay' definition (it's
> located about halfway through the output) are printed as two lonely 
> lines on the next page (besides the usual headers and footers). 

I don't see anything like that in either of the two PDF files created
(which one should I look at, BTW, sample.#.pdf or
sample.composite.#.pdf?). All I can see is 5-rows block on page 3, but
that looks correct to me...

I get lots of warnings like this, though:

        May 16, 2009 9:10:17 PM org.apache.fop.render.pdf.PDFRenderer putImage
        SEVERE: Image not found: company_logo.png

Could it be that the missing image affects the layout so much that we
see different outputs?

> I also observe the number of rows is not consistently thirty throughout
> all pages. I realize that was more of a "nice to have" request, but the 
> upgrade doesn't help the inconsistency.

I'm sorry, I misunderstood that as a suggestion on how to fix the bug
rather than as a feature request. That's why I implemented what I
considered more robust fix: my patch uses markup intended for exactly
this situation (keeping rows together) and will work even if you change
page size, footers/headers or font size in the future. On the other
hand, any of such changes could easily break the assumption that 30
lines is just the right amount of content.

I'll have a look at XSL-FO to see if we can limit number of rows per
page somehow.

> Could you please show me more precisely where I would add that padding?
> I can't see the where it belongs in neither 'fo_common.xsl' nor
> 'nasd.xsl'.

For example like this (fine-tuning of the values would be needed, take
this as just an example):

--- fo_common.xsl       2009-05-16 18:29:35 +0000
+++ fo_common.xsl       2009-05-16 19:34:44 +0000
@@ -861,7 +861,7 @@
     <fo:static-content flow-name="xsl-region-after">
       <fo:block font-size="8pt" font-family="sans-serif" text-align="left">
         <xsl:if test="$top-block">
-          <fo:block padding=".5em 0">
+          <fo:block padding="2em 0">
             <xsl:copy-of select="$top-block"/>
           </fo:block>
         </xsl:if>


Regards,
Vaclav





reply via email to

[Prev in Thread] Current Thread [Next in Thread]