page-position="only" trait.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

page-position="only" trait.

mark_anderson_us
Hi All

I'm in the process of testing various FO Processors. I created some test files, one of which was a single page invoice and a multi-page invoice. The first page has a full header and remaining pages have a small headers (logo only). The last page has a big footer with totals. If the invoice only has a few lines then the big footer needs to go on page 1 (so first page header and last page footer). To accomplish this I use a conditional page-master with the page-position="only" trait.

It works fine for multi-page invoices in Antenna House and XEP, but in FOP, I get the "only" layout for every page. This was supposed to be fixed in FOP 0.92, but still doesn’t seem to work. Below is a snippet from my XSL (full files attached)

<xsl:template match="/tg_invoice">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

      <fo:layout-master-set>
       
        <fo:page-sequence-master master-name="contents_sequence">
         
          <fo:repeatable-page-master-alternatives>
           
            <fo:conditional-page-master-reference page-position="only" master-reference="single"/>
            <fo:conditional-page-master-reference page-position="first" master-reference="cover"/>
            <fo:conditional-page-master-reference page-position="rest" master-reference="continuation"/>
            <fo:conditional-page-master-reference page-position="last" master-reference="last"/>
          </fo:repeatable-page-master-alternatives>
        </fo:page-sequence-master>

       
        <fo:simple-page-master master-name="single" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
          <fo:region-body margin-top="9cm" margin-bottom="3cm"/>
          <fo:region-before region-name="header_first" extent="9cm"/>
          <fo:region-after region-name="footer_last" extent="3cm"/>
        </fo:simple-page-master>
       
       
       
        <fo:simple-page-master master-name="cover" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
          <fo:region-body margin-top="9cm" margin-bottom="1cm"/>
          <fo:region-before region-name="header_first" extent="9cm"/>
          <fo:region-after region-name="footer_rest" extent="1cm"/>
        </fo:simple-page-master>
       
       
       
        <fo:simple-page-master master-name="continuation" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
          <fo:region-body margin-top="3cm" margin-bottom="1cm"/>
          <fo:region-before region-name="header_rest" extent="3cm"/>
          <fo:region-after region-name="footer_rest" extent="1cm"/>
        </fo:simple-page-master>
       
       
       
        <fo:simple-page-master master-name="last" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
          <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
          <fo:region-before region-name="header_rest" extent="2cm"/>
          <fo:region-after region-name="footer_last" extent="3cm"/>
        </fo:simple-page-master>
               
      </fo:layout-master-set>
     

Does the above look correct?

M a r k  

InvoiceLong.xml
Invoice.xsl
Reply | Threaded
Open this post in threaded view
|

Re: page-position="only" trait.

Arian Hojat
I believe i had this problem last month when i tried using
last/only/any in certain situations in my fo file...

Btw you use 'only' which i dunno if fop 0.95 supports well (i asked
this last month cause i think only didnt work as i wanted it too).

I remember there was a few lines you could add to get version 0.95 to
work (for the "only" attribute, and maybe last) ...
https://issues.apache.org/bugzilla/show_bug.cgi?id=40798

But I'd suggest you download the latest fop trunk from svn.
Alternative masters now work as i expect them to with trunk version.

-Arian

Reply | Threaded
Open this post in threaded view
|

Re: page-position="only" trait.

mark_anderson_us

Arian Hojat wrote
I believe i had this problem last month when i tried using
last/only/any in certain situations in my fo file...

Btw you use 'only' which i dunno if fop 0.95 supports well (i asked
this last month cause i think only didnt work as i wanted it too).

I remember there was a few lines you could add to get version 0.95 to
work (for the "only" attribute, and maybe last) ...
https://issues.apache.org/bugzilla/show_bug.cgi?id=40798

But I'd suggest you download the latest fop trunk from svn.
Alternative masters now work as i expect them to with trunk version.

-Arian
Hi Arian

Thanks for the reply. Unfortunately, I ahven;t a clue how to build java apps.

Any idea where I can get a binary from thats later than the 0.95 release?

Regards

Mark