W3C home > Mailing lists > Public > www-xsl-fo@w3.org > January 2010

Re: In XSL-FO conditionally add Pdf as last page to make page-count even

From: Reshma R <Reshma.Raveendran@morganstanley.com>
Date: Wed, 6 Jan 2010 00:54:37 -0800 (PST)
Message-ID: <27026811.post@talk.nabble.com>
To: www-xsl-fo@w3.org

Thanks for the solution Tony,

I could get it to work with fo:conditional-page-master-reference and the
fo:external-graphic source elements.

Best Regards
Reshma


Tony Graham-3 wrote:
> 
> On Thu, Dec 31 2009 06:29:48 +0000, Reshma.Raveendran@morganstanley.com
> wrote:
>> I'm using FO to generate Pdf's and one of the requirements is to always
>> generate even number of pages. If the page count is odd then I need to
>> add a
>> static Pdf to make it even. How can this be done using FO. Please help!
> 
> Use 'force-page-count="end-on-even"' [1] on every fo:page-sequence if
> every page-sequence has to end on an even page or on the last
> fo:page-sequence if it's just the entire PDF that has to end on an even
> page.
> 
> You can specify which page master to use for the added page using
> fo:conditional-page-master-reference with appropriate property values,
> e.g.:
> 
>    <fo:conditional-page-master-reference
>       master-reference="..."
>       page-position="last"
>       odd-or-even="even"
>       blank-or-not-blank="blanK"/>
> 
> although you probably only need 'blank-or-not-blank="blank"' for what
> you want.
> 
> If you do need to put an externally generated PDF on the otherwise blank
> page, some XSL formatters can use PDF as fo:external-graphic source, and
> you could put that as static content in one of the page regions.
> 
> Regards,
> 
> 
> Tony Graham                         Tony.Graham@MenteithConsulting.com
> Director                                  W3C XSL FO SG Invited Expert
> Menteith Consulting Ltd                               XML Guild member
> XML, XSL and XSLT consulting, programming and training
> Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
> Registered in Ireland - No. 428599   http://www.menteithconsulting.com
>   --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
> xmlroff XSL Formatter                               http://xmlroff.org
> xslide Emacs mode                  http://www.menteith.com/wiki/xslide
> Unicode: A Primer                               urn:isbn:0-7645-4625-2
> 
> 
> [1] http://www.w3.org/TR/xsl11/#force-page-count
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/In-XSL-FO-conditionally-add-Pdf-as-last-page-to-make-page-count-even-tp26975889p27026811.html
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.
Received on Wednesday, 6 January 2010 08:55:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 6 January 2010 08:55:09 GMT