Ecrion Software Inc. Homepage
Forum Home Forum Home > XF Designer > FAQ
  New Posts New Posts RSS Feed: Layout for Document
  FAQ FAQ  Forum Search   Register Register  Login Login

Layout for Document

 Post Reply Post Reply
Author
Message / View First Unread Post
BVS View Drop Down
Newbie
Newbie
Avatar

Joined: 09 Sep 2011
Location: Hyderabad
Posts: 11
Post Options Post Options   Quote BVS Quote  Post ReplyReply Direct Link To This Post Topic: Layout for Document
    Posted: 09 Sep 2011 at 1:57am
Doubt: 1
My Document consists of 4 pages. so i planned to do some thing like this..
 
<fo:layout-master-set>
    <fo:simple-page-master .../>
    <fo:simple-page-master .../>
    <fo:simple-page-master .../>
    <fo:page-sequence-master master-name="Doc">
         <fo:repeatable-page-master-alternatives>
               <fo:conditional-page-master-reference master-reference="First" page-position="first"/>
               <fo:conditional-page-master-reference master-reference="SecondThird" page-position="any"/> <-- any|rest is used-->
               <fo:conditional-page-master-reference master-reference="Last" page-position="last"/>
         </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>
</fo:layout-master-set>
 
 
With the above code, when i write the flow region for last Page i got the Error
"Cannot find flow region for flow-name="Last" on Page '4' "
 
Doubt: 2
 How to set IEEE format or 2-column format which overflows to next column when 1st column is full then flows to next Page when the page is full? I want to do this in the middle of the page not from the starting of the page.
     if i use column-count and column-gap in region-body it is getting set for entire page but i need n-column format to start anywhere i need it to be.
 
Reply as soon as you can
 
 
Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 90
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post Posted: 09 Sep 2011 at 6:02am
1. The element fo:region-body must have the same name in all fo:simple-master-page used in fo:page-sequence-master.
The xsl-fo should look something like this:
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xf="http://www.ecrion.com/xf/1.0" xmlns:xc="http://www.ecrion.com/2008/xc" xmlns:svg="http://www.w3.org/2000/svg">
<fo:layout-master-set>
<fo:simple-page-master master-name="FirstPage" page-width="8.500in" page-height="11.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in"/>
<fo:region-before region-name="xsl-region-before-first" display-align="after" extent="0.700in" background-color="red"/>
<fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>
<fo:region-start region-name="xsl-region-start" extent="0.700in"/>
<fo:region-end region-name="xsl-region-end" extent="0.700in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="RestPage" page-width="8.500in" page-height="11.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in"/>
<fo:region-before region-name="xsl-region-before-rest" display-align="after" extent="0.700in" background-color="green"/>
<fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>
<fo:region-start region-name="xsl-region-start" extent="0.700in"/>
<fo:region-end region-name="xsl-region-end" extent="0.700in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="LastPage" page-width="8.500in" page-height="11.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in"/>
<fo:region-before region-name="xsl-region-before-last" display-align="after" extent="0.700in" background-color="pink"/>
<fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>
<fo:region-start region-name="xsl-region-start" extent="0.700in"/>
<fo:region-end region-name="xsl-region-end" extent="0.700in"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="Doc">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="FirstPage" page-position="first"/>
<fo:conditional-page-master-reference master-reference="LastPage" page-position="last"/>
<fo:conditional-page-master-reference master-reference="RestPage" page-position="any"/> <!-- any|rest is used-->
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Doc">
<fo:static-content flow-name="xsl-region-before-first" font-size="12pt" font-family="Times">
<fo:block><fo:table width="100%" border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="proportional-column-width(50)" column-number="1"/>
<fo:table-column column-width="proportional-column-width(50)" column-number="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>First Page</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right">Page <fo:page-number format="1"/> of <fo:page-number-citation format="1" ref-id="xf#theEnd"/></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-before-rest" font-size="12pt" font-family="Times">
<fo:block><fo:table width="100%" border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="proportional-column-width(50)" column-number="1"/>
<fo:table-column column-width="proportional-column-width(50)" column-number="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>Rest Page</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right">Page <fo:page-number format="1"/> of <fo:page-number-citation format="1" ref-id="xf#theEnd"/></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-before-last" font-size="12pt" font-family="Times">
<fo:block><fo:table width="100%" border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="proportional-column-width(50)" column-number="1"/>
<fo:table-column column-width="proportional-column-width(50)" column-number="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>Last Page</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right">Page <fo:page-number format="1"/> of <fo:page-number-citation format="1" ref-id="xf#theEnd"/></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-family="Times" font-size="12pt">
<fo:block> </fo:block>
<fo:block break-before="page">&#x00A0;</fo:block>
<fo:block break-before="page"> </fo:block>
<fo:block break-before="page"> </fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>

