xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Douglas" <edoug...@blockhouse.com>
Subject RE: Fixed second page in output
Date Fri, 16 Jul 2010 13:27:04 GMT
It sounds like that not exactly "first" and "rest" but rather "second"
and "rest" if that's possible.
How ugly it would be to do that depends how you're printing the stuff on
the first and "rest" pages.  Do you let it runover with soft pagebreaks?
In my program that would be simple, but I'm just creating my XML from a
program which tells it what to print where and figures out what will fit
on a page.  My XSL just reads the page and position values from the XML
and puts everything where I tell it to with absolute positioning.
 
(with absolute positioning avoiding soft page breaks) If I want to print
something on page 1, then print something special on page 2, then
continue printing other stuff on page 3, I just code the page numbers
into the XML.  Then I loop through page breaks with a counter and print
it when I get there..
 
...
<xsl:variable name="PAGE_NUMBER" select="position()"/>
<fo:block>
<xsl:attribute name="break-before">page</xsl:attribute>
...
</fo:block>
<xsl:for-each select="//PAGE_DATA/SPECIFIC_PAGE">
<fo:block>
<xsl:if test="PAGE_NUMBER = $PAGE_NUMBER">
<xsl:for-each select="*">
...

________________________________

From: Adam Kovacs [mailto:a.kovacs@i-docs.com] 
Sent: Friday, July 16, 2010 9:09 AM
To: fop-users@xmlgraphics.apache.org
Subject: Fixed second page in output


Hi There!

 I'm currently working on an XSL for a PDF which has a fixed second
page. 
The structure is the following:

First page:  - Special header and start of table (table goes over more
pages)
Second page:  - Static content (an image for example)
Rest:  - The rest of the table. 

My problem is that the table always goes also into the second page, or
on every odd page only.

I used:

   <fo:page-sequence-master master-name="document">
     <fo:repeatable-page-master-alternatives>
       <fo:conditional-page-master-reference page-position="first"
master-reference="first"/>
       <fo:conditional-page-master-reference page-position="rest"
master-reference="rest"/>
        <!--fo:conditional-page-master-reference odd-or-even="even"
master-reference="odd"/> <fo:conditional-page-master-reference
odd-or-even="odd" master-reference="even--"/>  
     </fo:repeatable-page-master-alternatives>
   </fo:page-sequence-master>

but I only need a special handling on the SECOND page...

Anybody had the same problem, or any idea that could help?

I also tried to use a master-reference to another page-sequence-master
with again first and rest but this resulted in NPE:
java.lang.NullPointerException
at org.xml.sax.helpers.LocatorImpl.<init>(LocatorImpl.java:79)
at
org.apache.fop.fo.pagination.PageProductionException.setLocator(PageProd
uctionException.java:56)
  
Shouldn't this work?

Any help is really welcome!

Adam 
Using Fop Trunk

Mime
View raw message