Alexey, On 13.11.2013 21:46, Alexey Neyman wrote:
On Wednesday, November 13, 2013 03:21:47 am Ognjen Blagojevic wrote:I need to create leaders for TOC. I started with researching FOP examples (examples/fo/basic/leaders.fo), but the generated PDF doesn't contain expected results.
(...)
Are my expectations too high?Hard to say, since you didn't attach neither sample FO code, nor the resulting PDF. Leaders work for me with 1.1 on multiple Java versions, 1.6.x and 1.7.x.
Thank you for taking look at this.I was testing with unmodified leader.fo example which is part of the FOP distro. Here is FO file based on that example, and the resulting PDF. I used FOP 1.1, Oracle JDK 1.7.0_40-b43 on Windows 7 64-bit (also other FOP versions and OSes, but the result is always the same).
Here's an example fo:leader I am using: <fo:leader padding-left="4pt" padding-right="4pt" leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/>
The only difference I notice to FO file I attached are attributes keep-with-next.within-line, padding-left and padding-right. Adding them to attached example does not solve the problem in the resulting PDF.
-Ognjen
<?xml version="1.0" encoding="utf-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="first" page-height="29.7cm" page-width="21cm" margin-top="2.5cm" margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="first"> <fo:flow flow-name="xsl-region-body"> <fo:table table-layout="fixed" width="100%" border-collapse="separate"> <fo:table-column column-width="1cm"/> <fo:table-column column-width="14.2cm"/> <fo:table-column column-width="0.3cm"/> <fo:table-body font-size="12pt" font-family="sans-serif"> <fo:table-row line-height="12pt"> <fo:table-cell><fo:block text-align="end">A) </fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="start">This is some longer sample text<fo:leader leader-pattern="dots" leader-pattern-width="8pt" leader-alignment="reference-area" /></fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="end">1</fo:block></fo:table-cell> </fo:table-row> <fo:table-row line-height="12pt"> <fo:table-cell><fo:block text-align="end">B) </fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="start">Some text<fo:leader leader-pattern="dots" leader-pattern-width="8pt" leader-alignment="reference-area" /></fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="end">2</fo:block></fo:table-cell> </fo:table-row> <fo:table-row line-height="12pt"> <fo:table-cell><fo:block text-align="end" >C) </fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="start">Text<fo:leader leader-pattern="dots" leader-pattern-width="8pt" leader-alignment="reference-area" /></fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="end">3</fo:block></fo:table-cell> </fo:table-row> <fo:table-row line-height="12pt"> <fo:table-cell><fo:block text-align="end">D) </fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="start">This text is even longer than the first entry <fo:leader leader-pattern="dots" leader-pattern-width="8pt" leader-alignment="reference-area" /></fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="end">4</fo:block></fo:table-cell> </fo:table-row> <fo:table-row line-height="12pt"> <fo:table-cell><fo:block text-align="end">E) </fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="start">Shorter text example<fo:leader leader-pattern="dots" leader-pattern-width="8pt" leader-alignment="reference-area" /></fo:block></fo:table-cell> <fo:table-cell><fo:block text-align="end">5</fo:block></fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:flow> </fo:page-sequence> </fo:root>
leader.pdf
Description: Adobe PDF document
--------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org