2. You can use the attribute span="all" on fo:block element. This attribute will span all document columns. Note that the fo:block must be child of fo:flow.
Here is an xsl-fo example:
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xf="http://www.ecrion.com/xf/1.0" xmlns:xc="http://www.ecrion.com/2008/xc" xmlns:svg="http://www.w3.org/2000/svg">
<fo:layout-master-set>
<fo:simple-page-master master-name="Letter Page" page-width="8.500in" page-height="11.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in" column-count="3" column-gap="0.2in"/>
<fo:region-before region-name="xsl-region-before" display-align="after" extent="0.700in"/>
<fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>
<fo:region-start region-name="xsl-region-start" extent="0.700in"/>
<fo:region-end region-name="xsl-region-end" extent="0.700in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Letter Page">
<fo:static-content flow-name="xsl-region-before" font-size="12pt" font-family="Times">
<fo:block> </fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after" font-size="12pt" font-family="Times">
<fo:block> </fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-start" font-size="12pt" font-family="Times">
<fo:block> </fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-end" font-size="12pt" font-family="Times">
<fo:block> </fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-family="Times" font-size="12pt" background-color="green" text-align="justify">
<fo:block span="all" background-color="red">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus blandit augue eu urna pretium mattis. Suspendisse ut nibh 
lectus, sed pharetra mauris. Vivamus viverra enim congue magna cursus viverra eu id dui. Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
per inceptos himenaeos. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum varius quam, ultricies ullamcorper turpis laoreet ac. Nam viverra consequat 
lectus, a venenatis mauris porta vel. Integer sed neque id risus semper blandit vestibulum at lacus. Nulla quis ante sapien. Ut fringilla euismod risus at porttitor. Mauris sit amet sem in 
lectus accumsan viverra non non velit. Sed auctor, diam faucibus pretium ornare, purus turpis sagittis dui, ac scelerisque nisl nibh vitae metus. Donec nunc mauris, pellentesque sed 
vestibulum id, hendrerit at velit. Aliquam erat volutpat. Phasellus sit amet purus nec mi dictum eleifend. Nam mauris ipsum, accumsan at accumsan non, gravida quis orci.</fo:block>
<fo:block>Vivamus id tincidunt lacus. Donec pharetra metus quis ipsum pharetra commodo tempor nunc rhoncus. Vestibulum non ipsum sem, nec placerat diam. Integer tempor 
nibh imperdiet nulla auctor dapibus. Sed sit amet felis leo. Curabitur leo sem, tempor eu ultrices nec, dignissim a purus. In euismod euismod diam nec ornare. Curabitur gravida 
scelerisque neque, ac pharetra metus tincidunt semper. Ut sit amet mi non est consectetur molestie. Praesent a mauris fringilla dolor consequat vehicula.<fo:block/>In auctor magna 
tempor urna varius mattis. Suspendisse dapibus nisl sit amet ligula lacinia nec feugiat ipsum rhoncus. Vestibulum pharetra risus eu nisl consectetur iaculis. Donec adipiscing sapien sed erat 
venenatis nec tincidunt lectus imperdiet. Pellentesque metus urna, consectetur egestas tempus in, auctor ut massa. Etiam vitae sollicitudin nulla. Duis sed eros lectus, nec bibendum sem. 
Phasellus at massa sed felis fermentum euismod. Ut pretium lectus ut mi condimentum facilisis. Duis dictum lacinia ligula, ut tempor felis auctor eget.
<fo:block/>Quisque porttitor elementum nisl, sed cursus nibh adipiscing et. Quisque vehicula, neque eu tempus mollis, eros sem condimentum nibh, in semper tellus nunc suscipit diam. 
Aliquam erat volutpat. Vivamus tincidunt condimentum ipsum vitae tristique. Donec bibendum imperdiet elit et tincidunt. Fusce accumsan nisl nec nisi sagittis eget vestibulum nisi 
ultrices. Maecenas luctus iaculis purus sit amet dignissim.</fo:block>
<fo:block span="all" background-color="red">Quisque sed odio nisl, pharetra suscipit leo. Cras mi eros, tincidunt et hendrerit eu, tristique nec arcu. Vestibulum at nibh velit. 
Morbi erat lacus, scelerisque ut tempus dignissim, dapibus aliquet neque. Nunc vehicula aliquet dictum. Nulla facilisi. Aenean vel turpis fringilla sapien ullamcorper tincidunt. 
Mauris cursus, justo eu aliquet cursus, felis massa dictum arcu, at lacinia leo nulla at est. Donec quam mi, euismod eu tincidunt eu, vehicula nec lectus. Nunc placerat pellentesque 
neque, eget dapibus nulla ultrices in. Pellentesque urna lorem, vulputate sed hendrerit quis, dictum vel libero.</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>



