473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PageLayout

Hi everybody,
I have created a page sequence for a manual of 25 pages and using xsl-fo for pdf output. I was not happy with pdf output. Because, condition-sequence for odd and even pages, was not which I expected. I have attached my xsl file for the reference and guide me, which part of coding was wrong. Let me explain, how exactly my pages should be.
Firstly, I want a copy right page, without any header or footer.
Secondly, a blank page.
Thirdly, Table of contents pages, with a roman page number at the footer.
Fourthly, again a blank page.
Fifthly, a title page only footer with roman page number as 1.
Sixthly, continuous even and odd pages with both a header and footer, along with a page number continuously.

Regards,
Prabhu.I
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="2.0"
  3.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.   xmlns:fo="http://www.w3.org/1999/XSL/Format">
  5.  
  6.  
  7.  <xsl:template match="chapter">
  8.  
  9.  
  10.  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  11.  
  12.     <fo:layout-master-set>
  13.  
  14.  
  15.  
  16.  <fo:simple-page-master
  17.             master-name="copyright"
  18.             page-height="29.7cm"
  19.             page-width="21.0cm"
  20.             margin-top="2cm"
  21.             margin-bottom="2cm"
  22.             margin-left="2.5cm" margin-right="2.5cm">
  23.                         <fo:region-body
  24.                             margin-top="10cm"
  25.                             margin-bottom="2cm"/>
  26.                         <fo:region-after extent="2cm"/>
  27.         </fo:simple-page-master>
  28.  
  29.  
  30.  
  31.  
  32.     <fo:simple-page-master master-name="Toc"
  33.                   page-height="29.7cm"
  34.                   page-width="21cm"
  35.                   margin-top="1in"
  36.                   margin-bottom="1.5in"
  37.                   margin-left="2.5cm"
  38.                   margin-right="2.5cm">
  39.  
  40.                         <fo:region-body
  41.                       padding-start="0cm"
  42.                       padding-end="0cm"
  43.                       margin-top="0.6in"
  44.                       margin-bottom="0.6in"
  45.                       margin-left="0.7in"
  46.                       margin-right="0.5in"/>
  47.     </fo:simple-page-master>
  48.  
  49.  
  50.        <fo:simple-page-master master-name="first"
  51.         page-height="29.7cm"
  52.         page-width="21cm"
  53.         margin-left="2.5cm"
  54.         margin-right="2.5cm"
  55.         margin-top="1cm"
  56.         margin-bottom="2cm">
  57.  
  58.         <fo:region-body margin-top="2cm" margin-bottom="3cm"/>
  59.        <fo:region-before extent="3cm"/>
  60.        <fo:region-after region-name="footer" extent="1.5cm"/>
  61.       <fo:region-start extent="2cm"/>
  62.     <fo:region-end extent="2cm"/>
  63.     </fo:simple-page-master>
  64.  
  65.  
  66.     <fo:simple-page-master
  67.             master-name="odd"
  68.             page-height="29.7cm"
  69.             page-width="21.0cm"
  70.             margin-top="2cm"
  71.             margin-bottom="2cm"
  72.             margin-left="3.5cm"
  73.             margin-right="1.5cm">
  74.                         <fo:region-body
  75.                             margin-top="2cm"
  76.                             margin-bottom="2cm"/>
  77.                         <fo:region-before
  78.                             region-name="oddhead"
  79.                             extent="2cm"/>
  80.                         <fo:region-after
  81.                             region-name="oddfoot"
  82.                             extent="2cm"/>
  83.         </fo:simple-page-master>
  84.  
  85.         <fo:simple-page-master
  86.             master-name="even"
  87.             page-height="29.7cm"
  88.             page-width="21.0cm"
  89.             margin-top="2cm"
  90.             margin-bottom="2cm"
  91.                 margin-left="1.5cm"
  92.                 margin-right="3.5cm">
  93.                         <fo:region-body
  94.                             margin-top="2cm"
  95.                             margin-bottom="2cm"/>
  96.                         <fo:region-before
  97.                             region-name="evenhead"
  98.                             extent="2cm"/>
  99.                         <fo:region-after
  100.                             region-name="evenfoot"
  101.                             extent="2cm"/>
  102.         </fo:simple-page-master>       
  103.  
  104.             <fo:page-sequence-master master-name="Chapter">
  105.                <fo:repeatable-page-master-alternatives>
  106.            <fo:conditional-page-master-reference 
  107.      master-reference="odd" odd-or-even="odd" page-position="rest"/>
  108.     <fo:conditional-page-master-reference 
  109.      master-reference="even" odd-or-even="even" page-position="rest"/>
  110.                                    <fo:conditional-page-master-reference
  111.                                         master-reference="first"
  112.                                        page-position="first" />
  113.                                             </fo:repeatable-page-master-alternatives>
  114.                                               </fo:page-sequence-master>       
  115.          </fo:layout-master-set>
  116.  
  117.  
  118.        <fo:page-sequence
  119.           master-reference="copyright">
  120.             <fo:flow
  121.            flow-name="xsl-region-body">
  122.            <fo:block>
  123.                      <xsl:value-of select="/copyrights1/body/bodyindent"/>
  124.                      </fo:block>
  125.               </fo:flow>
  126.   </fo:page-sequence>
  127.  
  128.  
  129.  
  130.            <fo:page-sequence master-reference="Chapter" >             
  131.  
  132.            <fo:static-content flow-name="footer">
  133.     <fo:block text-align="center" font-family="times new roman" font-size="12pt">
  134.  
  135.        </fo:block>
  136.     </fo:static-content>
  137.  
  138.         <fo:static-content flow-name="oddhead">
  139.    <fo:block border-bottom-width="thin" 
  140.     border-bottom-style="solid" border-bottom-color="black" 
  141.     font-family="times new roman" font-size="8pt" text-align="outside" >
  142.      <fo:page-number /> 
  143.     </fo:block>
  144.    <fo:block font-family="times new roman" font-style="italic" font-size="10pt" text-align="outside" space-before="3pt">
  145.      Quality Anylsis
  146.     </fo:block>
  147.   </fo:static-content>
  148.  
  149.  
  150.    <fo:static-content flow-name="evenhead">
  151.    <fo:block border-bottom-width="thin" 
  152.     border-bottom-style="solid" border-bottom-color="black" 
  153.     font-family="times new roman" font-size="8pt" text-align="inside">
  154.      <fo:page-number /> 
  155.     </fo:block>
  156.    <fo:block font-family="times new roman" font-style="italic" font-size="10pt" text-align="inside" space-before="3pt">
  157.      Quality Anylsis
  158.     </fo:block>
  159.   </fo:static-content>
  160.  
  161.     <fo:flow flow-name="xsl-region-body">
  162.             <!--<xsl:apply-templates mode="toc"/>-->  
  163.       <xsl:apply-templates/>     
  164.   </fo:flow>
  165.   </fo:page-sequence>  
  166.   </fo:root>