Edited by radup - 09 Sep 2011 at 6:05am
Back to Top
BVS View Drop Down
Newbie
Newbie
Avatar

Joined: 09 Sep 2011
Location: Hyderabad
Posts: 11
Post Options Post Options   Quote BVS Quote  Post ReplyReply Direct Link To This Post Posted: 09 Sep 2011 at 7:18am
Thanks for your reply.
 
But i forgot to mention that for the SecondThird pages i considered to be as IEEE format us column-count="2" and column-gap=".2in". Except this line, Syntax is same as you mentioned. Please consider the situation with IEEE Format for Second and Third Pages and i think because of this the Page'4' Error is arising.
 
Is there any way to break IEEE format once declared in the middle of the page so as to continue with normat format...
Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 90
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post Posted: 09 Sep 2011 at 7:55am
Then you can declare  column-count="2" and column-gap=".2in" on SecondThird, but still the fo:flow must have the same name. Here is the example:
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xf="http://www.ecrion.com/xf/1.0" xmlns:xc="http://www.ecrion.com/2008/xc" xmlns:svg="http://www.w3.org/2000/svg">
<fo:layout-master-set>
<fo:simple-page-master master-name="FirstPage" page-width="8.500in" page-height="11.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in"/>
<fo:region-before region-name="xsl-region-before-first" display-align="after" extent="0.700in" background-color="red"/>
<fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>
<fo:region-start region-name="xsl-region-start" extent="0.700in"/>
<fo:region-end region-name="xsl-region-end" extent="0.700in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="RestPage" page-width="8.500in" page-height="11.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in" column-count="3"/>
<fo:region-before region-name="xsl-region-before-rest" display-align="after" extent="0.700in" background-color="blue"/>
<fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>
<fo:region-start region-name="xsl-region-start" extent="0.700in"/>
<fo:region-end region-name="xsl-region-end" extent="0.700in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="LastPage" page-width="8.500in" page-height="11.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in"/>
<fo:region-before region-name="xsl-region-before-last" display-align="after" extent="0.700in" background-color="pink"/>
<fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>
<fo:region-start region-name="xsl-region-start" extent="0.700in"/>
<fo:region-end region-name="xsl-region-end" extent="0.700in"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="Doc">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="FirstPage" page-position="first"/>
<fo:conditional-page-master-reference master-reference="LastPage" page-position="last"/>
<fo:conditional-page-master-reference master-reference="RestPage" page-position="any"/> <!-- any|rest is used-->
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Doc">
<fo:static-content flow-name="xsl-region-before-first" font-size="12pt" font-family="Times">
<fo:block><fo:table width="100%" border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="proportional-column-width(50)" column-number="1"/>
<fo:table-column column-width="proportional-column-width(50)" column-number="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>First Page</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right">Page <fo:page-number format="1"/> of <fo:page-number-citation format="1" ref-id="xf#theEnd"/></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-before-rest" font-size="12pt" font-family="Times">
<fo:block><fo:table width="100%" border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="proportional-column-width(50)" column-number="1"/>
<fo:table-column column-width="proportional-column-width(50)" column-number="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>Rest Page</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right">Page <fo:page-number format="1"/> of <fo:page-number-citation format="1" ref-id="xf#theEnd"/></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-before-last" font-size="12pt" font-family="Times">
<fo:block><fo:table width="100%" border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="proportional-column-width(50)" column-number="1"/>
<fo:table-column column-width="proportional-column-width(50)" column-number="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>Last Page</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right">Page <fo:page-number format="1"/> of <fo:page-number-citation format="1" ref-id="xf#theEnd"/></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-family="Times" font-size="12pt" background-color="green">
<fo:block span="all" text-align="center" font-weight="bold" font-size="20pt">Text on first page</fo:block>
<fo:block break-before="page" span="all" text-align="center" font-weight="bold" font-size="20pt">Text on second page</fo:block>
<fo:block span="all" background-color="red" >Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus blandit augue eu urna pretium mattis. Suspendisse ut nibh 
lectus, sed pharetra mauris. Vivamus viverra enim congue magna cursus viverra eu id dui. Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
per inceptos himenaeos. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum varius quam, ultricies ullamcorper turpis laoreet ac. Nam viverra consequat 
lectus, a venenatis mauris porta vel. Integer sed neque id risus semper blandit vestibulum at lacus. Nulla quis ante sapien. </fo:block>
<fo:block>Vivamus id tincidunt lacus. Donec pharetra metus quis ipsum pharetra commodo tempor nunc rhoncus. Vestibulum non ipsum sem, nec placerat diam. Integer tempor 
nibh imperdiet nulla auctor dapibus. Sed sit amet felis leo. Curabitur leo sem, tempor eu ultrices nec, dignissim a purus. In euismod euismod diam nec ornare. Curabitur gravida 
scelerisque neque, ac pharetra metus tincidunt semper. Ut sit amet mi non est consectetur molestie. Praesent a mauris fringilla dolor consequat vehicula.In auctor magna 
tempor urna varius mattis. Suspendisse dapibus nisl sit amet ligula lacinia nec feugiat ipsum rhoncus.</fo:block>
<fo:block span="all" background-color="red">Quisque sed odio nisl, pharetra suscipit leo. Cras mi eros, tincidunt et hendrerit eu, tristique nec arcu. Vestibulum at nibh velit. 
Morbi erat lacus, scelerisque ut tempus dignissim, dapibus aliquet neque. Nunc vehicula aliquet dictum. Nulla facilisi. Aenean vel turpis fringilla sapien ullamcorper tincidunt. 
Mauris cursus, justo eu aliquet cursus, felis massa dictum arcu, at lacinia leo nulla at est.</fo:block>
<fo:block break-before="page" span="all" text-align="center" font-weight="bold" font-size="20pt">Text on third page </fo:block>
<fo:block span="all" background-color="red" >Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus blandit augue eu urna pretium mattis. Suspendisse ut nibh 
lectus, sed pharetra mauris. Vivamus viverra enim congue magna cursus viverra eu id dui. Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
per inceptos himenaeos. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum varius quam, ultricies ullamcorper turpis laoreet ac. Nam viverra consequat 
lectus, a venenatis mauris porta vel. Integer sed neque id risus semper blandit vestibulum at lacus. Nulla quis ante sapien. </fo:block>
<fo:block>Vivamus id tincidunt lacus. Donec pharetra metus quis ipsum pharetra commodo tempor nunc rhoncus. Vestibulum non ipsum sem, nec placerat diam. Integer tempor 
nibh imperdiet nulla auctor dapibus. Sed sit amet felis leo. Curabitur leo sem, tempor eu ultrices nec, dignissim a purus. In euismod euismod diam nec ornare. Curabitur gravida 
scelerisque neque, ac pharetra metus tincidunt semper. Ut sit amet mi non est consectetur molestie. Praesent a mauris fringilla dolor consequat vehicula.In auctor magna 
tempor urna varius mattis. Suspendisse dapibus nisl sit amet ligula lacinia nec feugiat ipsum rhoncus.</fo:block>
<fo:block span="all" background-color="red">Quisque sed odio nisl, pharetra suscipit leo. Cras mi eros, tincidunt et hendrerit eu, tristique nec arcu. Vestibulum at nibh velit. 
Morbi erat lacus, scelerisque ut tempus dignissim, dapibus aliquet neque. Nunc vehicula aliquet dictum. Nulla facilisi. Aenean vel turpis fringilla sapien ullamcorper tincidunt. 
Mauris cursus, justo eu aliquet cursus, felis massa dictum arcu, at lacinia leo nulla at est.</fo:block>
<fo:block break-before="page"  text-align="center" font-weight="bold" font-size="20pt">Text on last page </fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>

Also you can use three page sequence with three different fo:simple-page-master: one for first page, one for middle pages and the other one for last page.


Edited by radup - 09 Sep 2011 at 7:56am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz

This page was generated in 0.135 seconds.