Dec 3 '08 #1
0 1360

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: qumpus | last post by:
My program right now generates USPS style shipping label using System.Drawing.Graphics. It works fine except that the printer prints really slowly. I want to make my program take advantage of true...
1
by: Tim Pacl | last post by:
I am building a custom server control. I need to determine whether the page the custom control resides in is in flow layout or grid layout. Because I am doing this from the server control, I need...
4
by: Peter | last post by:
I have an ASP.NET form written in C#, on this form I have few controls and a DataGrid control, under the DataGrid control I have few more controls. The DataGrid defaults to display 10 items. When...
3
by: Rob C | last post by:
Hi, I turned on page level tracing, but the trace output overwrites the the controls on the page. All I did was: - create a new asp.net web app - Put 3 labels, 2 textboxes and one button on the...
3
by: Dave | last post by:
I am designing a web page using VS2003 ASP.NET. The page contains various DIVs (panels), one of which is in grid layout. The controls in this DIV render correctly in IE, but when using Firefox they...
1
by: Tina | last post by:
First thing I noticed with vs.net 2005 is that the page is in flowlayout and there is no pagelayout property that I can set to gridlayout. Are we no longer going to be able to place things on our...
2
by: Joseph Bittman MVP MCSD | last post by:
December 18, 2005 I'm trying out VS 05 Std, and cannot find the PageLayout feature of asp.net web forms. I have to use the spacebar & tab to get my controls to where I want them on the form. :(...
3
by: tokcy | last post by:
Hi everyone, I have class and whenever i am running to this class it shows error like Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.