diff options
author | (no author) <(no author)@unknown> | 2003-07-05 18:45:06 +0000 |
---|---|---|
committer | (no author) <(no author)@unknown> | 2003-07-05 18:45:06 +0000 |
commit | ec6dc7c5383365ce4d1cabc6772e35dd202ab7e5 (patch) | |
tree | 97f078cd7b88452cd793a22ac956d1289ece0785 | |
parent | dedac27d35a1954c5f8bac03cad3e1f60a162a82 (diff) | |
download | xmlgraphics-fop-ec6dc7c5383365ce4d1cabc6772e35dd202ab7e5.tar.gz xmlgraphics-fop-ec6dc7c5383365ce4d1cabc6772e35dd202ab7e5.zip |
This commit was manufactured by cvs2svn to create branch
'FOP_0-20-0_Alt-Design'.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@196612 13f79535-47bb-0310-9956-ffa450edef68
94 files changed, 33214 insertions, 0 deletions
diff --git a/conf/fop.xconf b/conf/fop.xconf new file mode 100644 index 000000000..2f40578a8 --- /dev/null +++ b/conf/fop.xconf @@ -0,0 +1,108 @@ +<?xml version="1.0"?> + +<!-- + +This is an example configuration file for FOP. +This file contains the same settings as the default values +and will have no effect if used unchanged. + +Relative config url's will be resolved relative to +the location of this file. + +--> + +<!-- NOTE: This is the version of the configuration --> +<fop version="1.0"> + +<userAgent> + <base url="./"/> + <!-- pixel to millimeter to specify dpi, 72dpi --> + <pixelToMillimeter value="0.35277777777777777778"/> +</userAgent> + +<!-- Information for specific renderers --> +<!-- Uses renderer mime type for renderers --> +<renderers> +<renderer mime="application/pdf"> + <filterList> + <!-- provides compression using zlib flate (default is on)--> + <value>flate</value> + + <!-- encodes binary data into printable ascii characters (default off) + This provides about a 4:5 expansion of data size --> + <!-- <value>ascii-85</value> --> + + <!-- encodes binary data with hex representation (default off) + This filter is not recommended as it doubles the data size --> + <!-- <value>ascii-hex</value> --> + </filterList> + +<fonts> + <!-- embedded fonts --> + <!-- + this information must exactly match the font specified + in the fo file otherwise it will use a default font. + ie. + <fo:inline font-family="Arial" font-weight="bold" font-style="normal"> + Arial-normal-normal font + </fo:inline> + + for the font triplet specified by: + <font-triplet name="Arial" style="normal" weight="bold"/> + + If you do not want to embed the font in the pdf document + then do not include the "embed-url" attribute. + The font will be needed where the document is viewed + for it to be displayed properly. + + possible styles: normal | italic | oblique | backslant + possible weights: normal | bold | 100 | 200 | 300 | 400 + | 500 | 600 | 700 | 800 | 900 + (normal = 400, bold = 700) + --> + +<!-- + <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf"> + <font-triplet name="Arial" style="normal" weight="normal"/> + <font-triplet name="ArialMT" style="normal" weight="normal"/> + </font> + <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf"> + <font-triplet name="Arial" style="normal" weight="bold"/> + <font-triplet name="ArialMT" style="normal" weight="bold"/> + </font> +--> +</fonts> +<xmlHandler mime="text/svg+xml"> +</xmlHandler> +</renderer> +<renderer mime="application/ps"> +<xmlHandler mime="image/svg+xml"> +</xmlHandler> +</renderer> +<renderer mime="pcl"> + +</renderer> +<renderer mime="mif"> + +</renderer> +<renderer mime="text/svg+xml"> +<format type="paginated"/> +<link value="true"/> +<strokeText value="false"/> +</renderer> +<renderer mime="awt"> + +</renderer> +<renderer mime="text/xml"> + +</renderer> +<renderer mime="application/rtf"> + +</renderer> +<renderer mime="text/text"> +<pageSize columns="80"/> +</renderer> +</renderers> + +</fop> + diff --git a/examples/fo/.cvsignore b/examples/fo/.cvsignore new file mode 100644 index 000000000..a251a566e --- /dev/null +++ b/examples/fo/.cvsignore @@ -0,0 +1,2 @@ +tests + diff --git a/examples/fo/basic/alignment.fo b/examples/fo/basic/alignment.fo new file mode 100644 index 000000000..24c4f9f94 --- /dev/null +++ b/examples/fo/basic/alignment.fo @@ -0,0 +1,207 @@ +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> +<fo:layout-master-set> + <fo:simple-page-master master-name="one"> + <fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="20pt" margin-right="20pt" /> + </fo:simple-page-master> +</fo:layout-master-set> +<fo:page-sequence master-reference="one"> +<fo:flow flow-name="xsl-region-body"> + <fo:block><fo:inline font-weight="bold">Ex 1:</fo:inline> This +is a longer line of text that provides a context for the line with the images aligned on it. +This is a line with before-edge +<fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="50"> + <svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="47" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 42l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="40"> + <svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="40" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, middle<fo:instream-foreign-object vertical-align="middle"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="3" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, and no<fo:instream-foreign-object> +<svg:svg width="25" height="40"> + <svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="40" style="stroke:black;stroke-width:1.5"/> +</svg:svg> +</fo:instream-foreign-object> alignment. +And this is the line of text that follows the line with the aligned objects on it. +And finally, this line illustrates the normal spacing between lines of text in this font. +</fo:block> + +<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block> + + <fo:block><fo:inline font-weight="bold">Ex 2:</fo:inline> This +is a longer line of text that provides a context for the line with the images aligned on it. +This is a line with before-edge +<fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="50"> + <svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="47" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 42l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="40"> + <svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="40" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, middle<fo:instream-foreign-object vertical-align="middle"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="3" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object> alignment. +And this is the line of text that follows the line with the aligned objects on it. +And finally, this line illustrates the normal spacing between lines of text in this font. +</fo:block> + +<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block> + + <fo:block><fo:inline font-weight="bold">Ex 3:</fo:inline> This +is a longer line of text that provides a context for the line with the images aligned on it. +This is a line with before-edge +<fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="50"> + <svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="47" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 42l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="40"> + <svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="40" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object> alignment. +And this is the line of text that follows the line with the aligned objects on it. +And finally, this line illustrates the normal spacing between lines of text in this font. +</fo:block> + +<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block> + + <fo:block><fo:inline font-weight="bold">Ex 4:</fo:inline> This +is a longer line of text that provides a context for the line with the images aligned on it. +This is a line with before-edge +<fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="40"> + <svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="37" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 32l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="50"> + <svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="50" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object> alignment. +And this is the line of text that follows the line with the aligned objects on it. +And finally, this line illustrates the normal spacing between lines of text in this font. +</fo:block> + +<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block> + + <fo:block><fo:inline font-weight="bold">Ex 5:</fo:inline> This +is a longer line of text that provides a context for the line with the images aligned on it. +This is a line with before-edge +<fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top"> +<svg:svg width="25" height="40"> + <svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="0" x2="12.5" y2="37" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 32l7.5 8l7.5 -8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom"> +<svg:svg width="25" height="50"> + <svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="2" x2="12.5" y2="50" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object>, middle<fo:instream-foreign-object vertical-align="middle"> +<svg:svg width="25" height="25"> + <svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/> + <svg:line x1="12.5" y1="3" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/> + <svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/> + <svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/> +</svg:svg> +</fo:instream-foreign-object> alignment. +And this is the line of text that follows the line with the aligned objects on it. +And finally, this line illustrates the normal spacing between lines of text in this font. +</fo:block> + +<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/blockcontainer.fo b/examples/fo/basic/blockcontainer.fo new file mode 100644 index 000000000..2abe4d329 --- /dev/null +++ b/examples/fo/basic/blockcontainer.fo @@ -0,0 +1,170 @@ +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> +<fo:layout-master-set> + <fo:simple-page-master master-name="one"> + <fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="50pt" margin-right="50pt" /> + </fo:simple-page-master> +</fo:layout-master-set> +<fo:page-sequence master-reference="one"> +<fo:flow flow-name="xsl-region-body"> + <fo:block text-align="center" font-size="16pt" font-weight="bold"> + Block Containers + </fo:block> + + <fo:block> + The fo:block-container object can be used to create an area with + a different writing mode or a different reference orientation. + The areas can be part of the flow or absolutely positioned. + </fo:block> + + <fo:block> + This is a normal block container within the flow layout. + <fo:block-container> + <fo:block> + BC:A + </fo:block> + </fo:block-container> + </fo:block> + + <fo:block> + This block container has a different reference orientation. + <fo:block-container reference-orientation="90" inline-progression-dimension="100pt"> + <fo:block> + BC:B + </fo:block> + <fo:block> + The areas are stacked normally but the orientation of the + area is rotated 90 degrees anti-clockwise. + </fo:block> + <fo:block> + The blocks continue until exhausted as the layout + height of this container is fixed in the parent + block progression dimension. The clipping of the result + is determined by the overflow property. The block + progression dimension of this container is effectively + infinite. + </fo:block> + </fo:block-container> + </fo:block> + + <fo:block> + This block container has a different reference orientation. + <fo:block-container reference-orientation="270" inline-progression-dimension="100pt"> + <fo:block> + BC:B II + </fo:block> + <fo:block> + The areas are stacked normally but the orientation of the + area is rotated 90 degrees clockwise. + </fo:block> + <fo:block> + The blocks continue until exhausted as the layout + height of this container is fixed in the parent + block progression dimension. The clipping of the result + is determined by the overflow property. + </fo:block> + </fo:block-container> + </fo:block> + + <fo:block> + This block container has a different reference orientation. + <fo:block-container reference-orientation="180" inline-progression-dimension="100pt"> + <fo:block> + BC:B III + </fo:block> + <fo:block> + The areas are stacked normally but the orientation of the + area is rotated 180 degrees clockwise. + </fo:block> + <fo:block> + This block container behaves as part of the flow except + the contents are drawn rotated within the viewport by + 180 degrees. + </fo:block> + </fo:block-container> + </fo:block> + + <fo:block> + different writing mode + <fo:block-container writing-mode="rl"> + <fo:block> + BC:C + </fo:block> + <fo:block> + The areas in this block are stacked according to the rl (tb) + writing mode. + </fo:block> + </fo:block-container> + </fo:block> + + <fo:block> + The next block-container has an absolute position. It does + not effect the flow layout of other blocks. + <fo:block-container absolute-position="absolute" + left="20pt" top="400pt" right="220pt" bottom="550pt"> + <fo:block> + BC:D + </fo:block> + <fo:block> + This is a normal block that is confined to the + block container. + </fo:block> + </fo:block-container> + </fo:block> + + <fo:block> + The next block-container has an absolute position. It does + not effect the flow layout of other blocks. This time with + the reference-orientation set. + <fo:block-container reference-orientation="270" absolute-position="absolute" + left="270pt" top="400pt" right="370pt" bottom="500pt"> + <fo:block> + BC:E + </fo:block> + <fo:block> + This is a normal block that is confined to the + block container. + </fo:block> + </fo:block-container> + </fo:block> + + <fo:block break-after="page"> + End of page. + </fo:block> + + <fo:block> + The next block-container tests the clipping. + <fo:block-container reference-orientation="180" absolute-position="absolute" + left="100pt" top="550pt" right="200pt" bottom="700pt" + overflow="hidden"> + <fo:block> + BC:F + </fo:block> + <fo:block> + This is a normal block that is confined to the + block container. It also has contents that are + larger than the block-container so that this text + will be clipped to the viewport. + </fo:block> + </fo:block-container> + </fo:block> + + <fo:block> + The next block-container tests error-if-overflow. + <fo:block-container reference-orientation="90" absolute-position="absolute" + left="220pt" top="600pt" right="320pt" bottom="700pt" + overflow="error-if-overflow"> + <fo:block> + BC:G + </fo:block> + <fo:block> + This is a normal block that is confined to the + block container. It also has contents that are + larger than the block-container so that this text + will be clipped to the viewport. + </fo:block> + </fo:block-container> + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/border.fo b/examples/fo/basic/border.fo new file mode 100644 index 000000000..7bef67c7c --- /dev/null +++ b/examples/fo/basic/border.fo @@ -0,0 +1,189 @@ +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master + margin-right="0.5cm" margin-left="0.5cm" margin-bottom="0.5cm" margin-top="0.75cm" + page-width="21cm" page-height="29.7cm" master-name="first"> + <fo:region-body></fo:region-body> + </fo:simple-page-master> + <fo:simple-page-master + margin-right="2.5cm" margin-left="2.5cm" margin-bottom="2cm" margin-top="1cm" + page-width="21cm" page-height="29.7cm" master-name="rest"> + <fo:region-body></fo:region-body> + </fo:simple-page-master> + + <fo:page-sequence-master master-name="psmA"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="psmA"> + <fo:flow flow-name="xsl-region-body"> + <fo:block-container height="4cm" width="12cm" top="0cm" left="0cm" position="absolute"> + <fo:block text-align="start" line-height="18pt" font-family="sans-serif" font-weight="bold" font-size="14pt"> + PX7.net + </fo:block> + <fo:block text-align="start" line-height="18pt" font-family="sans-serif" font-weight="bold" font-size="14pt"> + 44 Liberty St + </fo:block> + <fo:block text-align="start" line-height="18pt" font-family="sans-serif" font-weight="bold" font-size="14pt"> + Newburyport, MA 01950 + </fo:block> + <fo:block text-align="start" line-height="18pt" font-family="sans-serif" font-weight="bold" font-size="14pt"> + 978-462-1152 + </fo:block> + </fo:block-container> + <fo:block-container height="1cm" width="6cm" top="0cm" left="14cm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="22pt" font-family="sans-serif" font-size="23pt"> + Sales Receipt + </fo:block> + </fo:block-container> + + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="2.49cm" top="1.2cm" left="13.8cm" padding=".6mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt"> + DATE + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="2.49cm" top="1.87cm" left="13.8cm" padding=".6mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="10pt"> + 01/01/2000 + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="2.49cm" top="1.2cm" left="16.46cm" padding=".6mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt"> + SALE # + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="2.49cm" top="1.87cm" left="16.46cm" padding=".6mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="10pt"> + 1 + </fo:block> + </fo:block-container> + + + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="8.95cm" top="3cm" left="0cm" padding=".6mm" position="absolute"> + <fo:block text-align="start" line-height="14pt" font-family="sans-serif" font-size="12pt"> + SOLD TO + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="3cm" width="8.95cm" top="3.67cm" left="0cm" padding=".6mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt"> + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="8.95cm" top="3cm" left="10cm" padding=".6mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt"> + SHIP TO + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="3cm" width="8.95cm" top="3.67cm" left="10cm" padding=".6mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt"> + </fo:block> + </fo:block-container> + + + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="3.96cm" top="7.25cm" left="10.74cm" padding="1mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt"> + PMT METHOD + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="3.96cm" top="8cm" left="10.74cm" padding="1mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="10pt"> + Check + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="3.96cm" top="7.25cm" left="14.95cm" padding="1mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt"> + CHECK # + </fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="3.96cm" top="8cm" left="14.95cm" padding="1mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="10pt"> + 1234 + </fo:block> + </fo:block-container> + + + <fo:block-container height="17cm" width="19cm" top="9.4cm" left="0cm" position="absolute"> + <fo:table border-collapse="separate" border-color="yellow" border-style="solid" border-width=".6mm" height="17cm"> + <fo:table-column column-width="2.5cm"/> + <fo:table-column column-width="11.5cm"/> + <fo:table-column column-width="2.5cm"/> + <fo:table-column column-width="2.5cm"/> + <fo:table-body font-family="sans-serif" font-weight="normal" font-size="10pt"> + <fo:table-row line-height="12pt"> + <fo:table-cell border-width="1pt" border-color="green" border-style="solid" padding="1mm"> + <fo:block text-align="end">QUANTITY</fo:block> + </fo:table-cell> + <fo:table-cell border-width="1pt" border-color="red" border-style="solid" padding="1mm"> + <fo:block text-align="start">DESCRIPTION</fo:block> + </fo:table-cell> + <fo:table-cell border-color="blue" border-style="solid" padding="1mm"> + <fo:block text-align="center">RATE</fo:block> + </fo:table-cell> + <fo:table-cell border-color="orange" border-style="solid" padding="1mm"> + <fo:block text-align="center">AMOUNT</fo:block> + </fo:table-cell> + + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">1</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="start">Wide Widget</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">$22.23</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">22.31</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">1</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="start">Widget</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">$22.23</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">22.31</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">3</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="start">Nuts</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">$12.00</fo:block> + </fo:table-cell> + <fo:table-cell padding="2pt"> + <fo:block text-align="end">36.00</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width="0.5mm" height="1cm" width="13.31cm" top="26.5cm" left="0cm" padding="1mm" position="absolute"> + <fo:block text-align="start" line-height="15pt" font-family="sans-serif" font-size="12pt">Please remit to the above address</fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width="0.5mm" height="1cm" width="2.5cm" top="26.5cm" left="13.56cm" padding="1mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="25pt" font-family="sans-serif" font-size="22pt">Total</fo:block> + </fo:block-container> + <fo:block-container border-color="black" border-style="solid" border-width="0.5mm" height="1cm" width="2.5cm" top="26.5cm" left="16.31cm" padding="1mm" position="absolute"> + <fo:block text-align="start" space-after.optimum="3pt" line-height="15pt" font-family="sans-serif" font-size="10pt">$3.00</fo:block> + </fo:block-container> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/bordershorthand.fo b/examples/fo/basic/bordershorthand.fo new file mode 100644 index 000000000..6c5282846 --- /dev/null +++ b/examples/fo/basic/bordershorthand.fo @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="utf-8"?> + + +<!-- example for a simple fo file. At the beginning the page layout is set. +Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations, +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions --> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + - page-sequence-masters: have the role of describing the sequence + of page-masters that will be used to generate + pages during the formatting of an fo:page-sequence + + --> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.0cm + 0.5cm" + margin-right="(5cm * 1cm) div 2cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + <!-- layout for the other pages --> + <fo:simple-page-master master-name="rest" + page-height="abs(-30cm + .3cm)" + page-width="(10cm * 2) + 1cm" + margin-top="round(.5) * 1cm" + margin-bottom="round(2.4) * 1cm" + margin-left="2.5 * 1cm" + margin-right="5.5cm - 3cm"> + <fo:region-body margin-top="2.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + +<fo:page-sequence-master master-name="basicPSM" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="basicPSM"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="10pt" + font-family="serif" + line-height="1em + 4pt" + > + Border and Padding Shorthand Tests - p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines text title level 1--> + <fo:block font-size="min(18pt,20pt)" + font-family="sans-serif" + line-height="max(24pt,18pt)" + space-after.optimum="5 mod 3 * 7.5pt" + background-color="rgb(128,128,128)" + color="rgb(255,255,255)" + text-align="center" + padding-top="3pt"> + Border and Padding Shorthand Tests + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-after="12pt" + text-align="start" + background-color="rgb(150,150,150)" + start-indent="3mm" end-indent="3mm" + padding-left="3mm" padding-right="3mm" + padding-top="4mm" padding-bottom="4mm" + border-style="dashed" + border-left-width="1pt" border-right-width="1pt" + border-top-width="2pt" border-bottom-width="2pt" + border-top-color="rgb(100,100,100)" border-bottom-color="rgb(200,200,200)"> +In this example, padding and border properties are specified using absolute properties: +padding-left, padding-right, padding-top, and padding-bottom, etc. +According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified. +</fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-after="12pt" + text-align="start" + background-color="rgb(150,150,150)" + start-indent="3mm" end-indent="3mm" + padding="3mm + 1mm 3mm" + border-top="rgb(100,100,100) 1pt + 1pt dashed" + border-bottom="2pt rgb(200,200,200) solid" + border-left="solid 1pt" border-right="solid 1pt"> +In this example, padding and border properties are specified using shorthand properties: +padding, border-width, border-color. +According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified. +</fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-after="3pt" + text-align="start" + background-color="rgb(150,150,150)" + start-indent="3mm" end-indent="3mm" + padding-before="4mm" padding-after="4mm" + padding-start.length="3mm" padding-end.length="3mm" + border-style="solid" + border-start-width="1pt" border-end-width="1pt" + border-before-width="2pt" border-after-width="2pt" + border-before-color="rgb(100,100,100)" + border-after-color="rgb(200,200,200)"> +In this example, padding and border properties are specified using writing-mode relative properties: +padding-before, padding-after, padding-start, and padding-end, etc. +According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified. +</fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-after="3pt" + text-align="start" + background-color="rgb(200,200,200)" + start-indent="3mm" end-indent="3mm" + padding = "3mm" + padding-before="4mm" padding-after="4mm" + border-width = "2pt" border-style="solid" + border-color="black" + border-start-width="1pt" border-end-width="1pt" + border-before-width="2pt" border-after-width="2pt" + border-before-color="rgb(200,200,200)" + border-after-color="rgb(100,100,100)"> +In this example, padding and border properties are specified using +shorthand and writing-mode relative properties: +padding-before, padding-after, padding-start, and padding-end, etc. +According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified. +</fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/character.fo b/examples/fo/basic/character.fo new file mode 100644 index 000000000..8771baa3c --- /dev/null +++ b/examples/fo/basic/character.fo @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- example for a simple fo file. At the beginning the page layout is set. + Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + In this case there is only a simple-page-master which defines the + layout for all pages of the text + --> + <!-- layout information --> + <fo:simple-page-master master-name="simple" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + + <!-- start page-sequence + here comes the text (contained in flow objects) + the page-sequence can contain different fo:flows + the attribute value of master-name refers to the page layout + which is to be used to layout the text contained in this + page-sequence--> + <fo:page-sequence master-reference="simple"> + + <!-- start fo:flow + each flow is targeted + at one (and only one) of the following: + xsl-region-body (usually: normal text) + xsl-region-before (usually: header) + xsl-region-after (usually: footer) + xsl-region-start (usually: left margin) + xsl-region-end (usually: right margin) + ['usually' applies here to languages with left-right and top-down + writing direction like English] + in this case there is only one target: xsl-region-body + --> + <fo:flow flow-name="xsl-region-body" + text-align="justify"> + + <!-- each paragraph is encapsulated in a block element + the attributes of the block define + font-family and size, line-heigth etc. --> + + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + > +1. Why <fo:character character="T" font-size="16pt" color="red"/><fo:character character="E" font-size="16pt" color="blue"/><fo:character character="I" font-size="16pt" color="green"/>? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too. +Why T<fo:character character="E"/>I? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too. + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + > +1. Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too. +Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too. + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + > +1. Why TEI? Using <fo:inline text-decoration="underline">TEI</fo:inline> is quite a challenge. <fo:character character="Y" font-size="16pt" />ou should use it too. + </fo:block> + + </fo:flow> <!-- closes the flow element--> + </fo:page-sequence> <!-- closes the page-sequence --> +</fo:root> diff --git a/examples/fo/basic/corresprop.fo b/examples/fo/basic/corresprop.fo new file mode 100644 index 000000000..565e35fe5 --- /dev/null +++ b/examples/fo/basic/corresprop.fo @@ -0,0 +1,237 @@ +<?xml version="1.0" encoding="utf-8"?> + + +<!-- example for a simple fo file. At the beginning the page layout is set. +Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations, +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions --> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + - page-sequence-masters: have the role of describing the sequence + of page-masters that will be used to generate + pages during the formatting of an fo:page-sequence + + --> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.0cm + 0.5cm" + margin-right="(5cm * 1cm) div 2cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + <!-- layout for the other pages --> + <fo:simple-page-master master-name="rest" + page-height="abs(-30cm + .3cm)" + page-width="(10cm * 2) + 1cm" + margin-top="round(.5) * 1cm" + margin-bottom="round(2.4) * 1cm" + margin-left="2.5 * 1cm" + margin-right="5.5cm - 3cm"> + <fo:region-body margin-top="2.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + +<fo:page-sequence-master master-name="basicPSM" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="basicPSM"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="10pt" + font-family="serif" + line-height="1em + 4pt" > + Corresponding Property Tests - p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines text title level 1--> + <fo:block font-size="min(18pt,20pt)" + font-family="sans-serif" + line-height="max(24pt,18pt)" + space-after.optimum="5 mod 3 * 7.5pt" + background-color="rgb(0,0,255)" + color="rgb(255,255,255)" + text-align="center" + padding-top="3pt"> + Corresponding Property Tests + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-after="12pt" + text-align="start" + background-color="rgb(200,200,200)" + start-indent="3mm" end-indent="3mm" + padding-left="3mm" padding-right="3mm" + padding-top="4mm" padding-bottom="4mm" + border-left-width="1pt" border-right-width="1pt" + border-top-width="2pt" border-bottom-width="2pt" + border-top-color="red" border-bottom-color="blue"> +In this example, padding and border properties are specified using absolute properties: +padding-left, padding-right, padding-top, and padding-bottom, etc. +According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified. +</fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-after="3pt" + text-align="start" + background-color="rgb(200,200,200)" + start-indent="3mm" end-indent="3mm" + padding-before="4mm" padding-after="4mm" + padding-start.length="3mm" padding-end.length="3mm" + border-start-width="1pt" border-end-width="1pt" + border-before-width="2pt" border-after-width="2pt" + border-before-color="red" border-after-color="blue"> +In this example, padding and border properties are specified using writing-mode relative properties: +padding-before, padding-after, padding-start, and padding-end, etc. +According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified. +</fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="start" + start-indent="1cm"> + This block has a start-indent of 1cm and no borders or padding. It has +no margin-left set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="start" + margin-left="1cm"> + This block has a margin-left of 1cm and no borders or padding. It has +no start-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="start" + start-indent="1cm" + padding-left="4mm" border-left-width="1mm"> + This block has a start-indent of 1cm, padding-left of 4mm and border-left-width of 1mm. It has +no margin-left set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="start" + margin-left="5mm" + padding-left="4mm" border-left-width="1mm"> + This block has a margin-left of 5mm, padding-left of 4mm and border-left-width of 1mm. (Margin is outside the border rectangle.) It has +no start-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + + <!-- defines text title level 1--> + <fo:block font-size="14pt" + font-family="serif" + font-weight="bold" + line-height="16pt" + space-after="6pt" + text-align="center" + break-before="page"> + End-indent tests + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="end" + end-indent="1cm"> + This block has an end-indent of 1cm and no borders or padding. It has +no margin-right set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="end" + margin-right="1cm"> + This block has a margin-right of 1cm and no borders or padding. It has +no end-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="end" + end-indent="1cm" + padding-end="4mm" border-end-width="1mm"> + This block has an end-indent of 1cm, padding-end of 4mm and border-end-width of 1mm. It has +no margin-right set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="end" + margin-right="5mm" + padding-right="4mm" border-right-width="1mm"> + This block has a margin-right of 5mm, padding-right of 4mm and +border-right-width of 1mm. (Margin is outside the border rectangle.) It has +no end-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-before="12pt" + space-after="3pt" + text-align="end" + margin-right="5mm" + padding-end="4mm" border-end-width="1mm"> + This block has a margin-right of 5mm, padding-end of 4mm and +border-end-width of 1mm. (Margin is outside the border rectangle.) It has +no end-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/extensive.fo b/examples/fo/basic/extensive.fo new file mode 100644 index 000000000..a1cc5c46a --- /dev/null +++ b/examples/fo/basic/extensive.fo @@ -0,0 +1,148 @@ +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> +<fo:layout-master-set> +<fo:simple-page-master master-name="one"> +<fo:region-body margin-top="50pt" margin-bottom="50pt" margin-left="100pt" margin-right="100pt"/> +</fo:simple-page-master> +</fo:layout-master-set> +<fo:page-sequence master-reference="one"> +<fo:flow flow-name="xsl-region-body"> +<fo:block>A Block</fo:block> +<fo:block text-align="end">An End Aligned Block</fo:block> +<fo:block text-align="center">A Centered Block</fo:block> +<fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks. Alignment is default.</fo:block> +<fo:block text-align="end">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. Alignment is end.</fo:block> +<fo:block text-align="center">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. Alignment is centered.</fo:block> +<fo:block text-align="justify">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. I'm going to keep going so I can get three lines to check how all but the last justify. There, that should do it. Alignment is justified.</fo:block> +<fo:block>A block for comparison</fo:block> +<fo:block space-before.optimum="12pt">A block with 12pt space-before</fo:block> +<fo:block>A block for comparison</fo:block> +<fo:block space-after.optimum="12pt">A block with 12pt space-after</fo:block> +<fo:block>A block for comparison</fo:block> +<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block with both 12pt space-before and space-after</fo:block> +<fo:block>A block for comparison</fo:block> +<fo:block start-indent="50pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. There is a start-indent of 50pt.</fo:block> +<fo:block end-indent="50pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. There is an end-indent of 50pt.</fo:block> +<fo:block start-indent="50pt" end-indent="50pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. There is a start-indent and end-indent of 50pt.</fo:block> +<fo:block font-size="15pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The font-size is set to 15pt.</fo:block> +<fo:block line-height="20pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The line-height is set to 20pt.</fo:block> +<fo:block font-size="15pt" line-height="20pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The font-size is set to 15pt and the line-height is set to 20pt.</fo:block> +<fo:block font-size="15pt" line-height="15pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The font-size is set to 15pt and the line-height is set to 15pt.</fo:block> +<fo:block space-before.optimum="12pt" space-after.optimum="12pt"><fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block within a block</fo:block></fo:block> +<fo:block space-before.optimum="12pt" space-after.optimum="12pt">Text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block within a block</fo:block>Text after</fo:block> +<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="50pt">Text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block within a block with 50pt start-intent</fo:block>Text after</fo:block> +<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="50pt">And again for the page break, text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block within a block with 50pt start-intent</fo:block>Text after</fo:block> +<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="50pt">Text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block with 50pt start-indent within a block with 50pt start-intent</fo:block>Text after</fo:block> +<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="50pt">Text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="100pt">A block with 100pt start-indent within a block with 50pt start-intent</fo:block>Text after</fo:block> +<fo:list-block provisional-distance-between-starts="12pt" space-before.optimum="12pt" text-align="justify"> +<fo:list-item> +<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> +<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body> +</fo:list-item> +<fo:list-item> +<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> +<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body> +</fo:list-item> +</fo:list-block> +<fo:list-block start-indent="50pt" provisional-distance-between-starts="12pt" space-before.optimum="12pt" text-align="justify"> +<fo:list-item> +<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> +<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The list-block has a start-indent of 50pt and a text-align of justified.</fo:block></fo:list-item-body> +</fo:list-item> +<fo:list-item> +<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> +<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a second multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a third multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body> +</fo:list-item> +</fo:list-block> +<fo:list-block provisional-distance-between-starts="12pt" space-before.optimum="12pt" text-align="justify"> +<fo:list-item> +<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> +<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block start-indent="100pt">This is a multiple line block with start-indent 100pt that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body> +</fo:list-item> +<fo:list-item> +<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> +<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.<fo:block>This is an embedded multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body> +</fo:list-item> +</fo:list-block> + <fo:list-block provisional-distance-between-starts="12pt" space-before.optimum="12pt"> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> + <fo:list-item-body start-indent="body-start()"><fo:block>A block in a list-item-body</fo:block></fo:list-item-body> + </fo:list-item> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:list-block provisional-distance-between-starts="12pt"> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> + <fo:list-item-body start-indent="body-start()"><fo:block>This is a list item in a list that is itself a list item</fo:block></fo:list-item-body> + </fo:list-item> + </fo:list-block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + <fo:block break-before="page" font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt">Next Stage</fo:block> + <fo:block>Right, now we are ready to try some newly implemented things like rules. What follows is a display rule of default thickness 1pt and a space-before and space-after of 12pt.</fo:block> + <fo:block><fo:leader leader-pattern="rule" space-before.optimum="12pt" space-after.optimum="12pt"/></fo:block> + <fo:block>Now what follows is a leader of thickness 5pt with start-indent of 100pt (same space-before/after as before).</fo:block> + <fo:block><fo:leader leader-pattern="rule" space-before.optimum="12pt" space-after.optimum="12pt" rule-thickness="5pt" start-indent="100pt"/></fo:block> + <fo:block font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt" + ><fo:inline color="#500">C</fo:inline + ><fo:inline color="#700">o</fo:inline + ><fo:inline color="#900">l</fo:inline + ><fo:inline color="#B00">o</fo:inline + ><fo:inline color="#D00">u</fo:inline + ><fo:inline color="#F00">r</fo:inline + ></fo:block> + <fo:block color="black">black</fo:block> + <fo:block color="green">green</fo:block> + <fo:block color="silver">silver</fo:block> + <fo:block color="lime">lime</fo:block> + <fo:block color="gray">gray</fo:block> + <fo:block color="olive">olive</fo:block> + <fo:block color="white">white</fo:block> + <fo:block color="yellow">yellow</fo:block> + <fo:block color="maroon">maroon</fo:block> + <fo:block color="navy">navy</fo:block> + <fo:block color="red">red</fo:block> + <fo:block color="blue">blue</fo:block> + <fo:block color="purple">purple</fo:block> + <fo:block color="teal">teal</fo:block> + <fo:block color="fuchsia">fuchsia</fo:block> + <fo:block color="aqua">aqua</fo:block> + <fo:block break-before="even-page" font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt">Wrap</fo:block> + <fo:block space-before.optimum="12pt">This is a rather long sentence that is going to keep on going and going, not really to demonstrate anything other that normal wrapping because the following paragraph will show what happens when wrap-option is set to no-wrap.</fo:block> + <fo:block space-before.optimum="12pt" wrap-option="no-wrap">This is a rather long sentence that is going to keep on going and going to demonstrate what happens when wrap-option is set to no-wrap which is unlike the preceding sentence where it defaults to wrap.</fo:block> + <fo:block space-before.optimum="12pt" wrap-option="wrap">This is a rather long sentence that is going to keep on going and going, not really to demonstrate anything other that normal wrapping but it differs from the first of these three sentences in that wrap is set explicitly.</fo:block> + <fo:block font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt">White Space Collapse</fo:block> +<fo:block>This is default!</fo:block> +<fo:block white-space-collapse="false">This is false!</fo:block> +<fo:block white-space-collapse="true">This is true!</fo:block> +<fo:block font-family="monospace" + white-space-collapse="false" + linefeed-treatment="preserve" + white-space-treatment="preserve" + wrap-option="no-wrap"> +<![CDATA[<?xml version="1.0"?> +<document> + <heading>This is a heading</heading> + <list> + <item>Item one</item> + <item>Item two</item> + </list> +</document>]]> +</fo:block> + <fo:block break-before="page" font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt">Embedded SVG</fo:block> + <fo:block><fo:instream-foreign-object> + <svg:svg width="400pt" height="200pt"> + <svg:rect style="fill:none;stroke:blue" x="20pt" y="20pt" width="100pt" height="100pt"/> + <svg:line x1="20pt" y1="20pt" x2="120pt" y2="120pt"/> + <svg:line x1="120pt" y1="20pt" x2="20pt" y2="120pt"/> + <svg:text x="20pt" y="150pt">Hello SVG!</svg:text> + </svg:svg> + </fo:instream-foreign-object></fo:block> + <fo:block>The above is an example of an SVG graphic</fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> + + diff --git a/examples/fo/basic/fonts.fo b/examples/fo/basic/fonts.fo new file mode 100644 index 000000000..7501104a2 --- /dev/null +++ b/examples/fo/basic/fonts.fo @@ -0,0 +1,195 @@ +<?xml version="1.0" ?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines the layout master --> + <fo:layout-master-set> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <!-- starts actual layout --> + <fo:page-sequence master-reference="first"> + + +<fo:flow flow-name="xsl-region-body"> + + <fo:block font-family="Helvetica" font-size="14pt"> +Helvetica + </fo:block> + <fo:block space-after.optimum="10pt" font-family="Helvetica"> +! " # $ % & ' ( ) * ++ , - . / 0 1 2 3 4 +5 6 7 8 9 : ; < = > +? @ A B C D E F G H +I J K L M N O P Q R +S T U V W X Y Z [ \ +] ^ _ ` a b c d e f +g h i j k l m n o p +q r s t u v w x y z +{ | } ~ ¡ ¢ £ ¤ ¥ ¦ +§ ¨ © ª « ¬ ® ¯ ° ± +² ³ ´ µ ¶ · ¸ ¹ º » +¼ ½ ¾ ¿ À Á Â Ã Ä Å +Æ Ç È É Ê Ë Ì Í Î Ï +Ð Ñ Ò Ó Ô Õ Ö × Ø Ù +Ú Û Ü Ý Þ ß à á â ã +ä å æ ç è é ê ë ì í +î ï ð ñ ò ó ô õ ö ÷ +ø ù ú û ü ý þ ÿ +Œ œ Š š Ÿ +Ž ž ƒ ˜ – — ‘ +’ ‚ “ ” „ † ‡ +• … ‰ ‹ › ™ + </fo:block> + + <fo:block font-family="Helvetica" font-size="14pt"> +Times Roman + </fo:block> + <fo:block space-after.optimum="10pt" font-family="Times Roman"> +! " # $ % & ' ( ) * ++ , - . / 0 1 2 3 4 +5 6 7 8 9 : ; < = > +? @ A B C D E F G H +I J K L M N O P Q R +S T U V W X Y Z [ \ +] ^ _ ` a b c d e f +g h i j k l m n o p +q r s t u v w x y z +{ | } ~ ¡ ¢ £ ¤ ¥ ¦ +§ ¨ © ª « ¬ ® ¯ ° ± +² ³ ´ µ ¶ · ¸ ¹ º » +¼ ½ ¾ ¿ À Á Â Ã Ä Å +Æ Ç È É Ê Ë Ì Í Î Ï +Ð Ñ Ò Ó Ô Õ Ö × Ø Ù +Ú Û Ü Ý Þ ß à á â ã +ä å æ ç è é ê ë ì í +î ï ð ñ ò ó ô õ ö ÷ +ø ù ú û ü ý þ ÿ Œ +œ Š š Ÿ Ž ž ƒ +˜ – — ‘ ’ ‚ +“ ” „ † ‡ • … +‰ ‹ › ™ + </fo:block> + + <fo:block font-family="Helvetica" font-size="14pt"> +Courier + </fo:block> + <fo:block space-after.optimum="10pt" font-family="Courier"> +! " # $ % & ' ( ) * ++ , - . / 0 1 2 3 4 +5 6 7 8 9 : ; < = > +? @ A B C D E F G H +I J K L M N O P Q R +S T U V W X Y Z [ \ +] ^ _ ` a b c d e f +g h i j k l m n o p +q r s t u v w x y z +{ | } ~ ¡ ¢ £ ¤ ¥ ¦ +§ ¨ © ª « ¬ ® ¯ ° ± +² ³ ´ µ ¶ · ¸ ¹ º » +¼ ½ ¾ ¿ À Á Â Ã Ä Å +Æ Ç È É Ê Ë Ì Í Î Ï +Ð Ñ Ò Ó Ô Õ Ö × Ø Ù +Ú Û Ü Ý Þ ß à á â ã +ä å æ ç è é ê ë ì í +î ï ð ñ ò ó ô õ ö ÷ +ø ù ú û ü ý þ ÿ Œ +œ Š š Ÿ Ž +ž ƒ ˜ – — ‘ +’ ‚ “ ” „ † ‡ +• … ‰ ‹ › ™ + </fo:block> + + <fo:block font-family="Helvetica" font-size="14pt"> + ZapfDingbats: + </fo:block> + <fo:block space-after.optimum="10pt" font-family="ZapfDingbats"> +✁ ✂ ✃ ✄ ☎ ✆ ✇ +✈ ✉ ☛ ☞ ✌ ✍ ✎ +✏ ✐ ✑ ✒ ✓ ✔ ✕ +✖ ✗ ✘ ✙ ✚ ✛ ✜ +✝ ✞ ✟ ✠ ✡ ✢ ✣ +✤ ✥ ✦ ✧ ★ ✩ ✪ +✫ ✬ ✭ ✮ ✯ ✰ ✱ +✲ ✳ ✴ ✵ ✶ ✷ ✸ +✹ ✺ ✻ ✼ ✽ ✾ ✿ +❀ ❁ ❂ ❃ ❄ ❅ ❆ +❇ ❈ ❉ ❊ ❋ ● ❍ +■ ❏ ❐ ❑ ❒ ▲ ▼ +◆ ❖ ◗ ❘ ❙ ❚ ❛ +❜ ❝ ❞ ❡ ❢ ❣ ❤ +❥ ❦ ❧ ♣ ♦ ♥ ♠ +① ② ③ ④ ⑤ ⑥ ⑦ +⑧ ⑨ ⑩ ❶ ❷ ❸ ❹ +❺ ❻ ❼ ❽ ❾ ❿ ➀ +➁ ➂ ➃ ➄ ➅ ➆ ➇ +➈ ➉ ➊ ➋ ➌ ➍ ➎ +➏ ➐ ➑ ➒ ➓ ➔ → +↔ ↕ ➘ ➙ ➚ ➛ ➜ +➝ ➞ ➟ ➠ ➡ ➢ ➣ +➤ ➥ ➦ ➧ ➨ ➩ ➪ +➫ ➬ ➭ ➮ ➯ ➱ ➲ +➳ ➴ ➵ ➶ ➷ ➸ ➹ +➺ ➻ ➼ ➽ ➾   +       +     + </fo:block> + + <fo:block font-family="Helvetica" font-size="14pt"> + Symbol: + </fo:block> + <fo:block space-after.optimum="10pt" font-family="Symbol"> +! # % & ( ) + , . / +0 1 2 3 4 5 6 7 8 9 +: ; < = > ? [ ] _ m +{ | } ¬ ° ± µ × ÷ +ƒ Α Β Γ Ε Ζ Η +Θ Ι Κ Λ Μ Ν Ξ +Ο Π Ρ Σ Τ Υ Φ +Χ Ψ α β γ δ ε +ζ η θ ι κ λ ν +ξ ο π ρ ς σ τ +υ φ χ ψ ω ϑ ϒ +ϕ ϖ • … ′ ″ ⁄ +ℑ ℘ ℜ Ω ℵ ← ↑ +→ ↓ ↔ ↵ ⇐ ⇑ ⇒ +⇓ ⇔ ∀ ∂ ∃ ∅ ∆ +∇ ∈ ∉ ∋ ∏ ∑ − +∗ √ ∝ ∞ ∠ ∧ ∨ +∩ ∪ ∫ ∴ ∼ ≅ ≈ +≠ ≡ ≤ ≥ ⊂ ⊃ ⊄ +⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌠ +⌡ 〈 〉 ◊ ♠ ♣ ♥ +♦       +       +       +       +  + </fo:block> + + <fo:block font-family="Helvetica" font-size="12pt"> + Some special characters: + </fo:block> + <fo:block space-after.optimum="10pt" font-family="Helvetica"> +Euro ( dec 8364, hex 20AC): € + </fo:block> + + + <fo:block space-after.optimum="10pt" font-family="Helvetica"> + + </fo:block> + +</fo:flow> +</fo:page-sequence> +</fo:root> + diff --git a/examples/fo/basic/hyphen.fo b/examples/fo/basic/hyphen.fo new file mode 100644 index 000000000..bd5d426ee --- /dev/null +++ b/examples/fo/basic/hyphen.fo @@ -0,0 +1,428 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- example for a simple fo file. At the beginning the page layout is set. + Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + In this case there is only a simple-page-master which defines the + layout for all pages of the text + --> + <!-- layout information --> + <fo:simple-page-master master-name="simple" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="7cm" + margin-right="3cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + + <!-- start page-sequence + here comes the text (contained in flow objects) + the page-sequence can contain different fo:flows + the attribute value of master-name refers to the page layout + which is to be used to layout the text contained in this + page-sequence--> + <fo:page-sequence master-reference="simple"> + + <!-- start fo:flow + each flow is targeted + at one (and only one) of the following: + xsl-region-body (usually: normal text) + xsl-region-before (usually: header) + xsl-region-after (usually: footer) + xsl-region-start (usually: left margin) + xsl-region-end (usually: right margin) + ['usually' applies here to languages with left-right and top-down + writing direction like English] + in this case there is only one target: xsl-region-body + --> + <fo:flow flow-name="xsl-region-body" + text-align="justify"> + + <!-- each paragraph is encapsulated in a block element + the attributes of the block define + font-family and size, line-heigth etc. --> + + <!-- this defines a title --> + <fo:block font-size="18pt" + font-family="sans-serif" + line-height="24pt" + space-after.optimum="15pt" + background-color="blue" + color="white" + text-align="center" + padding-top="3pt"> + Hyphenation tests + </fo:block> + + <!-- this defines a title --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="12pt" + background-color="blue" + color="white" + text-align="start"> + US English + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="justify" + language="en" + country="US" + hyphenate="true" + hyphenation-push-character-count="2" + hyphenation-remain-character-count="2" > + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="justify" + language="en" + country="US" + hyphenate="true" + hyphenation-push-character-count="2" + hyphenation-remain-character-count="2" > + This document specifies a syntax created by subsetting an existing, widely used international text processing standard + (Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It + is a product of the W3C XML Activity, details of which can be found at the w3c website. A list of current W3C + Recommendations and other technical documents can be found there too. + </fo:block> + + + <!-- this defines a title --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="12pt" + background-color="blue" + color="white" + text-align="start"> + German + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + language="de" + hyphenate="true" + hyphenation-push-character-count="2" + hyphenation-remain-character-count="2" > + 1. Warum TEI? + Die Verwendungszeit elektronischer Editionen wird von mehreren + Faktoren verkürzt: der kurzen Lebensdauer der Programme, die zu + ihrer Darstellung verwendet werden, der etwas längeren der + Betriebssysteme, unter denen die Darstellungsprogramme laufen, + der logischen Einrichtung des Datenträgers, auf dem sich die + Edition befindet, und dessen physischer Dauer. Um die besonders + unangenehme Abhängigkeit elektronischer Texte von bestimmten + Programmen und Betriebssystemen zu vermeiden, haben + Wissenschaftler ein Textauszeichnungssystem für philologische + Belange entwickelt, das nach dem Entwicklerteam "Text Encoding + Initiative" (TEI) genannt wird (1). + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + language="de" + hyphenate="true"> + Das Auszeichnungssystem TEI ist eine Anwendung der Metasprache + zur Beschreibung programmunabhängiger Auszeichnungssysteme SGML + (Standard Generalized Markup Language), so wie auch HTML, mit + dem die meisten Texte des Internets zur Zeit ausgezeichnet + sind, eine Anwendung von SGML ist. Daten, die entsprechend den + TEI-Richtlinien ausgezeichnet worden sind, können also mit + jedem Programm, das SGML-Daten verarbeiten kann, dargestellt, + umgewandelt oder durchsucht werden. (2) + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + language="de" + hyphenate="true"> + + Verwendet wurde für die Auszeichnung 'teilite', das eine + Teilmenge des gesamten Auszeichnungssystems TEI bietet, aber + auf einige der komplexeren Merkmale verzichtet und deshalb auch + eine einfache Konvertierung der Daten zu neueren Metasprachen + für Auszeichnungssysteme wie XML, einer Teilmenge von SGML, + ermöglicht. + SGML-Programme mit der Leistungsfähigkeit von Folio Views sind + z.Zt. noch relativ teuer, daher wurde für die vorliegende + Edition der Weg gewählt, den Text doppelt auf die CD zu legen: + Einmal für die sofortige Nutzung mit einer komfortablen + Oberfläche und einmal ohne Software in einem Format, das seine + langfristige Verwendbarkeit garantiert. + Das Nachstehende soll einige Hinweise zur Einrichtung der TEI- + Dateien geben, um deren weitere Verwendung zu erleichtern. + </fo:block> + + + + <!-- Finnish example sent in by Jarno Elovirta --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="12pt" + background-color="blue" + color="white" + text-align="start"> + Finnish + </fo:block> + + <fo:block language="fi" + hyphenate="true"> + <fo:block font-weight="bold">Internet - tuo kaiken pahan lähde?</fo:block> + <fo:block>Internet on saanut nauttia lähes täydellisestä sananvapaudesta koko + olemassaolonsa ajan. Parin viimeiksi kuluneen vuoden aikana on kuitenkin + julkisuudessa keskusteltu ahkerasti sen rajoittamisesta. Muutamat ilmaista + kotisivutilaa tarjoavat palvelut ovatkin jo kieltäneet esimerkiksi natsimia + kannattavien sivujen ylläpidon.</fo:block> <fo:block>Astetta pahempaan + suuntaan ollaan kuitenkin menossa. Nettihuutokaupoissa tarjotaan kaikkea + ihmiselimistä lähtien ja itsemurhiin etsitään avustajia itsemurhia suosivilta + nettisivustoilta. Etelä-Koreassa poliisi on pidättänyt 20-vuotiaan miehen, + jota epäillään ns. netti-itsemurhassa avustamisesta. Mies oli luvannut noin + 4000 dollarin korvausta vastaan kuristaa 23-vuotiaan naisen kuoliaaksi. Nainen + tuli kuitenkin viime hetkellä toisiin ajatuksiin. Mies väittää kyseessä olleen + pelkän vitsin. Viime kuussa Etelä-Koreassa kaksi opiskelijaa myrkytti itsensä + netistä löytämiensä ohjeiden avulla.</fo:block> <fo:block>FBI puolestaan + tutkii tapausta, jossa äiti oli myynyt kaksostytöt adoptoitavaksi korkeinta + tarjousta vastaan nettihuutokaupalla. Tytöt myytiin ensin Kaliforniaan Allenin + pariskunnalle, josta äiti kuitenkin kävi ryöstämässä lapset, sillä + englantilainen Kilshawin pariskunta oli tarjonnut tytöistä tuplasumman. + Kilshawit kuljettivat lapset Englantiin ja nyt tyttöjen perässä ovat sekä + kahdet adoptiovanhemmat että iso liuta eri viranomaistahoja. Myös + Iso-Britannian pääministeri Tony Blair on pitänyt lehdistötilaisuuden + aiheeseen liittyen. Lue juttu.</fo:block> <fo:block>K2, 23:10. Lähde: + Newsbytes | 5 kommenttia</fo:block> <fo:block font-weight="bold">Mato ryömii + Linux-palvelimiin</fo:block> <fo:block>Internetissä leviää Ramen nimellä + tunnettu mato, joka ilmeisesti hyödyntää kahta tunnettua tietoturva-aukkoa Red + Hat Linuxin 6.2 ja 7.0 versioissa esiintyvissä wu-ftpd ja RPC.statd + -ohjelmissa. Jos mato pääsee sisään järjestelmään, se korvaa palvelimella + sijaitsevan HTML-pääsivun tekstillä, jossa kerrotaan hakkereiden pitävän + nuudeleista. Madon on todettu leviävän erittäin nopeasti, sillä jos kaistaa + riittää se pystyy skannaamaan jopa kaksi B-luokan verkkoa 15 minuutissa. Madon + ei ole todettu avaavan palvelimiin takaovia, joiden kautta madon kirjoittaja + pääsisi sisään järjestelmään. Lue juttu</fo:block> <fo:block>oma, 20:48. + Lähde: ZDNet | 6 kommenttia</fo:block> <fo:block font-weight="bold">Macromedia + ja Allaire yhdistyvät</fo:block> <fo:block>Macromedian ja Allairen + julkaisemissa lehdistötiedotteissa kerrotaan yhtiöiden + yhdistymissuunnitelmista. Macromedialle yrityskauppa maksaa noin 2,2 miljardia + markkaa. Uuden yhdistyneen yrityksen nimenä säilyy Macromedia ja sen johdossa + jatkaa Macromedian nykyinen toimitusjohtaja Rob Burgess. Yrityksen tuotteisiin + lukeutuvat mm. Macromedia Dreamweaver, Macromedia Flash, Allaire ColdFusion ja + Allaire JRun. Lue juttu.</fo:block> + </fo:block> + + <!-- Italian example sent in by Stéphane Bline--> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="12pt" + background-color="blue" + color="white" + text-align="start"> + Italian + </fo:block> + + <fo:block language="it" + hyphenate="true"> + <fo:block + space-before.optimum="0.6em" space-before.minimum="0.4em" + space-before.maximum="0.8em">Un'applicazione di servizio consiste nell'utilizzo + di applicazioni nell'ambito aziendale, senza procedere ad installazioni locali. + L'applicazione ha la particolarità di essere ospitata "in-house" tramite + Intranet o presso un fornitore esterno di applicazioni di servizi (ASP, acronimo + di Application Service Provider) e di transitare grazie al protocollo di + Internet. Intermediario eventuale tra l'editore di software e il cliente che + desidera utilizzarli, il provider permette agli utenti di accedere ai vari + programmi, previo contratto d'abbonamento.</fo:block> <fo:block + space-before.optimum="0.6em" space-before.minimum="0.4em" + space-before.maximum="0.8em">L'utilizzazione in linea rende automatica la + manutenzione e l'aggiornamento delle applicazioni. A partire da una semplice + interfaccia Web installata su un thin client, l'utente può accedere via + Internet o Intranet all'insieme delle applicazioni attraverso il proprio account + personale e dedicarsi all'utilizzazione approfondita delle applicazioni + professionali.</fo:block> <fo:block font-weight="bold" + space-after.optimum="6pt">Esempio 1.1. Esempio di applicazione di + servizio</fo:block> <fo:block space-before.optimum="0.6em" + space-before.minimum="0.4em" space-before.maximum="0.8em">Si prenda il caso di + una società A che desidera ottimizzare la comunicazione interna e la + condivisione delle informazioni. Un fornitore di applicazioni di servizio + potrà rispondere rapidamente a questa aspettativa. Inoltre, potrà proporre + servizi complementari che permettono di proteggere i dati di A. Dopo aver + studiato l'offerta, un responsabile della società firma con il fornitore B un + contratto d'abbonamento a un'applicazione di servizio perfettamente adattata. Le + società e B scambiano informazioni relative all'utilizzo online di questa + applicazione, come il costo del servizio, le modalità di pagamento e la gestione + degli account utente come i profili.</fo:block> </fo:block> + + + <!-- this defines a title --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="12pt" + background-color="blue" + color="white" + text-align="start"> + Danish + </fo:block> + <fo:block language="da" + hyphenate="true"> + Bekendtgørelsen har som udkast været + notificeret i overensstemmelse med Europa-parlamentets og RÃ¥dets direktiv + 98/34/EF (Informationsproceduredirektivet), som senest ændret ved direktiv + 98/48/EF. Bekendtgørelsen indeholder bestemmelser der gennemfører dele af + RÃ¥dets direktiv 89/677/EØF (EF-tidende L 398 s. 19). + </fo:block> + + <fo:block language="da" + hyphenate="true"> + Bekendtgørelsens regler hindrer + ikke import, salg og anvendelse af produkter, der pÃ¥ tidspunktet for + bekendtgørelsens ikrafttræden er reguleret i medfør af anden lovgivning, + der implementerer EU-direktiver, samt anden lovgivning i øvrigt, herunder + bl.a. bekendtgørelse nr. 807 af 2. december 1986 om + begrænsning af motorbenzins indhold af blyforbindelser og benzen. + </fo:block> + <fo:block language="da" + hyphenate="true"> + Import og salg af produkter, der + indeholder kemiske forbindelser af bly, er forbudt fra 1. marts 2001. + Uanset forbudet i stk. + 1 er import og salg af produkter, der indeholder kemiske forbindelser af + bly, fortsat tilladt for de produktkategorier, som er nævnt i bilag + 1 til denne bekendtgørelse, indtil de i bilaget anførte + tidspunkter. + </fo:block> + + + <!-- this defines a title --> + <fo:block font-size="12pt" + font-family="Palatino" + line-height="12pt" + background-color="blue" + color="white" + text-align="start"> + Norwegian + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + language="no" + hyphenate="true"> + + <fo:block> +Av forstÃ¥elige grunner har Ã¥ret 1814 vært av de mest omdiskuterte i norsk historieforskning. +Med denne bibliografien vil man for første gang fÃ¥ en samlet oversikt over den viktigste +historiske litteraturen omkring dette Ã¥ret og dets mangslungne begivenheter. Likevel har det +vært en tilnærmet umulig oppgave Ã¥ fÃ¥ med absolutt alt som er skrevet om Riksforsamlingen og +Grunnloven i monografier, erindringsverker, bygdebøker, brevsamlinger, tidsskrifter og +aviser helt fra 1814 og til i dag. Bibliografien er et forsøk pÃ¥ Ã¥ samle de viktigste +arbeider om 1814 som kan være av interesse bÃ¥de for forskere og for et bredt +historieinteressert publikum. I denne korte historiografien vil det bli gjort rede for +hvordan dette spennende Ã¥ret er blitt forstÃ¥tt og fortolket av norske og nordiske +historikere gjennom fem ulike tidsepoker. + </fo:block> + <fo:block> +Litteraturen om 1814 kan klassifiseres pÃ¥ flere mÃ¥ter. Grovt sett gÃ¥r det et skille mellom +tre genrer: historiske oversiktsverker, historiske spesialstudier, erindringer og dagbøker +og kilde- og dokumentutgivelser. Av oversiktsverker peker de store Norgeshistoriene seg ut +med sin relativt omfattende behandling av 1814: Nevnes kan +<fo:inline font-style="italic">Norges historie fremstillet for +det norske folk</fo:inline>, bd. VI.1 (1913), +<fo:inline font-style="italic">Det norske folks liv og historie</fo:inline> bd. VII (1933), +<fo:inline font-style="italic">VÃ¥rt folks historie</fo:inline> bd. 6 (1964), +<fo:inline font-style="italic">Cappelens Norges historie</fo:inline> bd. 9 (1978) og +<fo:inline font-style="italic">Aschehougs Norgeshistorie</fo:inline> bd. 7 (1996). Disse oversiktene er i vesentlig grad bygd pÃ¥ den omfattende +spesiallitteraturen i bok- eller artikkelform som har et meget vidt spenn, fra biografier +over lokale Eidsvollsmenn til krigshistoriske analyser av felttoget. Mye tidligere skjult +kunnskap er dessuten blitt hentet ut fra dagbøkene til sentrale aktører. Endelig har den +lange rekken av kildeutgivelser hatt stor betydning for forskningen omkring 1814 og bidratt +til Ã¥ endre forskningsbildet flere ganger. + </fo:block> + <fo:block font-weight="bold"> +1814-1864 + </fo:block> + <fo:block> +Det norske samfunnet etter 1814 ble rekonstruert pÃ¥ den nye Grunnlovens grunn, og vernet om +den stod sentralt i den politiske kampen de neste 25 Ã¥rene. Til tross for dette mÃ¥ man kunne +si at dokumentasjonen av hva som egentlig hadde skjedd i 1814 i mange Ã¥r forble temmelig +beskjeden. Historiene levde, men da helst muntlig eller gjennom private brev og dagbøker. +Dette var kanskje en uunngÃ¥elig konsekvens av omstendighetene. Landet var fattig pÃ¥ kultur, +forleggere og historikere, og de politiske og økonomiske realiteter kalte mer pÃ¥ praktisk +fornuft enn pÃ¥ idealistisk pasjon. Det forekom Ã¥ være en lang vei fra den nasjonale raptus +under de lyse vÃ¥rukene pÃ¥ et grønnende Eidsvoll til den mer prosaiske og realpolitiske +aksept av union og svenskekonge i et høstlig og tÃ¥ketungt Christiania. Det var den nye +Grunnloven av 4. november 1814 som gjaldt og regulerte det norske samfunnet, supplert av +Riksakten av 1815. + </fo:block> + <fo:block> +Riksforsamlingens forhandlinger i 1814 ble utgitt i 6 hefter allerede samme Ã¥r av de valgte +redaktører, professor Georg Sverdrup, professor Ludvig Stoud Platou og tollprokurør +Christopher Omsen. At de ikke ble reprodusert i de følgende Ã¥r, hadde sammenheng med den +svenske holdningen. Forhandlingene pÃ¥ det ekstraordinære Storting ble utgitt bÃ¥de i 1815 og +igjen i 1835, men Carl Johan oppfattet lenge interessen for Riksforsamlingen og 17. mai- +Grunnloven som en indirekte underkjenning av unionsverket og kongens politiske autoritet. +Etter pÃ¥trykk fra ham prøvde norske myndigheter Ã¥ sette en stopper for offentlig feiring av +17. mai helt frem til midten av 1830-Ã¥rene. + </fo:block> + <fo:block> +Rimeligvis ble da forholdet til Danmark snarere enn forholdet til Sverige ett av de første +alvorlige stridsspørsmÃ¥l i perioden. Presten og Eidsvollsmannen Nicolai Wergeland ble +beryktet for den danskfiendtlige og unionsvennlige posisjon han inntok i boken +<fo:inline font-style="italic">En sandfærdig Beretning om Danmarks politiske Forbrydelser imod Kongeriget Norge +</fo:inline> (anonymt, 1816) som +fulgte nasjonalhistorien helt opp til Kielfreden. Skriftet vakte debatt og kraftige +reaksjoner ikke minst blant det gamle selvstendighetsparti. Blant annet publiserte Christian +Magnus Falsen to motskrifter i 1817. Falsen prøvde ogsÃ¥ Ã¥ popularisere Grunnlovens innhold +for den mindre "oplyste" borgerklasse og allmue gjennom skriftet +<fo:inline font-style="italic">Norges Grundlov gjennemgaaet i Spørgs-maal og Svar +</fo:inline> (1818, forkortet versjon 1825). Men det mÃ¥ kunne pÃ¥stÃ¥s +at den mer detaljerte historien om grunnlovsverkets tilblivelse og første fase lenge ble +stÃ¥ende i noe av et halvmørke bÃ¥de for det alminnelige folk og for de nye generasjoner, og +at dette skyldtes den politiske situasjonen. Det var Nicolai Wergeland som leverte selve +pionerarbeidet blant de personlige kildesamlingene, +<fo:inline font-style="italic">Fortrolige Breve til en Ven, Skrevne fra +Eidsvold i Aaret 1814</fo:inline> (anonymt, 1830). Men det var først da det unionspolitiske klimaet +mildnet etter 1837 at det ble Ã¥pnet for en grundigere historisk analyse av Grunnlovens +forhistorie og tilblivelse. + </fo:block> + </fo:block> + </fo:flow> <!-- closes the flow element--> + </fo:page-sequence> <!-- closes the page-sequence --> +</fo:root> diff --git a/examples/fo/basic/images.fo b/examples/fo/basic/images.fo new file mode 100644 index 000000000..1f5ec278a --- /dev/null +++ b/examples/fo/basic/images.fo @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root font-family="Times Roman" font-size="12pt" text-align="center" xmlns:fo="http://www.w3.org/1999/XSL/Format"> + +<fo:layout-master-set> +<fo:simple-page-master master-name="right" + margin-top="75pt" margin-bottom="25pt" margin-left="100pt" margin-right="50pt"> + <fo:region-body margin-bottom="50pt"/> + <fo:region-after extent="25pt"/> +</fo:simple-page-master> + +<fo:simple-page-master master-name="left" + margin-top="75pt" margin-bottom="25pt" margin-left="50pt" margin-right="100pt"> + <fo:region-body margin-bottom="50pt"/> + <fo:region-after extent="25pt"/> +</fo:simple-page-master> + +<fo:page-sequence-master master-name="psmOddEven" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="right" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="left" + odd-or-even="even" /> + <fo:conditional-page-master-reference master-reference="right" + odd-or-even="odd" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + +</fo:layout-master-set> + +<fo:page-sequence id="N2528" master-reference="psmOddEven"> + +<fo:static-content flow-name="xsl-region-after"> + <fo:block text-align-last="center" font-size="10pt"> + <fo:page-number/> + </fo:block> +</fo:static-content> + +<fo:flow flow-name="xsl-region-body"> +<fo:block font-size="18pt" font-weight="bold">1. FOP test for images</fo:block> +<fo:block id="N2531"> + <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A GIF image in FOP</fo:block> + <fo:block> + <fo:external-graphic src="file:../graphics/xml_feather.gif"/> + </fo:block> +</fo:block> +<fo:block id="N2535"> + <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A transparent GIF image in FOP</fo:block> + <fo:block> + <fo:external-graphic src="file:../graphics/xml_feather_transparent.gif"/> + </fo:block> +</fo:block> +<fo:block id="N2545"> + <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A JPEG image in FOP</fo:block> + <fo:block> + <fo:external-graphic src="file:../graphics/fop.jpg"/> + </fo:block> +</fo:block> +<fo:block id="N2550"> + <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A BMP image in FOP</fo:block> + <fo:block> + <fo:external-graphic src="file:../graphics/linux.bmp"/> + </fo:block> +</fo:block> +<fo:block id="N2559"> + <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em"/> + This section is only required to show that the layout still works. +</fo:block> +</fo:flow> +</fo:page-sequence> + +<fo:page-sequence id="N2561" master-reference="psmOddEven"> +<fo:static-content flow-name="xsl-region-after"> +<fo:block text-align-last="center" font-size="10pt"> +<fo:page-number/></fo:block> +</fo:static-content> +<fo:flow flow-name="xsl-region-body"> +<fo:block font-size="18pt" font-weight="bold">A. Appendix</fo:block></fo:flow> +</fo:page-sequence> +</fo:root> + diff --git a/examples/fo/basic/inhprop.fo b/examples/fo/basic/inhprop.fo new file mode 100644 index 000000000..766c3b694 --- /dev/null +++ b/examples/fo/basic/inhprop.fo @@ -0,0 +1,175 @@ +<?xml version="1.0" encoding="utf-8"?> + + +<!-- example for a simple fo file. At the beginning the page layout is set. +Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations, +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions --> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + - page-sequence-masters: have the role of describing the sequence + of page-masters that will be used to generate + pages during the formatting of an fo:page-sequence + + --> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.0cm + 0.5cm" + margin-right="(5cm * 1cm) div 2cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + <!-- layout for the other pages --> + <fo:simple-page-master master-name="rest" + page-height="abs(-30cm + .3cm)" + page-width="(10cm * 2) + 1cm" + margin-top="round(.5) * 1cm" + margin-bottom="round(2.4) * 1cm" + margin-left="2.5 * 1cm" + margin-right="5.5cm - 3cm"> + <fo:region-body margin-top="2.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + +<fo:page-sequence-master master-name="basicPSM" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="basicPSM"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="10pt" + font-family="serif" + line-height="1em + 4pt" > + Property Function Tests - p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines text title level 1--> + <fo:block font-size="min(18pt,20pt)" + font-family="sans-serif" + line-height="max(24pt,18pt)" + space-after.optimum="5 mod 3 * 7.5pt" + background-color="rgb(0,0,255)" + color="rgb(255,255,255)" + text-align="center" + padding-top="3pt"> + Property Function Tests + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="floor(16.3) * 1pt" + font-family="sans-serif" + line-height="2pt * ceiling(9.3)" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + keep-with-next.within-page="always" + keep-together.within-page="always" + padding-top="3pt"> + Function: object from-parent( <fo:inline font-weight='bold'>NCName</fo:inline>) + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-after="3pt" + keep-together="auto" + text-align="start"> +The from-parent function returns a computed value of the property +whose name matches the argument specified. The value returned is that +for the parent of the formatting object for which the expression is +evaluated. If there is no parent, the value returned is the initial +value. If the argument specifies a shorthand property and if the +expression only consists of the from-parent function with an argument +matching the property being computed, it is interpreted as an +expansion of the shorthand with each property into which the shorthand +expands, each having a value of from-parent with an argument matching +the property. It is an error if arguments matching a shorthand +property are used in any other way. + <fo:block font-size="from-parent(font-size) - 2pt" + font-family="sans-serif" + space-before="from-parent(space-after)" + text-align="center"> + Here is a nested block with font-size = +from-parent(font-size) - 2pt. +Since its parent has font-size=12pt, that should mean 10pt. It should +keep the line height of 1.25em, which means 12.5pt leading. It's +space-before value is set to the space-after value from its +parent. Note that neither of these are inheritable. Does it look right? + </fo:block> + <fo:block font-size="from-parent(font-size) + 2pt" + space-before="2pt" + space-after="from-parent(space-after)" + font-family="sans-serif" + start-indent="from-parent(start-indent) + 1cm" + end-indent="from-parent(end-indent) + 1cm" + text-align="end" + background-color="black" color="rgb(50%,50%,50%)"> +Here is a nested block with text 2pt larger than its parent (that +should be 14pt). This parent is indented 1cm on both start and end +directions with respect to the values from its parent (which aren't +specified, so they default to 0.0). The color is set to 50% (using the +rgb function with % arguements, and the background color for this +block is black (specified as a keyword). In this block, we'll put an +<fo:inline color='inherited-property-value(background-color)' +background-color='inherited-property-value(color)'>inline object</fo:inline> +whose background and foreground colors invert those of its containing +block. This uses the <fo:inline +font-style='oblique'>inherited-property-value</fo:inline> +function. Here's an <fo:inline color='black' background-color='white'>inline +object</fo:inline> with fixed colors (black on white). That doesn't +work either. Guess it's not my problem... So let's try it with font +sizes. In this block, we'll put an +<fo:inline font-size='inherited-property-value(font-size)+2pt'>inline +object whose font-size is 2 pt bigger than its parent's font-size.</fo:inline></fo:block> + </fo:block> + <fo:block font-size="12pt" + space-before="6pt" + line-height="1em + 2pt" + font-family="sans-serif" + text-align="start" + background-color="rgb(50%,50%,50%)"> + An outer block with 12 pt text on 14 pt leading, default color +and 50% grey background color. Test inherited color changes with +nested blocks. + <fo:block color='from-parent(background-color)' + background-color='from-parent(color)'> + Interchange color and background color using from-parent function. + </fo:block> + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/instream.fo b/examples/fo/basic/instream.fo new file mode 100644 index 000000000..20a740109 --- /dev/null +++ b/examples/fo/basic/instream.fo @@ -0,0 +1,114 @@ +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> +<fo:layout-master-set> + <fo:simple-page-master master-name="one"> + <fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="50pt" margin-right="50pt" /> + </fo:simple-page-master> +</fo:layout-master-set> +<fo:page-sequence master-reference="one"> +<fo:flow flow-name="xsl-region-body"> + <fo:block>This is used to show how foreign objects are placed in a line area.</fo:block> + <fo:block> + Some block text to separate instream objects. + </fo:block> + <fo:block> + Some text before +<fo:instream-foreign-object> +<svg:svg width="20" height="20"> + <svg:g style="fill:red; stroke:#000000"> + <svg:rect x="0" y="0" width="15" height="15"/> + <svg:rect x="5" y="5" width="15" height="15"/> + </svg:g> +</svg:svg> +</fo:instream-foreign-object> + and some after the svg element. + </fo:block> + <fo:block> + A text line below the instream object. + </fo:block> + <fo:block> +<fo:instream-foreign-object> +<svg:svg width="250" height="50"> + <svg:g style="fill:red; stroke:#000000"> + <svg:rect x="0" y="0" width="15" height="15"/> + <svg:rect x="5" y="5" width="15" height="15"/> + </svg:g> + <svg:text style="font-family:Helvetica;fill:blue" x="10" y="30">SVG placed in a block</svg:text> +</svg:svg> +</fo:instream-foreign-object> + </fo:block> + <fo:block> + A text line below the block. + </fo:block> + <fo:block> + A text line with an instream foreign object that is before the line break. +<fo:instream-foreign-object> +<svg:svg width="50" height="50"> + <svg:g style="fill:red; stroke:#000000"> + <svg:rect x="0" y="0" width="15" height="15"/> + <svg:rect x="5" y="5" width="15" height="15"/> + </svg:g> + <svg:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/> +</svg:svg> +</fo:instream-foreign-object> +With some text on the next line. With a bit more text to go over the to the next line. + </fo:block> + <fo:block> + A text line with an instream foreign object that is after the line break. +With some text on the next line. With a bit +<fo:instream-foreign-object> +<svg:svg width="50" height="50"> + <svg:g style="fill:red; stroke:#000000"> + <svg:rect x="0" y="0" width="15" height="15"/> + <svg:rect x="5" y="5" width="15" height="15"/> + </svg:g> + <svg:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/> +</svg:svg> +</fo:instream-foreign-object> +more text to go over the to the next line. + </fo:block> + <fo:block> + A text line with an instream foreign object that is over the line break. +With some text +<fo:instream-foreign-object> +<svg:svg width="50" height="50"> + <svg:g style="fill:red; stroke:#000000"> + <svg:rect x="0" y="0" width="15" height="15"/> + <svg:rect x="5" y="5" width="15" height="15"/> + </svg:g> + <svg:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/> +</svg:svg> +</fo:instream-foreign-object> +on the next line. With a bit more text to go over the to the next line to +see it handles it properly. + </fo:block> + <fo:block> + The next block has an instream object wider than the area. + </fo:block> + <fo:block> +<fo:instream-foreign-object> +<svg:svg width="550" height="50"> + <svg:g style="fill:red; stroke:#000000"> + <svg:rect x="0" y="0" width="15" height="15"/> + <svg:rect x="5" y="5" width="15" height="15"/> + </svg:g> + <svg:rect style="fill:none;stroke:black" x="0" y="0" width="549" height="49"/> + <svg:text x="10" y="30">SVG placed in a really wide block</svg:text> +</svg:svg> +</fo:instream-foreign-object> + </fo:block> + <fo:block> + This block has an instream object wider than the area after this text +<fo:instream-foreign-object> +<svg:svg width="550" height="50"> + <svg:g style="fill:red; stroke:#000000"> + <svg:rect x="0" y="0" width="15" height="15"/> + <svg:rect x="5" y="5" width="15" height="15"/> + </svg:g> + <svg:rect style="fill:none;stroke:black" x="0" y="0" width="549" height="49"/> + <svg:text style="font-family:Helvetica" x="10" y="30">SVG placed in a really wide block</svg:text> +</svg:svg> +</fo:instream-foreign-object> + </fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/leader.fo b/examples/fo/basic/leader.fo new file mode 100644 index 000000000..cc378b31a --- /dev/null +++ b/examples/fo/basic/leader.fo @@ -0,0 +1,786 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- examples for the use of the fo leader --> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + + <!-- page layout --> + <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> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="first"> + + + <fo:flow flow-name="xsl-region-body"> + + <!-- Normal text --> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="blue" + color="white" + > + Leader examples + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + fo:leader is mainly used a) in table-of-contents to generate sequences of "." glyphs that separate titles from page numbers + b) to create entry fields in fill-in-the-blank forms c) to create horizontal rules for use as separators. You + define the look and use of fo:leader with the property "leader-pattern". It can have the following values: a) space. This + just creates an space. b) dots. This creates a sequence of "." c) rule. This creates a line. d) use-content. This creates a + repeating pattern of the content of fo:leader. + </fo:block> + + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + The dimensions of fo:leader are determined by the compound property leader-length. It consists of the + 3 sub values: leader-length.minimum (default = 0), leader-length.optimum (default = 12pt), leader-length.maximum + (default = 100%). If you want to make sure, that leader-length has a fixed size, you should use the compound + property (p.e. leader-length="5cm"). If you want to fill the rest of the remaining space with dots in a table of + content, you can use the default values. + </fo:block> + + <fo:block font-size="14pt" + font-family="sans-serif" + line-height="17pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start" + background-color="blue" + color="white"> + leader with leader-pattern="space" + </fo:block> + + <!-- Inserts a leader (space) --> + <fo:block text-align="start">Entry 1 + <fo:leader leader-pattern="space" + leader-length="6cm"/>p. 12 + </fo:block> + + <!-- Inserts a leader (space) --> + <fo:block text-align="start">Entry 2 + <fo:leader leader-pattern="space" + leader-length="6cm"/>p. 24 + </fo:block> + + <!-- Inserts a leader (space) --> + <fo:block text-align="start">Left side + <fo:leader leader-pattern="space" + leader-length="5.5cm"/>middle + <fo:leader leader-pattern="space" + leader-length="5.5cm"/>right side + </fo:block> + + + <fo:block font-size="14pt" + font-family="sans-serif" + line-height="17pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start" + background-color="blue" + color="white" + > + Using fo:leader with leader-pattern="dots" + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + There are two properties which allow you to specify the looks of the dotted line. First + "leader-pattern-width". It specifies the length of one dot and the space up to the next dot. + Second leader-alignment. It can be used to make sure, the dots in different lines are parallel (only value "reference-area" + is supported). + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 1 + <fo:leader leader-pattern="dots" + leader-length="6cm"/>p. 12 + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 2 + <fo:leader leader-pattern="dots" + leader-length="6cm"/>p. 24 + </fo:block> + + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + Using fo:leader with leader-pattern="dots" and leader-pattern-width="5pt" and "8pt" + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 1 + <fo:leader leader-pattern="dots" + leader-pattern-width="5pt" + leader-length="6cm"/>p. 12 + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 2 + <fo:leader leader-pattern="dots" + leader-pattern-width="5pt" + leader-length="6cm"/>p. 24 + </fo:block> + + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 1 + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm"/>p. 12 + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 2 + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm"/>p. 24 + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + Using fo:leader with leader-pattern="dots" in a list + </fo:block> + + <fo:block text-align="start" + space-before.optimum="12pt" + space-after.optimum="12pt"> + Using fo:leader with leader-pattern="dots", leader-pattern-width="5pt" and "8pt", leader-alignment="reference-area" + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 1 + <fo:leader leader-pattern="dots" + leader-pattern-width="5pt" + leader-alignment="reference-area" + leader-length="6cm"/>p. 12 + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 2 + <fo:leader leader-pattern="dots" + leader-pattern-width="5pt" + leader-alignment="reference-area" + leader-length="6cm"/>p. 24 + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 3 is longer + <fo:leader leader-pattern="dots" + leader-pattern-width="5pt" + leader-alignment="reference-area" + leader-length="6cm"/>p. 36 + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 4 is even longer + <fo:leader leader-pattern="dots" + leader-alignment="reference-area" + leader-pattern-width="5pt" + leader-length="6cm"/>p. 48 + </fo:block> + + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">1 + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm" + leader-alignment="reference-area"/>p. 12 + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 2 + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm" + leader-alignment="reference-area"/>p. 24 + </fo:block> + + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 3 is longer + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm" + leader-alignment="reference-area"/>p. 36 + </fo:block> + + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 4 is even longer + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm" + leader-alignment="reference-area"/>p. 48 + </fo:block> + + + + + <!-- list start --> + <!-- use provisional-distance-between-starts to define + the distance between the start of the label and the item text + + use provisional-label-separation to define the distance between + the end of the item label and the start of item text + --> + <fo:list-block provisional-distance-between-starts="0.3cm" + provisional-label-separation="0.15cm"> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-size="10pt" font-family="Symbol">·</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 1 + <fo:leader leader-pattern="dots" + leader-pattern-width="5pt" + leader-length="6cm"/>p. 12 + </fo:block> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-size="10pt" font-family="Symbol">·</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <!-- Inserts a leader (dots) --> + <fo:block text-align="start">Entry 2 + <fo:leader leader-pattern="dots" + leader-pattern-width="5pt" + leader-length="6cm"/>p. 24 + </fo:block> + </fo:block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + <!-- list end --> + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + Using fo:leader with leader-pattern="dots" in a table + </fo:block> + + + <!-- table start --> + <fo:table> + <fo:table-column column-width="20mm"/> + <fo:table-column column-width="60mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell ><fo:block>Entry 1</fo:block></fo:table-cell> + <fo:table-cell > + <fo:block text-align="start"> + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm"/> + </fo:block> + </fo:table-cell> + <fo:table-cell ><fo:block>p. 12</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>Entry 2 </fo:block></fo:table-cell> + <fo:table-cell > + <fo:block text-align="start"> + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm"/> + </fo:block> + </fo:table-cell> + <fo:table-cell ><fo:block>p. 24</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>Entry 3 </fo:block></fo:table-cell> + <fo:table-cell > + <fo:block text-align="start"> + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="6cm"/> + </fo:block> + </fo:table-cell> + <fo:table-cell ><fo:block>p. 36</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table end --> + + + + <fo:block text-align="center" + font-size="15pt" + space-before.optimum="16pt" + space-after.optimum="12pt"> + Table of Content + </fo:block> + + <fo:block text-align="start" + font-size="10pt" + space-after.optimum="12pt"> + shows the use of leader properties in combination to build a table of content. + Following values are used for the leader: + leader-pattern="dots" + leader-pattern-width="8pt" + leader-alignment="reference-area" + no leader-length is specified, so the default values are used (min: 0, opt: 12pt, max: 100%) + </fo:block> + + + <!-- Here starts the table --> + <fo:table> + <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:block font-size="14pt" + font-family="sans-serif" + line-height="17pt" + space-before.optimum="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="blue" + color="white" + > + Leader with leader-pattern="rule" + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="start">text before the rule (start) + <fo:leader leader-pattern="rule" + rule-thickness="3.0pt" + leader-length="6cm" + space-before.optimum="12pt" + space-after.optimum="12pt" + start-indent="1.5cm" + end-indent="2cm" + background-color="blue" + color="yellow"/> + text after the rule + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center">text before the rule (center) + <fo:leader leader-pattern="rule" + rule-thickness="3.0pt" + leader-length="6cm" + space-before.optimum="12pt" + space-after.optimum="12pt" + start-indent="1.5cm" + end-indent="2cm" + background-color="blue" + color="yellow"/> + text after the rule + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="end">text before the rule (end) + <fo:leader leader-pattern="rule" + rule-thickness="3.0pt" + leader-length="6cm" + space-before.optimum="12pt" + space-after.optimum="12pt" + start-indent="1.5cm" + end-indent="2cm" + background-color="blue" + color="yellow"/> + text after the rule + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + Here are some fo:leader with the property rule and different rule styles + (solid, dashed, dotted, double, groove, ridge the last one with colored backgrounds + to the effect) + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="1pt" + leader-length="6cm"/> + </fo:block> + + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + + <fo:leader leader-pattern="rule" + leader-length="6cm" + rule-thickness="1pt" + rule-style="dashed"/> + </fo:block> + + + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + leader-length="6cm" + rule-style="dotted" + rule-thickness="1pt"/> + </fo:block> + + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + leader-length="6cm" + rule-thickness="2pt" + rule-style="double"/> + </fo:block> + + <fo:block text-align="center" background-color="silver" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + leader-length="6cm" + rule-thickness="1pt" + rule-style="groove" + color="black" /> + </fo:block> + + <fo:block text-align="center" background-color="silver" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + leader-length="6cm" + rule-thickness="1pt" + rule-style="ridge" + color="black" /> + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + Here are 4 fo:leader with increasing rule-thickness (1pt, 2pt, 3pt, 4pt) + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="1.0pt" + leader-length="6cm"/> + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="2.0pt" + leader-length="6cm"/> + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="3.0pt" + leader-length="6cm"/> + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="4.0pt" + leader-length="6cm"/> + </fo:block> + + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-before.optimum="5pt" + space-after.optimum="3pt" + text-align="start"> + Here are 4 fo:leader with increasing rule-thickness (1pt, 2pt, 3pt, 4pt) and leader-length: 25%, 50%, 75%, 100% + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="1.0pt" + leader-length="25%"/> + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="2.0pt" + leader-length="50%"/> + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="3.0pt" + leader-length="75%"/> + </fo:block> + + <!-- Inserts a leader (rule). Because leader is an inline fo you have + to wrap it into a block element --> + <fo:block text-align="center" + space-before.optimum="12pt" + space-after.optimum="12pt"> + <fo:leader leader-pattern="rule" + rule-thickness="4.0pt" + leader-length="100%"/> + </fo:block> + + + <fo:block text-align="center" + font-size="15pt" + space-before.optimum="16pt" + space-after.optimum="12pt"> + Using leader in combination with justified text + </fo:block> + + + <fo:block text-align="justify">Here is some longer text. Here is some longer text. + Here is some longer text. Here comes the leader (dots width 8pt): + <fo:leader leader-pattern="dots" + leader-pattern-width="8pt" + leader-length="5cm"/>Here is some longer text. Here is some longer text. + Here is some longer text. Here is some longer text. Here is some longer text. + </fo:block> + + <fo:block text-align="justify">Here is some longer text. Here is some longer text. + Here is some longer text. Here comes the leader (dots width 5pt): + <fo:leader leader-pattern="dots" + leader-pattern-width="5pt" + leader-length="5cm"/>Here is some longer text. Here is some longer text. + Here is some longer text. Here is some longer text. Here is some longer text. + </fo:block> + + <fo:block text-align="justify">Here is some longer text. Here is some longer text. + Here is some longer text. Here comes the leader (dots): + <fo:leader leader-pattern="dots" + leader-length="5cm"/>Here is some longer text. Here is some longer text. + Here is some longer text. Here is some longer text. Here is some longer text. + </fo:block> + + + <fo:block text-align="justify">Here is some longer text. Here is some longer text. + Here is some longer text. Here comes the leader (rule): + <fo:leader leader-pattern="rule" + leader-length="5cm"/>Here is some longer text. Here is some longer text. + Here is some longer text. Here is some longer text. Here is some longer text. + </fo:block> + + <fo:block text-align="justify">Here is some longer text. Here is some longer text. + Here is some longer text. Here comes the leader (space): + <fo:leader leader-pattern="space" + leader-length="5cm"/>Here is some longer text. Here is some longer text. + Here is some longer text. Here is some longer text. Here is some longer text. + </fo:block> + + <fo:block space-before.optimum="15pt" font-weight="bold" font-size="14pt"> + Use-Content + </fo:block> + + <fo:block space-before.optimum="8pt" font-size="12pt"> + The following examples show Leader with "use-content". + The inline areas from the context of the leader are + repeated until the lenght of the leader. The + "leader-pattern-width" can be used to set the width + of each repeated pattern element. <fo:inline font-style="italic"> + If this width is less than the inline areas then the width + of the inline areas is used.</fo:inline> + </fo:block> + + <fo:block space-before.optimum="5pt" text-align="start">Characters: + <fo:leader leader-pattern="use-content">abcd</fo:leader> + </fo:block> + + <fo:block space-before.optimum="5pt" text-align="start">Set width: + <fo:leader leader-pattern="use-content" + leader-pattern-width="50pt">abcd</fo:leader> + </fo:block> + + <fo:block space-before.optimum="5pt" text-align="start">Small Width: + <fo:leader leader-pattern="use-content" + leader-pattern-width="2pt">abcd</fo:leader> + </fo:block> + + <fo:block space-before.optimum="5pt" text-align="start">SVG: + <fo:leader leader-pattern="use-content"> +<fo:instream-foreign-object> +<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"> +<rect x="0" y="0" width="5" height="5" style="fill:red"/> +<rect x="5" y="5" width="5" height="5" style="fill:black"/> +</svg> +</fo:instream-foreign-object> + </fo:leader> + </fo:block> + + <fo:block space-before.optimum="5pt" text-align="start">Mixed: + <fo:leader leader-pattern="use-content"> +abc +<fo:instream-foreign-object> +<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"> +<rect x="0" y="0" width="5" height="5" style="fill:red"/> +<rect x="5" y="5" width="5" height="5" style="fill:black"/> +</svg> +</fo:instream-foreign-object> + </fo:leader> + </fo:block> + + <fo:block space-before.optimum="5pt" text-align="start">Mixed: + <fo:leader leader-pattern="use-content"> +abc +<fo:instream-foreign-object> +<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"> +<rect x="0" y="0" width="5" height="5" style="fill:red"/> +<rect x="5" y="5" width="5" height="5" style="fill:black"/> +</svg> +</fo:instream-foreign-object> +def + </fo:leader> + </fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/link.fo b/examples/fo/basic/link.fo new file mode 100644 index 000000000..805d258f4 --- /dev/null +++ b/examples/fo/basic/link.fo @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + <fo:simple-page-master master-name="first" + page-height="29.7cm" page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="first"> + + <!-- text body --> + <fo:flow flow-name="xsl-region-body"> + + <!-- Normal text --> + <fo:block text-align="center">0. Normal text without link + </fo:block> + + + <!-- Normal text --> + <fo:block text-align="center" + font-family="serif">1. <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block text-align="center">---</fo:block> + + <!-- Normal text --> + <fo:block text-align="center"> + 2. A one line example (text-align='start'): <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block text-align="center">---</fo:block> + + <!-- Normal text --> + <fo:block text-align="start" hyphenate="true" language="en"> + 3. A multiline text (text-align='start'). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block text-align="center">---</fo:block> + + <!-- Normal text --> + <fo:block text-align="center"> + 4. A multiline text (text-align='centered'). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block text-align="center">---</fo:block> + + <!-- Normal text --> + <fo:block text-align="end"> + 5. A multiline text (text-align='end'). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block text-align="center">---</fo:block> + + <!-- Normal text --> + <fo:block text-align="justify" hyphenate="true" language="en"> + 6. A multiline text (text-align='justify'). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block text-align="center">---</fo:block> + + <!-- Normal text --> + <fo:block text-align="start" + space-before.optimum="6pt" + line-height="24pt" + font-family="serif" + padding-top="3pt" + > + 7. A multiline text (text-align='start', space-before.optimum=6pt, font-family=serif padding-top="3pt"). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable <fo:basic-link external-destination="normal.pdf">generic</fo:basic-link> SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block text-align="start" + space-before.optimum="6pt" + line-height="24pt" + font-family="serif" + padding-top="3pt" + > + 8. A multiline text (text-align='start', space-before.optimum=6pt, font-family=serif, padding-top="3pt"). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable <fo:basic-link external-destination="normal.pdf">generic</fo:basic-link> SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block text-align="start" + space-before.optimum="6pt" + line-height="24pt" + font-family="serif" + padding-top="3pt" + > + 9. Linking to a specific page of an external: + <fo:basic-link external-destination="extensive.pdf#page=1">extensive.pdf, Page 2</fo:basic-link>. + </fo:block> + + <!-- Normal text --> +<!-- <fo:block text-align="start" + space-before.optimum="6pt" + line-height="24pt" + font-family="serif" + padding-top="3pt" + > + 8. A multiline text (text-align='start', space-before.optimum=6pt, font-family=serif, padding-top="3pt"). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable <fo:basic-link external-destination="normal.pdf">generic</fo:basic-link> SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> +--> + + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/list.fo b/examples/fo/basic/list.fo new file mode 100644 index 000000000..b9e1035f1 --- /dev/null +++ b/examples/fo/basic/list.fo @@ -0,0 +1,2690 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- example for use of list elements + At the beginning the page layout is set. + Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions + +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + In this case there is only a simple-page-master which defines the + layout for all pages of the text + --> + <!-- layout information --> + <fo:simple-page-master master-name="simple" + page-height="29.7cm" + page-width="21cm" + margin-top="2cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="0cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + + <!-- start page-sequence + here comes the text (contained in flow objects) + the page-sequence can contain different fo:flows + the attribute value of master-name refers to the page layout + which is to be used to layout the text contained in this + page-sequence--> + <fo:page-sequence master-reference="simple"> + + <!-- start fo:flow + each flow is targeted + at one (and only one) of the following: + xsl-region-body (usually: normal text) + xsl-region-before (usually: header) + xsl-region-after (usually: footer) + xsl-region-start (usually: left margin) + xsl-region-end (usually: right margin) + ['usually' applies here to languages with left-right and top-down + writing direction like English] + in this case there is only one target: xsl-region-body + --> + <fo:flow flow-name="xsl-region-body"> + + <!-- each paragraph is encapsulated in a block element + the attributes of the block define + font-family and size, line-heigth etc. --> + + <!-- this defines a title level 1--> + <fo:block font-size="18pt" + font-family="sans-serif" + line-height="24pt" + space-after.optimum="15pt" + background-color="blue" + color="white" + text-align="center" + padding-top="3pt"> + How to use list elements + </fo:block> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center"> + A simple list with bullets in list-item-label + </fo:block> + + + <!-- list --> + <fo:list-block > + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + <!-- end list --> + + <!-- code --> + <fo:block font-size="10pt" + font-family="Courier" + line-height="10pt" + text-align="start" + space-before.optimum="3cm" + white-space-collapse="false" + linefeed-treatment="preserve" + white-space-treatment="preserve" + wrap-option="no-wrap"> +<![CDATA[<!-- list start --> +<fo:list-block> + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block> + <fo:inline font-family="Symbol">·</fo:inline> + </fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + [other list items...] + + +</fo:list-block> +<!-- end list --> +]]> + +</fo:block> + + <!-- code ends --> + + +<!-- ***************************** Next page ************************ --> + + + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + Doing it better + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + space-before.optimum="15pt"> + The distance between the bullets and the list text in the example on the + previous page is too large. You can define this distance and some more. Here is + an overview how to specify what aspects of a list + </fo:block> + + <!-- the following image is taken from the w3c xsl working draft 18 October 2000 + authors: Sharon Adler, Anders Berglund, Jeff Caruso, Stephen Deach + Paul Grosso, Eduardo Gutentag, Alex Milowski, Scott Parnell, + Jeremy Richman, Steve Zilles + url: http://www.w3.org/TR/xsl/ --> + <fo:block text-align="center" + space-before.optimum="0.5cm"> + <fo:external-graphic src="file:../graphics/listgeometry.gif"/> + </fo:block> + <fo:block font-size="10pt" + font-family="sans-serif" + text-align="center" + space-after.optimum="15pt"> + image from the w3c xsl working draft 18.10.2000 (full info in list2.fo) + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + space-before.optimum="15pt"> + This is the same list with a defined provisional-distance-between-starts (0.3cm) and + provisional-label-separation (0.15cm). + </fo:block> + + <!-- list start --> + <!-- use provisional-distance-between-starts to define + the distance between the start of the label and the item text + + use provisional-label-separation to define the distance between + the end of the item label and the start of item text + --> + <fo:list-block provisional-distance-between-starts="0.3cm" + provisional-label-separation="0.15cm"> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-size="10pt" font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-size="10pt" font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-size="10pt" font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + <!-- end list --> + + <!-- code --> + <fo:block font-size="10pt" + font-family="Courier" + line-height="10pt" + text-align="start" + space-before.optimum="0.7cm" + white-space-collapse="false" + white-space-treatment="preserve" + linefeed-treatment="preserve" + wrap-option="no-wrap"> +<![CDATA[<!-- list start --> +<fo:list-block provisional-distance-between-starts="0.3cm" + provisional-label-separation="0.15cm"> + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block> + <fo:inline font-family="Symbol">·</fo:inline> + </fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + [other list items...] + +</fo:list-block> +<!-- end list --> +]]> +</fo:block> + + <!-- code ends --> + +<!-- ***************************** Next page ************************ --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + A simple list with text before and after + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + text-align="start" + > + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + </fo:block> + + <!-- list --> + <fo:list-block provisional-distance-between-starts="0.3cm" + provisional-label-separation="0.15cm"> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + <!-- end list --> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + > + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + </fo:block> + <!-- normal text ends --> + +<!-- ***************************** Next page ************************ --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + A list with longer text + </fo:block> + + <!-- list --> + <fo:list-block provisional-distance-between-starts="0.3cm" + provisional-label-separation="0.15cm"> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + <!-- end list --> + +<!-- ***************************** Next page ************************ --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + A simple list with long labels + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + text-align="start" + > + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + </fo:block> + + <!-- list --> + <fo:list-block provisional-distance-between-starts="2.0cm" + provisional-label-separation="0.2cm"> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">label 1)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">lab. 2)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">lab. 3)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">lab. 4)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">lab. 5)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + <!-- end list --> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + > + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + </fo:block> + <!-- normal text ends --> + + +<!-- ***************************** Next page ************************ --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-after.optimum="15pt" + text-align="center" + padding-top="3pt" + break-before="page"> + A long list + </fo:block> + + <!-- list --> + <fo:list-block provisional-distance-between-starts="0.3cm" + provisional-label-separation="0.15cm"> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + <!-- end list --> + + +<!-- ***************************** Next page ************************ --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + A nested list with justified text + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + text-align="justify" + > + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + </fo:block> + + <!-- list level 1 --> + <fo:list-block provisional-distance-between-starts="0.4cm" + provisional-label-separation="0.15cm"> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify">here comes a nested list with numbers + + <!-- start nested list --> + <!-- list level 1 --> + <fo:list-block provisional-distance-between-starts="0.7cm" + provisional-label-separation="0.15cm"> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">1.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">2.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">3.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">4.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">5.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block > + <!-- end nested list --> + + <!-- continuing list--> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + <!-- end list --> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="justify" + > + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + </fo:block> + <!-- normal text ends --> + +<!-- ****************************** Next Page ************************* --> + + <!-- code --> + <fo:block font-size="10pt" + font-family="Courier" + line-height="10pt" + text-align="start" + space-before.optimum="3cm" + white-space-collapse="false" + white-space-treatment="preserve" + linefeed-treatment="preserve" + wrap-option="no-wrap"> +<![CDATA[<!-- list level 1 --> +<fo:list-block provisional-distance-between-starts="0.4cm" + provisional-label-separation="0.15cm"> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify">here comes a nested list with numbers + + <!-- start nested list --> + <!-- list level 1 --> + <fo:list-block provisional-distance-between-starts="0.7cm" + provisional-label-separation="0.15cm"> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">1.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item </fo:block> + </fo:list-item-body> + </fo:list-item> + + [more item in nested list ...] + + </fo:list-block> + <!-- end nested list --> + + <!-- continuing list--> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + [more item in list ...] + +</fo:list-block> +<!-- end list --> + +]]> +</fo:block> +<!-- ***************************** Next page ************************ --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page" + white-space-collapse="true"> + A long nested list + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + text-align="justify" + > + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + </fo:block> + + <!-- list level 1 --> + <fo:list-block provisional-distance-between-starts="0.4cm" + provisional-label-separation="0.15cm"> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify">here comes a nested list with numbers + + <!-- start nested list --> + <!-- list level 1 --> + <fo:list-block provisional-distance-between-starts="0.9cm" + provisional-label-separation="0.15cm"> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">1.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">2.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">3.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">4.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">5.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">6.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">7.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">8.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">9.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">10.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">11.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">12.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">13.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">14.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">15.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">16.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- nested list item --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a number --> + <fo:list-item-label end-indent="label-end()"> + <fo:block text-align="end">17.)</fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + nested list item with more text. nested list item with more text. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block > + <!-- end nested list --> + + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <!-- list entry --> + <fo:list-item start-indent="0.5cm"> + <!-- insert a bullet --> + <fo:list-item-label end-indent="label-end()"> + <fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> + </fo:list-item-label> + <!-- list text --> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align="justify"> + here is text in the list item body. here is text in the list item body. + here is text in the list item body. here is text in the list item body. + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + <!-- end list --> + + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="justify" + > + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + This is normal text. This is normal text. This is normal text. This is normal text. This is normal text. + </fo:block> + <!-- normal text ends --> + + + + + </fo:flow> <!-- closes the flow element--> + </fo:page-sequence> <!-- closes the page-sequence --> +</fo:root> diff --git a/examples/fo/basic/newlinktest.fo b/examples/fo/basic/newlinktest.fo new file mode 100644 index 000000000..6fa0588d5 --- /dev/null +++ b/examples/fo/basic/newlinktest.fo @@ -0,0 +1,148 @@ +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + margin-top="1in" + margin-bottom="1in" + margin-left="1in" + margin-right="1in"> + <fo:region-body margin-top="2.5cm" margin-bottom="1.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="first"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="8pt" + font-family="serif" + line-height="14pt" > + <fo:basic-link external-destination="http://xml.apache.org/fop" + color="rgb(150,150,150)" font-style="italic"> + http://xml.apache.org/fop + </fo:basic-link> + </fo:block> + </fo:static-content> + + +<fo:flow flow-name="xsl-region-body"> + + <fo:block space-after.optimum="3pt" font-family="serif" id="block1"> + FOP is the world's first print formatter driven by XSL formatting + objects. It is a Java 1.1 application that reads a formatting object + tree and then turns it into a PDF document. The formatting object + tree, can be in the form of an XML document (output by an XSLT engine + like XT or Xalan) or can be passed in memory as a DOM Document or (in + the case of XT) SAX events. + </fo:block> + + <fo:block space-after.optimum="12pt" font-family="serif">FOP is part of Apache's XML project. The homepage of FOP is + <fo:inline font-style="italic" font-family="serif"><fo:basic-link color="blue" external-destination="http://xml.apache.org/fop">http://xml.apache.org/fop</fo:basic-link></fo:inline> + </fo:block> + +<fo:block space-after.optimum="12pt" font-family="serif" font-weight="bold" text-align="center"> +align="start" +</fo:block> + +<fo:block space-after.optimum="12pt" font-family="serif" text-align="start"> + Apache FOP is the world's first print formatter driven by XSL formatting + objects. It is a Java 1.1 application that reads a <fo:basic-link internal-destination="block1" color="blue">formatting object</fo:basic-link> + tree and then turns it into a <fo:basic-link internal-destination="block1" color="blue">PDF document</fo:basic-link>. The formatting object + tree, can be in the form of an XML <fo:basic-link internal-destination="block1" color="blue">document</fo:basic-link> (output by an XSLT engine + like XT or Xalan) or can be passed in memory as a DOM Document or (in + the case of XT) SAX events. + + </fo:block> + +<fo:block space-after.optimum="12pt" font-family="serif" font-weight="bold" text-align="center"> +align="center" +</fo:block> + +<fo:block space-after.optimum="12pt" font-family="serif" text-align="center"> + Apache FOP is the world's first print formatter driven by XSL formatting + objects. It is a Java 1.1 application that reads a <fo:basic-link internal-destination="block1" color="blue">formatting object</fo:basic-link> + tree and then turns it into a <fo:basic-link internal-destination="block1" color="blue">PDF document</fo:basic-link>. The formatting object + tree, can be in the form of an XML <fo:basic-link internal-destination="block1" color="blue">document</fo:basic-link> (output by an XSLT engine + like XT or Xalan) or can be passed in memory as a DOM Document or (in + the case of XT) SAX events. + + </fo:block> + +<fo:block space-after.optimum="12pt" font-family="serif" font-weight="bold" text-align="center"> +align="justify" +</fo:block> + + <fo:block space-after.optimum="12pt" font-family="serif" text-align="justify"> + Apache FOP is the world's first print formatter driven by XSL formatting + objects. It is a Java 1.1 application that reads a <fo:basic-link internal-destination="block1" color="blue">formatting object</fo:basic-link> + tree and then turns it into a <fo:basic-link internal-destination="block1" color="blue">PDF document</fo:basic-link>. The formatting object + tree, can be in the form of an XML <fo:basic-link internal-destination="block1" color="blue">document</fo:basic-link> (output by an XSLT engine + like XT or Xalan) or can be passed in memory as a DOM Document or (in + the case of XT) SAX events. + + </fo:block> + +<!-- table start --> + <fo:table> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell ><fo:block>good</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>bad</fo:block></fo:table-cell> + <fo:table-cell ><fo:block><fo:basic-link internal-destination="block1" color="blue">ugly</fo:basic-link></fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>nice</fo:block></fo:table-cell> + <fo:table-cell ><fo:block><fo:basic-link internal-destination="block1" color="blue">dice</fo:basic-link></fo:block></fo:table-cell> + <fo:table-cell ><fo:block>vice</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>literature</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>music</fo:block></fo:table-cell> + <fo:table-cell ><fo:block><fo:basic-link internal-destination="block1" color="blue">art</fo:basic-link></fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block><fo:basic-link internal-destination="block1" color="blue">java</fo:basic-link></fo:block></fo:table-cell> + <fo:table-cell ><fo:block>perl</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>python</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table end --> + + <fo:block break-before="page" space-after.optimum="12pt" font-family="serif" text-align="start" font-weight="bold"> + Links in different orientations + </fo:block> + + <fo:block> + This block container has a different reference orientation. + <fo:block-container reference-orientation="90" inline-progression-dimension="150pt"> + <fo:block> + A link applies to the inline parent area that is created + by the basic-link. This inline area has a trait specifying + the link. + </fo:block> + <fo:block> + <fo:basic-link external-destination="http://xml.apache.org/fop" + color="blue" text-decoration="underline"> + http://xml.apache.org/fop + </fo:basic-link> + </fo:block> + </fo:block-container> + </fo:block> + + +</fo:flow> + +</fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/normal.fo b/examples/fo/basic/normal.fo new file mode 100644 index 000000000..6576e70a0 --- /dev/null +++ b/examples/fo/basic/normal.fo @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8"?> + + +<!-- example for a simple fo file. At the beginning the page layout is set. +Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations, +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions --> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + - page-sequence-masters: have the role of describing the sequence + of page-masters that will be used to generate + pages during the formatting of an fo:page-sequence + + --> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="21cm" + page-width="29.7cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + <!-- layout for the other pages --> + <fo:simple-page-master master-name="rest" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + +<fo:page-sequence-master master-name="basicPSM" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="basicPSM"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="10pt" + font-family="serif" + line-height="14pt" > + XML Recommendation - p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines text title level 1--> + <fo:block font-size="18pt" + font-family="sans-serif" + line-height="24pt" + space-after.optimum="15pt" + background-color="blue" + color="white" + text-align="center" + padding-top="3pt" + font-variant="small-caps"> + Extensible Markup Language (XML) 1.0 + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="3pt"> + Abstract + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + The <fo:inline font-variant="small-caps">Extensible Markup Language (XML)</fo:inline> is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="3pt"> + Status of this document + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document specifies a syntax created by subsetting an existing, widely used international text processing standard + (Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It + is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. A list of current W3C + Recommendations and other technical documents can be found at http://www.w3.org/TR. + </fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/normalex.fo b/examples/fo/basic/normalex.fo new file mode 100644 index 000000000..9f063ee34 --- /dev/null +++ b/examples/fo/basic/normalex.fo @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8"?> + + +<!-- example for a simple fo file. At the beginning the page layout is set. +Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations, +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions --> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + - page-sequence-masters: have the role of describing the sequence + of page-masters that will be used to generate + pages during the formatting of an fo:page-sequence + + --> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="21cm" + page-width="29.7cm" + margin-top="6.3cm - 3.8cm - 1.5cm" + margin-bottom="3cm - (.25cm * 4)" + margin-left="2.0cm + 0.5cm" + margin-right="(5cm * 1cm) div 2cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="1cm + 3cm - 1cm"/> + <fo:region-after extent="2 * .5cm + .5cm"/> + </fo:simple-page-master> + + <!-- layout for the other pages --> + <fo:simple-page-master master-name="rest" + page-height="abs(-30cm + .3cm)" + page-width="(10cm * 2) + 1cm" + margin-top="round(.5) * 1cm" + margin-bottom="round(2.4) * 1cm" + margin-left="2.5 * 1cm" + margin-right="5.5cm - 3cm"> + <fo:region-body margin-top="2.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + +<fo:page-sequence-master master-name="basicPSM" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="basicPSM"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="10pt" + font-family="serif" + line-height="1em + 4pt" > + XML Recommendation - p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines text title level 1--> + <fo:block font-size="min(18pt,20pt)" + font-family="sans-serif" + line-height="max(24pt,18pt)" + space-after.optimum="5 mod 3 * 7.5pt" + background-color="rgb(0,0,255)" + color="rgb(100%,100%,100%)" + text-align="center" + padding-top="3pt"> + Extensible Markup Language (XML) 1.0 + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="floor(16.3) * 1pt" + font-family="sans-serif" + line-height="2pt * ceiling(9.3)" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="3pt"> + Abstract + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="2 * (.5em + 1.5pt)" + space-after.optimum=".25 * 1em" + text-align="start"> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="1.25" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="3pt"> + Status of this document + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="1.25em" + space-after.optimum="1pc div 4" + text-align="start"> + This document specifies a syntax created by subsetting an existing, widely used international text processing standard + (Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It + is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. A list of current W3C + Recommendations and other technical documents can be found at http://www.w3.org/TR. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/pdfoutline.fo b/examples/fo/basic/pdfoutline.fo new file mode 100644 index 000000000..027a87bd5 --- /dev/null +++ b/examples/fo/basic/pdfoutline.fo @@ -0,0 +1,1413 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +THIS IS NOT THE LATEST VERSION OF THE FOP DOCUMENTATION BUT ONLY AN EXAMPLE FILE + +This files shows next to the trivial usage of fo:block and fo:inline examples of +- fo:basic-link external-destination +- fo:basic-link internal-destination +- fo:table +- fo:list-block (including a bullet from the font Symbol as list-item-label) +- fo:page-number-citation (computes dynamically the page number in section 'content') +--> + +<!-- note the extensions namespace (fox) --> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:fox="http://xml.apache.org/fop/extensions"> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + <!-- layout for the other pages --> + <fo:simple-page-master master-name="rest" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + +<fo:page-sequence-master master-name="basicPSM" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + +<!-- beginning of the PDF outline extensions --> + <fox:bookmarks> + + <fox:outline internal-destination="sec1"> + <fox:label>What is FOP?</fox:label> + </fox:outline> + + <fox:outline internal-destination="sec2"> + <fox:label>Downloading FOP</fox:label> + </fox:outline> + + <fox:outline internal-destination="sec3"> + <fox:label>Running FOP</fox:label> + + <fox:outline internal-destination="sec3-1"> + <fox:label>Prerequisites</fox:label> + + <fox:outline internal-destination="sec3-1-1"> + <fox:label>Java 1.1</fox:label> + </fox:outline> + + <fox:outline internal-destination="sec3-1-2"> + <fox:label>XML Parser</fox:label> + </fox:outline> + + <fox:outline internal-destination="sec3-1-3"> + <fox:label>XSLT Processor</fox:label> + </fox:outline> + + </fox:outline> + + <fox:outline internal-destination="sec3-2"> + <fox:label>Starting FOP</fox:label> + </fox:outline> + + </fox:outline> + + <fox:outline internal-destination="sec4"> + <fox:label>Embedding FOP</fox:label> + </fox:outline> + + <fox:outline internal-destination="sec5"> + <fox:label>What's Implemented?</fox:label> + </fox:outline> + <fox:outline internal-destination="sec6"> + <fox:label>Limitations</fox:label> + </fox:outline> + <fox:outline internal-destination="sec7"> + <fox:label>Bugs</fox:label> + </fox:outline> + <fox:outline internal-destination="sec8"> + <fox:label>Compiling FOP</fox:label> + </fox:outline> + <fox:outline internal-destination="sec9"> + <fox:label>Getting Involved</fox:label> + </fox:outline> + <fox:outline internal-destination="sec10"> + <fox:label>FOP Relevant Specifications</fox:label> + </fox:outline> + <fox:outline internal-destination="sec11"> + <fox:label>License</fox:label> + </fox:outline> + </fox:bookmarks> + + + + <!-- actual layout --> + <fo:page-sequence master-reference="basicPSM"> + + +<fo:static-content flow-name="xsl-region-before"> +<fo:block text-align="end" font-size="10pt" font-family="serif" line-height="14pt" color="red" > +This is not the latest Fop documentation, but just an fo example. FOP - p. <fo:page-number/> +</fo:block> +</fo:static-content> + + +<fo:flow flow-name="xsl-region-body"> + +<fo:block id="secA" font-size="18pt" font-family="sans-serif" line-height="24pt" space-after.optimum="15pt" background-color="blue" color="white" text-align="center" padding-top="3pt">FOP: An Open-Source XSL Formatter and Renderer</fo:block> + + + +<fo:block id="sec1" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >A) + What is FOP?</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">FOP is the world's first print formatter driven by XSL formatting + objects. It is a Java 1.1 application that reads a formatting object + tree and then turns it into a PDF document. The formatting object + tree, can be in the form of an XML document (output by an XSLT engine + like XT or Xalan) or can be passed in memory as a DOM Document or (in + the case of XT) SAX events. + + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">FOP is part of Apache's XML project. The homepage of FOP is + <fo:inline font-style="italic" font-family="serif"><fo:basic-link color="blue" external-destination="http://xml.apache.org/fop">http://xml.apache.org/fop</fo:basic-link></fo:inline> + </fo:block> + + + + + <fo:block id="sec2" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >B) + Downloading FOP</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">The latest release version is <fo:inline font-style="italic" font-family="serif">FOP +0.14</fo:inline> <fo:inline font-family="serif"> + () + </fo:inline>. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">NOTE: you do not have to unjar or unzip this jar file.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Documentation can be downloaded here as <fo:inline font-style="italic" font-family="serif">HMTL file</fo:inline> +<fo:inline font-family="serif"> + () + </fo:inline> or + as <fo:inline font-style="italic" font-family="serif">PDF file</fo:inline> +<fo:inline font-family="serif"> + () + </fo:inline>.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">To run FOP from the command line, see Running FOP. If you are interested in + embedding FOP in a Java application of your own, see Embedding FOP. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">You can also download the <fo:inline font-style="italic" font-family="serif">source code v. 0.14</fo:inline> +<fo:inline font-family="serif"> + () + </fo:inline> as jar file</fo:block> + + + + <fo:block id="sec3" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >C) + Running FOP</fo:block> + + <fo:block id="sec3-1" font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Prerequisites</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Following software must be installed:</fo:block> + <fo:block id="sec3-1-1" space-after.optimum="3pt" font-family="serif">a) Java 1.1.x or later</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">For the fo-file viewer mode of FOP (see below) you must have the swing classes installed. + From Java 1.2 on (aka Java 2) they are part of the standard java distribution. + If you use Java 1.1.x you must seperately include the swing classes, which can + be found at the <fo:inline font-style="italic" font-family="serif"> + Sun website</fo:inline> +<fo:inline font-family="serif"> + (http://java.sun.com/products/jfc/#download-swing) + </fo:inline>. + </fo:block> + <fo:block id="sec3-1-2" space-after.optimum="3pt" font-family="serif">b) An XML parser which supports SAX and DOM like + <fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline> +<fo:inline font-family="serif"> + (http://xml.apache.org/xerces-j/index.html) + </fo:inline>.</fo:block> + <fo:block id="sec3-1-3" space-after.optimum="3pt" font-family="serif">c) If you have to produce the flow objects files, which are the input for FOP, + you need a transformation utility to create this files from your xml files. + Normally this is an XSLT stylesheet processor like + <fo:inline font-style="italic" font-family="serif">XT</fo:inline> +<fo:inline font-family="serif"> + (http://www.jclark.com/xml/xt.html) + </fo:inline> + or <fo:inline font-style="italic" font-family="serif">XALAN</fo:inline> +<fo:inline font-family="serif"> + (http://xml.apache.org/xalan/index.html) + </fo:inline>. + </fo:block> + + + <fo:block id="sec3-2" font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Starting FOP as an standalone application</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">There are three ways to run FOP from the command line.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">a) Batch processing formatting objects (fo) files: </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">b) Batch processing xml files (includes production of the fo-files):</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine xml-file xsl-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">c) Previewing the fo-file:</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.AWTCommandLine fo-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Each method uses next to the fop classes other packages. The following describes + each method in detail.</fo:block> + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >a) Method One</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">One is to first use an XSLT engine to produce the formatting object tree as an + XML document and then running the class org.apache.fop.apps.CommandLine with the + formatting object file name and PDF filename as arguments. You will need to include + FOP and your XML Parser in your classpath and so you might invoke + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -cp fop_x_xx_x.jar;xerces.jar</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">If your SAX Parser is other than Xerces, you will need to set the property + org.xml.sax.parser to the SAX Parser class to use. The following example shows + the command line, if you use XP, the XML parser from James Clark: + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -Dorg.xml.sax.parser=com.jclark.xml.sax.Driver</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">-cp fop_x_xx_x.jar;sax.jar;xt.jar;xp.jar;xerces.jar</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.AWTCommandLine formatting-tree-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">(You have to include xerces.jar or another xml parser which supports DOM in your classpath.) </fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >b) Method Two</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Rather than performing transformation with an XSLT before invoking FOP, it is + possible, if you use XT as your XSLT engine, to just call FOP and have it call + XT for you. To do this, run the class org.apache.fop.apps.CommandLine with the + source XML file name, XSL file name and PDF file name as arguments. You will + need to include FOP, SAX, your SAX Parser and XT in your classpath and so you might + invoke + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -Dorg.xml.sax.parser=com.jclark.xml.sax.Driver</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">-cp fop_x_xx_x.jar;xt.jar;xerces.jar</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.CommandLine xml-file xsl-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Again, if your SAX Parser is other than Xerces, you will need to set the property + org.xml.sax.parser to the SAX Parser class to use. + </fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >c) Method Three</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">If you already produced the FO file, you can preview the results of your + transformation without using any pdf viewer by invoking FOP with the viewer + application. You will need to include FOP and your XML Parser in your classpath + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -cp fop_x_xx_x.jar;xerces.jar</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.AWTCommandLine fo-file </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">The viewer uses the swing classes.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Note: If you are using java 2 or later (i.e. jdk 1.2. or later) you can put all + needed jar files into the subdirectory jdk1.2.x\jre\lib\ext (windows example). Then + FOP can be started without classpath: + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> + + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >3) Running FOP on MacOS</fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">Ensure that you have a recent MRJ, and that you have downloaded and + unpacked the XP and SAX distributions. The xp.jar and sax.jar files work + as is on MacOS. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Drag the FOP jarfile onto the JBindery icon. When the first dialog + appears, type "org.apache.fop.apps.CommandLine" in the "Class name" field. + Using UNIX syntax, type the names of the input formatting-object file and + the output PDF in the "Optional parameters" field. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Click on the Classpath icon. To add the xp.jar and sax.jar files, click + the "Add .zip file" button, navigate to the file in question, and click + Open. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Once both are added (the FOP jarfile will already be in the list), click + Run. A "stdout" window will appear and display FOP runtime messages. + </fo:block> + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >4) Problems</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">If you have problems running FOP, please have a look at the + <fo:inline font-style="italic" font-family="serif">FOP FAQ</fo:inline> +<fo:inline font-family="serif"> + (faq.html) + </fo:inline>. If you don't find a solution there, + you can ask for help on the list fop-dev@xml.apache.org. Maybe it's bug and + maybe somebody is already working on it. + </fo:block> + + + + + <fo:block id="sec4" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >D) + Embedding FOP </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Instantiate org.apache.fop.apps.Driver. Once this class is + instantiated, methods are called to set the + Renderer to use, the (possibly multiple) ElementMapping(s) to + use and the PrintWriter to use to output the results of the + rendering (where applicable). In the case of the Renderer and + ElementMapping(s), the Driver may be supplied either with the + object itself, or the name of the class, in which case Driver will + instantiate the class itself. The advantage of the latter is it + enables runtime determination of Renderer and ElementMapping(s). + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Once the Driver is set up, the buildFOTree method + is called. Depending on whether DOM or SAX is being used, the + invocation of the method is either buildFOTree(Document) or + buildFOTree(Parser, InputSource) respectively. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">A third possibility may be used to build the FO Tree, namely + calling getDocumentHandler() and firing the SAX events yourself. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Once the FO Tree is built, the format() and render() methods may be + called in that order. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Here is an example use of Driver from CommandLine.java:</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">Driver driver = new Driver();</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version);</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.setWriter(new PrintWriter(new FileWriter(args[1])));</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.buildFOTree(parser, fileInputSource(args[0]));</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.format();</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.render();</fo:block> + + + + + + + <fo:block id="sec5" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >E) + What's Implemented?</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Also see STATUS for what is being worked on.</fo:block> + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Formatting Objects</fo:block> + <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif"> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>root </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>layout-master-set </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>simple-page-master </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>region-body </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>region-before </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>region-after </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-sequence </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>sequence-specification </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>sequence-specifier-single </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>sequence-specifier-repeating </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>sequence-specifier-alternating </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>flow </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>static-content </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>block </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>list-block </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>list-item </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>list-item-label </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>list-item-body </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-number </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>display-sequence </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>inline </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>display-rule </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>display-graphic </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table-column (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table-body (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table-row (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table-cell (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + </fo:list-block> + + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Properties</fo:block> + <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif"> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>end-indent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-name </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-first </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-repeating </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-odd </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-even </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>margin-top (only on pages and regions)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>margin-bottom (only on pages and regions)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>margin-left (only on pages and regions)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>margin-right (only on pages and regions)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>extent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-width </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-height </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>flow-name </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>font-family </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>font-style </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>font-weight </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>font-size </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>line-height </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>text-align </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>text-align-last </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>space-before.optimum </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>space-after.optimum </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>start-indent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>end-indent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>provisional-distance-between-starts </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>provisional-label-separation </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>rule-thickness </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>color </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>wrap-option </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>white-space-treatment </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>break-before </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>break-after </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>text-indent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>href</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>column-width</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>background-color</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>padding-top (only in conjunction with background color)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>padding-left (only in conjunction with background color)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>padding-bottom (only in conjunction with background color)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>padding-right (only in conjunction with background color)</fo:block> +</fo:list-item-body> +</fo:list-item> + </fo:list-block> + + + + + + + <fo:block id="sec6" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >F) + Limitations</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Although FOP implements the above listed fo objects and properties, sometimes it does so + only in a limited way. + </fo:block> + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >list-block</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">The fo working draft allows describes two ways to markup lists.The list-block must have as + children either: 1) pairs of fo:list-item-label and fo:list-item-body formatting objects, or + 2) fo:list-item formatting objects.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">At the moment FOP only implements the second way. Therefore a list has a basic structure like this:</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item-label><fo:block></fo:block></fo:list-item-label></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item-body><fo:block></fo:block></fo:list-item-body></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:list-item></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:list-block></fo:block> + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Padding</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Padding works in conjunction with indents and spaces. It is only implemented + for blocks. At the moment padding can't be used to make extra space (indents+spaces + must be used), but only to control how much the background-color extends beyond + the content rectangle. + </fo:block> + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Tables</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">There two limitations for tables: 1) FOP needs you to explicitly specify column widths + 2) Cells have to contain block-level FOs. They can't contain straight character data. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">A working basic example of a table looks like this: </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:table></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-column column-width="150pt"/></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-column column-width="150pt"/></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-body font-size="10pt" font-family="sans-serif"></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-body></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:table></fo:block> + + + + + + + + + + + + <fo:block id="sec7" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >G) + Bugs</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">see STATUS file</fo:block> + + + + + + + <fo:block id="sec8" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >H) + Compiling FOP</fo:block> + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1. Prerequisites</fo:block> + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >a) Java 1.1.x or later</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">If you use Java 1.1.x you must also seperately include the swing classes, which can + be found at the <fo:inline font-style="italic" font-family="serif"> + Sun website</fo:inline> +<fo:inline font-family="serif"> + (http://java.sun.com/products/jfc/#download-swing) + </fo:inline>. From Java 1.2 on (aka Java 2) they are part of the standard + distribution. + </fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >b) An XML parser</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">An XML parser which supports DOM like + <fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline> +<fo:inline font-family="serif"> + (http://xml.apache.org/xerces-j/index.html) + </fo:inline>.</fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >c) XT from James Clark</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Some of the Java source code in FOP is generated from XML using + XSLT. XT must be used to generate this code.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">XT is an XSL stylesheet processor written in java. At the moment you + can't use any other processor, because the make file makes use of some + proprietary features of Clark's xt which allow to write output in more + then one document. You can find XT at <fo:inline font-style="italic" font-family="serif"> + James Clark's website</fo:inline> +<fo:inline font-family="serif"> + (http://www.jclark.com/xml/xt.html) + </fo:inline>. You have to use XT version 19991105 or later.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">(Under windows you shouldn't use the prepackaged xt.exe but also the + generic jar file, otherwise make won't work) + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">XT relies on an sax parser like XP (also J. Clark), which can be + downloaded at <fo:inline font-style="italic" font-family="serif">James + Clark's Website</fo:inline> +<fo:inline font-family="serif"> + (http://www.jclark.com/xml/xp/index.html) + </fo:inline> + </fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >d) make</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Under windows it has been reported that the use of the cygnus solutions port + of the GNU utilities works. You can find it at + <fo:inline font-style="italic" font-family="serif">Cygnus Solutions</fo:inline> +<fo:inline font-family="serif"> + (http://sourceware.cygnus.com/cygwin/) + </fo:inline> + </fo:block> + + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Compiling FOP on MacOS</fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">We strongly recommend the use of Codewarrior Java. This Readme will + contain a link to more information in the near future. + </fo:block> + + + + + + + + <fo:block id="sec9" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >I) + Getting involved</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">1. Subscribe to fop-dev@xml.apache.org by sending an email + to fop-dev-subscribe@xml.apache.org</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">2. Read the archives to fop-dev to get an idea of the issues being + discussed. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">3. Subscribe to fop-cvs@xml.apache.org by sending an email to + fop-cvs-subscribe@xml.apache.org (it is important + that you follow changes being made). </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">4. Try :-) to wrap your head around the XSL working draft. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">5. Get CVS working on your system. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">6. Ask, on fop-dev, any questions you have at all about the code, design, etc. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">7. When you feel comfortable modifying the code, send diffs to + fop-dev with your contributions. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">8. Have fun!</fo:block> + + + + + + + <fo:block id="sec10" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >J) + FOP Relevant Specifications</fo:block> + <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif"> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">XML Recommendation</fo:inline> +<fo:inline font-family="serif" > + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">XSL-FO Working Draft</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/WD-xsl/">http://www.w3.org/TR/WD-xsl/</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">XSLT Recommendation</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">PDF Documentation</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf">http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">Simple API for XML (SAX)</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.megginson.com/SAX/">http://www.megginson.com/SAX/</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">Document Object Model (DOM)</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-DOM-Level-1">http://www.w3.org/TR/REC-DOM-Level-1</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">Namespaces in XML Recommendation</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">Java JDK 1.1 Documentation</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://java.sun.com/products/jdk/1.1/docs/index.html">http://java.sun.com/products/jdk/1.1/docs/index.html</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + </fo:list-block> + + + + + + + <fo:block id="sec11" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >K) + Licence</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> ============================================================================</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> The Apache Software License, Version 1.1</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> ============================================================================</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> Copyright (C) 1999 The Apache Software Foundation. All rights reserved.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met:</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: "This product includes software + developed by the Apache Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if + and wherever such third-party acknowledgments normally appear. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">4. The names "FOP" and "Apache Software Foundation" must not be used to + endorse or promote products derived from this software without prior + written permission. For written permission, please contact + apache@apache.org. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">5. Products derived from this software may not be called "Apache", nor may + "Apache" appear in their name, without prior written permission of the + Apache Software Foundation. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif"> + This software consists of voluntary contributions made by many individuals + on behalf of the Apache Software Foundation and was originally created by + James Tauber <jtauber@jtauber.com>. For more information on the Apache + Software Foundation, please see <fo:inline font-style="italic" font-family="serif">http://www.apache.org/</fo:inline> +<fo:inline font-family="serif"> + (http://www.apache.org/) + </fo:inline>. + </fo:block> + +<fo:block font-size="14pt" font-family="sans-serif" line-height="10pt" space-after.optimum="15pt" font-weight="bold" start-indent="15pt" break-before="page"> + Content + </fo:block> +<fo:table> +<fo:table-column column-width="1cm"/> +<fo:table-column column-width="12cm"/> +<fo:table-column column-width="1cm"/> +<fo:table-body font-size="10pt" 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"><fo:basic-link color="blue" internal-destination="sec1">What is FOP?</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec1"/></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"><fo:basic-link color="blue" internal-destination="sec2">Downloading FOP</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec2"/></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"><fo:basic-link color="blue" internal-destination="sec3">Running FOP</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec3"/></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"><fo:basic-link color="blue" internal-destination="sec4">Embedding FOP</fo:basic-link> </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec4"/></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"><fo:basic-link color="blue" internal-destination="sec5">What's Implemented?</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec5"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">F) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec6">Limitations</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec6"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">G) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec7">Bugs</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec7"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">H) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec8">Compiling FOP</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec8"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">I) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec9">Getting involved</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec9"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">J) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec10">FOP Relevant Specifications</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec10"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">K) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec11">Licence</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec11"/></fo:block> +</fo:table-cell> +</fo:table-row> +</fo:table-body> +</fo:table> + + + +</fo:flow> +</fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/readme.fo b/examples/fo/basic/readme.fo new file mode 100644 index 000000000..fd9e58c61 --- /dev/null +++ b/examples/fo/basic/readme.fo @@ -0,0 +1,1341 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +THIS IS NOT THE LATEST VERSION OF THE FOP DOCUMENTATION BUT ONLY AN EXAMPLE FILE + +This files shows next to the trivial usage of fo:block and fo:inline examples of +- fo:basic-link external-destination +- fo:basic-link internal-destination +- fo:table +- fo:list-block (including a bullet from the font Symbol as list-item-label) +- fo:page-number-citation (computes dynamically the page number in section 'content') +--> + + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + <!-- layout for the other pages --> + <fo:simple-page-master master-name="rest" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + +<fo:page-sequence-master master-name="basicPSM" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="basicPSM"> + + +<fo:static-content flow-name="xsl-region-before"> +<fo:block text-align="end" font-size="10pt" font-family="serif" line-height="14pt" color="red" > +This is not the latest Fop documentation, but just an fo example. FOP - p. <fo:page-number/> +</fo:block> +</fo:static-content> + + +<fo:flow flow-name="xsl-region-body"> +<fo:block font-size="18pt" font-family="sans-serif" line-height="24pt" space-after.optimum="15pt" background-color="blue" color="white" text-align="center" padding-top="3pt">FOP: An Open-Source XSL Formatter and Renderer</fo:block> +<fo:block id="sec1" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >A) + What is FOP?</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">FOP is the world's first print formatter driven by XSL formatting + objects. It is a Java 1.1 application that reads a formatting object + tree and then turns it into a PDF document. The formatting object + tree, can be in the form of an XML document (output by an XSLT engine + like XT or Xalan) or can be passed in memory as a DOM Document or (in + the case of XT) SAX events. + + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">FOP is part of Apache's XML project. The homepage of FOP is + <fo:inline font-style="italic" font-family="serif"><fo:basic-link color="blue" external-destination="http://xml.apache.org/fop">http://xml.apache.org/fop</fo:basic-link></fo:inline> + </fo:block> + + + + <fo:block id="sec2" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >B) + Downloading FOP</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">The latest release version is <fo:inline font-style="italic" font-family="serif">FOP +0.14</fo:inline> <fo:inline font-family="serif"> + () + </fo:inline>. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">NOTE: you do not have to unjar or unzip this jar file.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Documentation can be downloaded here as <fo:inline font-style="italic" font-family="serif">HMTL file</fo:inline> +<fo:inline font-family="serif"> + () + </fo:inline> or + as <fo:inline font-style="italic" font-family="serif">PDF file</fo:inline> +<fo:inline font-family="serif"> + () + </fo:inline>.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">To run FOP from the command line, see Running FOP. If you are interested in + embedding FOP in a Java application of your own, see Embedding FOP. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">You can also download the <fo:inline font-style="italic" font-family="serif">source code v. 0.14</fo:inline> +<fo:inline font-family="serif"> + () + </fo:inline> as jar file</fo:block> + + + + + + <fo:block id="sec3" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >C) + Running FOP</fo:block> + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Prerequisites</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Following software must be installed:</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">a) Java 1.1.x or later</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">For the fo-file viewer mode of FOP (see below) you must have the swing classes installed. + From Java 1.2 on (aka Java 2) they are part of the standard java distribution. + If you use Java 1.1.x you must seperately include the swing classes, which can + be found at the <fo:inline font-style="italic" font-family="serif"> + Sun website</fo:inline> +<fo:inline font-family="serif"> + (http://java.sun.com/products/jfc/#download-swing) + </fo:inline>. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">b) An XML parser which supports SAX and DOM like + <fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline> +<fo:inline font-family="serif"> + (http://xml.apache.org/xerces-j/index.html) + </fo:inline>.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">c) If you have to produce the flow objects files, which are the input for FOP, + you need a transformation utility to create this files from your xml files. + Normally this is an XSLT stylesheet processor like + <fo:inline font-style="italic" font-family="serif">XT</fo:inline> +<fo:inline font-family="serif"> + (http://www.jclark.com/xml/xt.html) + </fo:inline> + or <fo:inline font-style="italic" font-family="serif">XALAN</fo:inline> +<fo:inline font-family="serif"> + (http://xml.apache.org/xalan/index.html) + </fo:inline>. + </fo:block> + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Starting FOP as an standalone application</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">There are three ways to run FOP from the command line.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">a) Batch processing formatting objects (fo) files: </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">b) Batch processing xml files (includes production of the fo-files):</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine xml-file xsl-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">c) Previewing the fo-file:</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.AWTCommandLine fo-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Each method uses next to the fop classes other packages. The following describes + each method in detail.</fo:block> + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >a) Method One</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">One is to first use an XSLT engine to produce the formatting object tree as an + XML document and then running the class org.apache.fop.apps.CommandLine with the + formatting object file name and PDF filename as arguments. You will need to include + FOP and your XML Parser in your classpath and so you might invoke + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -cp fop_x_xx_x.jar;xerces.jar</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">If your SAX Parser is other than Xerces, you will need to set the property + org.xml.sax.parser to the SAX Parser class to use. The following example shows + the command line, if you use XP, the XML parser from James Clark: + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -Dorg.xml.sax.parser=com.jclark.xml.sax.Driver</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">-cp fop_x_xx_x.jar;sax.jar;xt.jar;xp.jar;xerces.jar</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.AWTCommandLine formatting-tree-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">(You have to include xerces.jar or another xml parser which supports DOM in your classpath.) </fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >b) Method Two</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Rather than performing transformation with an XSLT before invoking FOP, it is + possible, if you use XT as your XSLT engine, to just call FOP and have it call + XT for you. To do this, run the class org.apache.fop.apps.CommandLine with the + source XML file name, XSL file name and PDF file name as arguments. You will + need to include FOP, SAX, your SAX Parser and XT in your classpath and so you might + invoke + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -Dorg.xml.sax.parser=com.jclark.xml.sax.Driver</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">-cp fop_x_xx_x.jar;xt.jar;xerces.jar</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.CommandLine xml-file xsl-file pdf-file</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Again, if your SAX Parser is other than Xerces, you will need to set the property + org.xml.sax.parser to the SAX Parser class to use. + </fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >c) Method Three</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">If you already produced the FO file, you can preview the results of your + transformation without using any pdf viewer by invoking FOP with the viewer + application. You will need to include FOP and your XML Parser in your classpath + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -cp fop_x_xx_x.jar;xerces.jar</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.AWTCommandLine fo-file </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">The viewer uses the swing classes.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Note: If you are using java 2 or later (i.e. jdk 1.2. or later) you can put all + needed jar files into the subdirectory jdk1.2.x\jre\lib\ext (windows example). Then + FOP can be started without classpath: + </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> + + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >3) Running FOP on MacOS</fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">Ensure that you have a recent MRJ, and that you have downloaded and + unpacked the XP and SAX distributions. The xp.jar and sax.jar files work + as is on MacOS. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Drag the FOP jarfile onto the JBindery icon. When the first dialog + appears, type "org.apache.fop.apps.CommandLine" in the "Class name" field. + Using UNIX syntax, type the names of the input formatting-object file and + the output PDF in the "Optional parameters" field. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Click on the Classpath icon. To add the xp.jar and sax.jar files, click + the "Add .zip file" button, navigate to the file in question, and click + Open. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Once both are added (the FOP jarfile will already be in the list), click + Run. A "stdout" window will appear and display FOP runtime messages. + </fo:block> + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >4) Problems</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">If you have problems running FOP, please have a look at the + <fo:inline font-style="italic" font-family="serif">FOP FAQ</fo:inline> +<fo:inline font-family="serif"> + (faq.html) + </fo:inline>. If you don't find a solution there, + you can ask for help on the list fop-dev@xml.apache.org. Maybe it's bug and + maybe somebody is already working on it. + </fo:block> + + + + + <fo:block id="sec4" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >D) + Embedding FOP </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Instantiate org.apache.fop.apps.Driver. Once this class is + instantiated, methods are called to set the + Renderer to use, the (possibly multiple) ElementMapping(s) to + use and the PrintWriter to use to output the results of the + rendering (where applicable). In the case of the Renderer and + ElementMapping(s), the Driver may be supplied either with the + object itself, or the name of the class, in which case Driver will + instantiate the class itself. The advantage of the latter is it + enables runtime determination of Renderer and ElementMapping(s). + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Once the Driver is set up, the buildFOTree method + is called. Depending on whether DOM or SAX is being used, the + invocation of the method is either buildFOTree(Document) or + buildFOTree(Parser, InputSource) respectively. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">A third possibility may be used to build the FO Tree, namely + calling getDocumentHandler() and firing the SAX events yourself. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Once the FO Tree is built, the format() and render() methods may be + called in that order. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Here is an example use of Driver from CommandLine.java:</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">Driver driver = new Driver();</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version);</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.setWriter(new PrintWriter(new FileWriter(args[1])));</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.buildFOTree(parser, fileInputSource(args[0]));</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.format();</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.render();</fo:block> + + + + + + + <fo:block id="sec5" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >E) + What's Implemented?</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Also see STATUS for what is being worked on.</fo:block> + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Formatting Objects</fo:block> + <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif"> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>root </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>layout-master-set </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>simple-page-master </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>region-body </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>region-before </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>region-after </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-sequence </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>sequence-specification </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>sequence-specifier-single </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>sequence-specifier-repeating </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>sequence-specifier-alternating </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>flow </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>static-content </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>block </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>list-block </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>list-item </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>list-item-label </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>list-item-body </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-number </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>display-sequence </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>inline </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>display-rule </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>display-graphic </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table-column (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table-body (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table-row (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>table-cell (minimal support)</fo:block> +</fo:list-item-body> +</fo:list-item> + </fo:list-block> + + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Properties</fo:block> + <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif"> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>end-indent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-name </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-first </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-repeating </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-odd </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-master-even </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>margin-top (only on pages and regions)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>margin-bottom (only on pages and regions)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>margin-left (only on pages and regions)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>margin-right (only on pages and regions)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>extent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-width </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>page-height </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>flow-name </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>font-family </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>font-style </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>font-weight </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>font-size </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>line-height </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>text-align </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>text-align-last </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>space-before.optimum </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>space-after.optimum </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>start-indent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>end-indent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>provisional-distance-between-starts </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>provisional-label-separation </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>rule-thickness </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>color </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>wrap-option </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>white-space-treatment </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>break-before </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>break-after </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>text-indent </fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>href</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>column-width</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>background-color</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>padding-top (only in conjunction with background color)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>padding-left (only in conjunction with background color)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>padding-bottom (only in conjunction with background color)</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block>padding-right (only in conjunction with background color)</fo:block> +</fo:list-item-body> +</fo:list-item> + </fo:list-block> + + + + + + + <fo:block id="sec6" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >F) + Limitations</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Although FOP implements the above listed fo objects and properties, sometimes it does so + only in a limited way. + </fo:block> + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >list-block</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">The fo working draft allows describes two ways to markup lists.The list-block must have as + children either: 1) pairs of fo:list-item-label and fo:list-item-body formatting objects, or + 2) fo:list-item formatting objects.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">At the moment FOP only implements the second way. Therefore a list has a basic structure like this:</fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item-label><fo:block></fo:block></fo:list-item-label></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item-body><fo:block></fo:block></fo:list-item-body></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:list-item></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:list-block></fo:block> + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Padding</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Padding works in conjunction with indents and spaces. It is only implemented + for blocks. At the moment padding can't be used to make extra space (indents+spaces + must be used), but only to control how much the background-color extends beyond + the content rectangle. + </fo:block> + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Tables</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">There two limitations for tables: 1) FOP needs you to explicitly specify column widths + 2) Cells have to contain block-level FOs. They can't contain straight character data. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">A working basic example of a table looks like this: </fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:table></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-column column-width="150pt"/></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-column column-width="150pt"/></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-body font-size="10pt" font-family="sans-serif"></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-body></fo:block> + <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:table></fo:block> + + + + + + + + + + + + <fo:block id="sec7" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >G) + Bugs</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">see STATUS file</fo:block> + + + + + + + <fo:block id="sec8" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >H) + Compiling FOP</fo:block> + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1. Prerequisites</fo:block> + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >a) Java 1.1.x or later</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">If you use Java 1.1.x you must also seperately include the swing classes, which can + be found at the <fo:inline font-style="italic" font-family="serif"> + Sun website</fo:inline> +<fo:inline font-family="serif"> + (http://java.sun.com/products/jfc/#download-swing) + </fo:inline>. From Java 1.2 on (aka Java 2) they are part of the standard + distribution. + </fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >b) An XML parser</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">An XML parser which supports DOM like + <fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline> +<fo:inline font-family="serif"> + (http://xml.apache.org/xerces-j/index.html) + </fo:inline>.</fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >c) XT from James Clark</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Some of the Java source code in FOP is generated from XML using + XSLT. XT must be used to generate this code.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">XT is an XSL stylesheet processor written in java. At the moment you + can't use any other processor, because the make file makes use of some + proprietary features of Clark's xt which allow to write output in more + then one document. You can find XT at <fo:inline font-style="italic" font-family="serif"> + James Clark's website</fo:inline> +<fo:inline font-family="serif"> + (http://www.jclark.com/xml/xt.html) + </fo:inline>. You have to use XT version 19991105 or later.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">(Under windows you shouldn't use the prepackaged xt.exe but also the + generic jar file, otherwise make won't work) + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">XT relies on an sax parser like XP (also J. Clark), which can be + downloaded at <fo:inline font-style="italic" font-family="serif">James + Clark's Website</fo:inline> +<fo:inline font-family="serif"> + (http://www.jclark.com/xml/xp/index.html) + </fo:inline> + </fo:block> + + + <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >d) make</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">Under windows it has been reported that the use of the cygnus solutions port + of the GNU utilities works. You can find it at + <fo:inline font-style="italic" font-family="serif">Cygnus Solutions</fo:inline> +<fo:inline font-family="serif"> + (http://sourceware.cygnus.com/cygwin/) + </fo:inline> + </fo:block> + + + + <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Compiling FOP on MacOS</fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">We strongly recommend the use of Codewarrior Java. This Readme will + contain a link to more information in the near future. + </fo:block> + + + + + + + + <fo:block id="sec9" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >I) + Getting involved</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">1. Subscribe to fop-dev@xml.apache.org by sending an email + to fop-dev-subscribe@xml.apache.org</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">2. Read the archives to fop-dev to get an idea of the issues being + discussed. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">3. Subscribe to fop-cvs@xml.apache.org by sending an email to + fop-cvs-subscribe@xml.apache.org (it is important + that you follow changes being made). </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">4. Try :-) to wrap your head around the XSL working draft. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">5. Get CVS working on your system. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">6. Ask, on fop-dev, any questions you have at all about the code, design, etc. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">7. When you feel comfortable modifying the code, send diffs to + fop-dev with your contributions. </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">8. Have fun!</fo:block> + + + + + + + <fo:block id="sec10" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >J) + FOP Relevant Specifications</fo:block> + <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif"> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">XML Recommendation</fo:inline> +<fo:inline font-family="serif" > + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">XSL-FO Working Draft</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/WD-xsl/">http://www.w3.org/TR/WD-xsl/</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">XSLT Recommendation</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">PDF Documentation</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf">http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">Simple API for XML (SAX)</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.megginson.com/SAX/">http://www.megginson.com/SAX/</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">Document Object Model (DOM)</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-DOM-Level-1">http://www.w3.org/TR/REC-DOM-Level-1</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">Namespaces in XML Recommendation</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + <fo:list-item> +<fo:list-item-label end-indent="label-end()"> +<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> +</fo:list-item-label> +<fo:list-item-body start-indent="body-start()"> +<fo:block> +<fo:inline font-style="italic" font-family="serif">Java JDK 1.1 Documentation</fo:inline> +<fo:inline font-family="serif"> + (<fo:basic-link color="blue" external-destination="http://java.sun.com/products/jdk/1.1/docs/index.html">http://java.sun.com/products/jdk/1.1/docs/index.html</fo:basic-link>) + </fo:inline> +</fo:block> +</fo:list-item-body> +</fo:list-item> + </fo:list-block> + + + + + + + <fo:block id="sec11" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >K) + Licence</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> ============================================================================</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> The Apache Software License, Version 1.1</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> ============================================================================</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> Copyright (C) 1999 The Apache Software Foundation. All rights reserved.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif"> Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met:</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: "This product includes software + developed by the Apache Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if + and wherever such third-party acknowledgments normally appear. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">4. The names "FOP" and "Apache Software Foundation" must not be used to + endorse or promote products derived from this software without prior + written permission. For written permission, please contact + apache@apache.org. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif">5. Products derived from this software may not be called "Apache", nor may + "Apache" appear in their name, without prior written permission of the + Apache Software Foundation. + </fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + </fo:block> + + <fo:block space-after.optimum="3pt" font-family="serif"> + This software consists of voluntary contributions made by many individuals + on behalf of the Apache Software Foundation and was originally created by + James Tauber <jtauber@jtauber.com>. For more information on the Apache + Software Foundation, please see <fo:inline font-style="italic" font-family="serif">http://www.apache.org/</fo:inline> +<fo:inline font-family="serif"> + (http://www.apache.org/) + </fo:inline>. + </fo:block> + +<fo:block font-size="14pt" font-family="sans-serif" line-height="10pt" space-after.optimum="15pt" font-weight="bold" start-indent="15pt" break-before="page"> + Content + </fo:block> +<fo:table> +<fo:table-column column-width="1cm"/> +<fo:table-column column-width="12cm"/> +<fo:table-column column-width="1cm"/> +<fo:table-body font-size="10pt" 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"><fo:basic-link color="blue" internal-destination="sec1">What is FOP?</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec1"/></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"><fo:basic-link color="blue" internal-destination="sec2">Downloading FOP</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec2"/></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"><fo:basic-link color="blue" internal-destination="sec3">Running FOP</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec3"/></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"><fo:basic-link color="blue" internal-destination="sec4">Embedding FOP</fo:basic-link> </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec4"/></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"><fo:basic-link color="blue" internal-destination="sec5">What's Implemented?</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec5"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">F) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec6">Limitations</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec6"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">G) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec7">Bugs</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec7"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">H) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec8">Compiling FOP</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec8"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">I) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec9">Getting involved</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec9"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">J) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec10">FOP Relevant Specifications</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec10"/></fo:block> +</fo:table-cell> +</fo:table-row> +<fo:table-row line-height="12pt"> +<fo:table-cell> +<fo:block text-align="end">K) + </fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec11">Licence</fo:basic-link></fo:block> +</fo:table-cell> +<fo:table-cell> +<fo:block text-align="end"><fo:page-number-citation ref-id="sec11"/></fo:block> +</fo:table-cell> +</fo:table-row> +</fo:table-body> +</fo:table> + + + +</fo:flow> +</fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/simple.fo b/examples/fo/basic/simple.fo new file mode 100644 index 000000000..12cc43010 --- /dev/null +++ b/examples/fo/basic/simple.fo @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- example for a simple fo file. At the beginning the page layout is set. + Below fo:root there is always +- a single fo:layout-master-set which defines one or more page layouts +- an optional fo:declarations +- and a sequence of one or more fo:page-sequences containing the text and formatting instructions +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <!-- fo:layout-master-set defines in its children the page layout: + the pagination and layout specifications + - page-masters: have the role of describing the intended subdivisions + of a page and the geometry of these subdivisions + In this case there is only a simple-page-master which defines the + layout for all pages of the text + --> + <!-- layout information --> + <fo:simple-page-master master-name="simple" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + + <!-- start page-sequence + here comes the text (contained in flow objects) + the page-sequence can contain different fo:flows + the attribute value of master-name refers to the page layout + which is to be used to layout the text contained in this + page-sequence--> + <fo:page-sequence master-reference="simple"> + + <!-- start fo:flow + each flow is targeted + at one (and only one) of the following: + xsl-region-body (usually: normal text) + xsl-region-before (usually: header) + xsl-region-after (usually: footer) + xsl-region-start (usually: left margin) + xsl-region-end (usually: right margin) + ['usually' applies here to languages with left-right and top-down + writing direction like English] + in this case there is only one target: xsl-region-body + --> + <fo:flow flow-name="xsl-region-body"> + + <!-- each paragraph is encapsulated in a block element + the attributes of the block define + font-family and size, line-heigth etc. --> + + <!-- this defines a title --> + <fo:block font-size="18pt" + font-family="sans-serif" + line-height="24pt" + space-after.optimum="15pt" + background-color="blue" + color="white" + text-align="center" + padding-top="3pt"> + Extensible Markup Language (XML) 1.0 + </fo:block> + + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="justify"> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. + </fo:block> + + <!-- this defines normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="justify"> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. + </fo:block> + + </fo:flow> <!-- closes the flow element--> + </fo:page-sequence> <!-- closes the page-sequence --> +</fo:root> diff --git a/examples/fo/basic/table.fo b/examples/fo/basic/table.fo new file mode 100644 index 000000000..0f5d7cf1c --- /dev/null +++ b/examples/fo/basic/table.fo @@ -0,0 +1,504 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + + <!-- defines the layout master --> + <fo:layout-master-set> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <!-- starts actual layout --> + <fo:page-sequence master-reference="first"> + + <fo:flow flow-name="xsl-region-body"> + + <!-- this defines a title level 1--> + <fo:block font-size="18pt" + font-family="sans-serif" + line-height="24pt" + space-after.optimum="15pt" + background-color="blue" + color="white" + text-align="center" + padding-top="3pt"> + How to use table elements + </fo:block> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center"> + A simple table, 3 columns, 4 rows + </fo:block> + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + <!-- table start --> + <fo:table> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell ><fo:block>good</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>bad</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>ugly</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>nice</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>dice</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>vice</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>literature</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>music</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>art</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>java</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>perl</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>python</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table end --> + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + +<!-- **************************** NEW PAGE ************************************* --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + A table with borders + </fo:block> + + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + + <!-- table start --> + <fo:table border-width="0.5mm" border-style="solid" background-color="yellow"> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell ><fo:block>good</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>bad</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>ugly</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>nice</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>dice</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>vice</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>literature</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>music</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>art</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>java</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>perl</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>python</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table end --> + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + +<!-- **************************** NEW PAGE ************************************* --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + A table with thick borders + </fo:block> + + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + + <!-- table start --> + <fo:table border-width="3mm" border-style="solid" background-color="yellow"> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell ><fo:block>good</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>bad</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>ugly</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>nice</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>dice</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>vice</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>literature</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>music</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>art</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell ><fo:block>java</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>perl</fo:block></fo:table-cell> + <fo:table-cell ><fo:block>python</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table end --> + + <!-- normal text --> + <fo:block text-align="start" start-indent="-3mm">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + +<!-- **************************** NEW PAGE ************************************* --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + A table with borders around the cells + </fo:block> + + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + + <!-- table start --> + <fo:table border-collapse="separate"> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>good</fo:block></fo:table-cell> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>bad</fo:block></fo:table-cell> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>ugly</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>nice</fo:block></fo:table-cell> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>dice</fo:block></fo:table-cell> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>vice</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>literature</fo:block></fo:table-cell> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>music</fo:block></fo:table-cell> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>art</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>java</fo:block></fo:table-cell> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>perl</fo:block></fo:table-cell> + <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>python</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table end --> + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + +<!-- **************************** NEW PAGE ************************************* --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + 2 tables with thick borders around the cells + </fo:block> + + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + + <!-- table start --> + <fo:table border-collapse="separate"> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>good</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>bad</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>ugly</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>nice</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>dice</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>vice</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>literature</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>music</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>art</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>java</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>perl</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>python</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table end --> + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + <!-- table start --> + <fo:table border-collapse="separate"> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-column column-width="50mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>good</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>bad</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>ugly</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>nice</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>dice</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>vice</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>literature</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>music</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>art</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>java</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>perl</fo:block></fo:table-cell> + <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>python</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table end --> + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + +<!-- **************************** NEW PAGE ************************************* --> + + <!-- this defines a title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + space-after.optimum="15pt" + text-align="center" + break-before="page"> + 5 tables with borders + </fo:block> + + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + + <fo:table border-width="1.5mm" border-style="solid" background-color="rgb(100,210,250)"> + <fo:table-column column-width="150mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block>bad</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + + <fo:table border-width="1.5mm" border-style="solid" background-color="rgb(100,210,250)" > + <fo:table-column column-width="150mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block>bad</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + + <fo:table border-width="1.5mm" border-style="solid" background-color="rgb(100,210,250)" > + <fo:table-column column-width="150mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block>bad</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-width="1.5mm" border-style="solid" background-color="rgb(100,210,250)"> + <fo:table-column column-width="150mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block>bad</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <!-- normal text --> + <fo:block text-align="start">this is normal text. this is normal text. this is normal text. + this is normal text. this is normal text. this is normal text. + </fo:block> + + +<!-- **************************** NEW PAGE ************************************* --> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-after.optimum="3pt" + break-before="page" + text-align="justify"> + A Contents table + </fo:block> + + <!-- Here starts the table --> + <fo:table> + <fo:table-column column-width="1cm"/> + <fo:table-column column-width="15cm"/> + <fo:table-body font-size="10pt" 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">What is FOP?</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">Downloading FOP</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">Running FOP</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">Embedding FOP </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">What's Implemented?</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell> + <fo:block text-align="end">F) </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="start">Limitations</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell> + <fo:block text-align="end">G) </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="start">Bugs</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell> + <fo:block text-align="end">H) </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="start">Compiling FOP</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell> + <fo:block text-align="end">I) </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="start">Getting involved</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell> + <fo:block text-align="end">J) </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="start">FOP Relevant Specifications</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row line-height="12pt"> + <fo:table-cell> + <fo:block text-align="end">K) </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="start">Licence</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/tableunits.fo b/examples/fo/basic/tableunits.fo new file mode 100644 index 000000000..cfc672d67 --- /dev/null +++ b/examples/fo/basic/tableunits.fo @@ -0,0 +1,221 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + + <!-- defines the layout master --> + <fo:layout-master-set> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm" margin-bottom="1.5cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <!-- starts actual layout --> + <fo:page-sequence master-reference="first"> + + <fo:flow flow-name="xsl-region-body"> + + <!-- normal text --> + <fo:block space-after="1cm" text-align="start" padding="0.4in" + border="thick solid red">Table unit tests</fo:block> + <fo:table border-collapse="collapse" width="6in"> + <fo:table-column column-width="(4.5in - 2cm) div 3 +1in" background-color="yellow"/> + <fo:table-column column-width="(4.5in - 2cm) div 3 + 0.5in" background-color="blue"/> + <fo:table-column column-width="(4.5in - 2cm) div 3 + 2.0cm" background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>fixed width columns</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <!-- table start --> + <fo:table border-collapse="collapse" width="6in"> + <fo:table-column column-width="1in + proportional-column-width(1)" background-color="yellow"/> + <fo:table-column column-width="2 * (proportional-column-width(1) + .5in) div 2" background-color="blue"/> + <fo:table-column column-width="proportional-column-width(1) + 2.0cm" background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell background-color="blue"><fo:block>default alignment +</fo:block></fo:table-cell> + <fo:table-cell height="3cm" background-color="green" display-align="center"><fo:block>Centered with height=3cm</fo:block></fo:table-cell> + <fo:table-cell background-color="yellow" display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row height="3cm"> + <fo:table-cell><fo:block>default alignment but with a height +of 3cm on the row </fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> +<fo:block space-before="12pt" space-after="6pt"> +The next table has width=100% on the table no column widths specified on the table-column element. +</fo:block> + <!-- table start --> + <fo:table border-collapse="collapse" width="100%"> + <fo:table-column background-color="yellow"/> + <fo:table-column background-color="blue"/> + <fo:table-column background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + +<fo:block space-before="12pt" space-after="6pt"> +The next table has fixed column widths=13cm, ipd.optimum=12cm and ipd.max = 100%. +</fo:block> + <!-- table start --> + <fo:table border-collapse="collapse" inline-progression-dimension="12cm" + inline-progression-dimension.maximum="100%"> + <fo:table-column column-width="8cm" background-color="yellow"/> + <fo:table-column column-width="proportional-column-width(2)" background-color="blue"/> + <fo:table-column column-width="5cm" background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table><fo:block space-before="12pt" space-after="6pt"> +The next table has fixed column widths=16.5cm, ipd.optimum=14cm and ipd.max = 100% (16cm). +</fo:block> + <!-- table start --> + <fo:table border-collapse="collapse" inline-progression-dimension="14cm" + inline-progression-dimension.maximum="100%"> + <fo:table-column column-width="8.5cm" background-color="yellow"/> + <fo:table-column column-width="proportional-column-width(2)" background-color="blue"/> + <fo:table-column column-width="8cm" background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> +<fo:block space-before="12pt" space-after="6pt"> +The next table has width="70% + 1cm" and fixed lengths and the first table-column +has column-width="from-parent('width') div 3". +</fo:block> + <!-- table start --> + <fo:table border-collapse="collapse" width="70% + 1cm"> + <fo:table-column column-width="from-parent('width') div 3" background-color="yellow"/> + <fo:table-column background-color="blue"/> + <fo:table-column background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + +<fo:block space-before="12pt" space-after="6pt"> +The next table specifies inline-progression-dimension="15cm" instead of width. The +middle column has a fixed width; the other two have default width. +</fo:block> + <!-- table start --> + <fo:table border-collapse="collapse" + inline-progression-dimension="15cm"> + <fo:table-column background-color="yellow"/> + <fo:table-column column-width="3cm" background-color="blue"/> + <fo:table-column background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + +<fo:block space-before="12pt" space-after="6pt"> +The next table specifies neither width nor inline-progression-dimenion. +</fo:block> + <!-- table start --> + <fo:table table-layout="fixed" border-collapse="collapse"> + <fo:table-column background-color="yellow"/> + <fo:table-column column-width="3cm" background-color="blue"/> + <fo:table-column background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + +<fo:block space-before="12pt" space-after="6pt"> +The next table specifies inline-progression-dimenion.minimum="10cm" and +specifies a column width of 5cm on the middle column only.. +</fo:block> + <!-- table start --> + <fo:table table-layout="fixed" border-collapse="collapse" + inline-progression-dimension.minimum="10cm"> + <fo:table-column background-color="yellow"/> + <fo:table-column column-width="5cm" background-color="blue"/> + <fo:table-column background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> +<fo:block space-before="12pt" space-after="6pt"> +The next table specifies inline-progression-dimenion.minimum="10cm", +inline-progression-dimension.maximum="17cm and +specifies a column width of 5cm on the middle column only.. +</fo:block> + <!-- table start --> + <fo:table table-layout="fixed" border-collapse="collapse" + inline-progression-dimension.minimum="10cm" + inline-progression-dimension.maximum="17cm"> + <fo:table-column background-color="yellow"/> + <fo:table-column column-width="5cm" background-color="blue"/> + <fo:table-column background-color="green"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="before"><fo:block>Some text to make this cell +deeper than the others to check out the aliignment properties.</fo:block></fo:table-cell> + <fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell> + <fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/basic/textdeko.fo b/examples/fo/basic/textdeko.fo new file mode 100644 index 000000000..01bbe4293 --- /dev/null +++ b/examples/fo/basic/textdeko.fo @@ -0,0 +1,252 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- simple example for text-decoration --> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + <!-- layout for the other pages --> + <fo:simple-page-master master-name="rest" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2.5cm"/> + <fo:region-before extent="2.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + +<fo:page-sequence-master master-name="basicPSM" > + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="first" + page-position="first" /> + <fo:conditional-page-master-reference master-reference="rest" + page-position="rest" /> + <!-- recommended fallback procedure --> + <fo:conditional-page-master-reference master-reference="rest" /> + </fo:repeatable-page-master-alternatives> +</fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="basicPSM"> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block font-size="18pt" font-family="sans-serif" line-height="24pt" space-after.optimum="15pt" + background-color="blue" color="white" text-align="center" padding-top="3pt"> + Simple example for text-decoration + </fo:block> + + <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="10pt"> + The "text-decoration"-property describes decorations that are added to the text of an element. + If the property is specified for a block-level element, it should affect all inline-level descendants + of the element (does not work yet!). + If it is specified for (or affects) an inline-level + element, it affects all boxes generated by the element. + </fo:block> + + <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="13pt"> + Example: <fo:inline text-decoration="underline">underline</fo:inline> + </fo:block> + + <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="10pt"> + <fo:inline font-family="monospace"><![CDATA[<fo:inline text-decoration="underline">underline</fo:inline>]]></fo:inline> + </fo:block> + + <fo:block font-size="12pt" + font-family="serif" + line-height="15pt" + space-after.optimum="10pt" + text-align="start"> + This is simple test of the text-decoration<fo:inline text-decoration="underline">underline</fo:inline>. + </fo:block> + <fo:block font-size="22pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="10pt" + text-align="start"> + This is simple test with a <fo:inline text-decoration="underline">bigger</fo:inline> font-size. + </fo:block> + <fo:block font-size="12pt" + font-family="monospace" + line-height="15pt" + space-after.optimum="20pt" + text-align="start"> + This is simple test with a <fo:inline text-decoration="underline">monospaced</fo:inline> font. + + </fo:block> + + <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="3pt"> + The following text decorations are defined in the CR: + </fo:block> + + <fo:list-block space-after.optimum="13pt"> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="none">none</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="underline">underline</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="overline">overline</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="line-through">line-through</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="blink">blink</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="no-underline">no-underline</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="no-overline">no-overline</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="no-line-through">no-line-through</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <fo:inline text-decoration="no-blink">no-blink</fo:inline> + </fo:block> + </fo:list-item-body> + </fo:list-item> + + </fo:list-block> + + <fo:block font-size="12pt" space-after.optimum="3pt"> + <fo:inline text-decoration="underline overline">Combination</fo:inline> of property + values should also be possible, but does not work in FOP at the moment. + </fo:block> + + <fo:block font-size="12pt" space-after.optimum="13pt"> + <fo:inline font-family="monospace"><![CDATA[<fo:inline text-decoration="underline overline"> + Combination</fo:inline>]]></fo:inline> + </fo:block> + + + <fo:block space-after.optimum="13pt"> + And now <fo:inline text-decoration="underline">more than a word...</fo:inline> + </fo:block> + + <fo:block space-after.optimum="13pt" font-size="14pt" > + <fo:inline text-decoration="underline"> + This is a whole block wrapped in fo:inline with the property text-decoration="underline". + Some more Text to get at least two lines. + </fo:inline> + </fo:block> + + <fo:block font-size="22pt" + font-family="sans-serif" + line-height="22pt" + space-after.optimum="10pt" + text-align="start"> + This is simple test with a <fo:inline text-decoration="overline">bigger font-size</fo:inline>. + </fo:block> + <fo:block font-size="15pt" + font-family="monospace" + line-height="15pt" + space-after.optimum="10pt" + text-align="start"> + This is simple test with a <fo:inline text-decoration="line-through">monospaced font</fo:inline>. + </fo:block> + + <fo:block font-size="15pt" + line-height="15pt" + space-after.optimum="10pt" + text-align="start"> + What about underlining of whitespace only<fo:inline text-decoration="underline"> </fo:inline>? + </fo:block> + + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/build.xml b/examples/fo/build.xml new file mode 100644 index 000000000..1a52fa419 --- /dev/null +++ b/examples/fo/build.xml @@ -0,0 +1,139 @@ +<?xml version="1.0"?> +<!-- =========================================================================== --> +<project default="newPDF" basedir="."> + <!-- =================================================================== --> + <!-- Initialization target --> + <!-- =================================================================== --> + <target name="init"> + <tstamp/> + <mkdir dir="tests"/> + <property name="referenceDir" value="reference"/> + <property name="testDir" value="tests"/> + <property name="foDir" value="fo"/> + <path id="run-classpath"> + <fileset dir="../../lib"> + <include name="*.jar"/> + </fileset> + <pathelement location="../../build/fop.jar"/> + </path> + <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop" classpathref="run-classpath"/> + <taskdef name="compare" classname="org.apache.fop.tools.anttasks.Compare" classpathref="run-classpath"/> + </target> + <!-- =================================================================== --> + <!-- Help on usage --> + <!-- =================================================================== --> + <target name="usage"> + <echo message="Use '-projecthelp' instead"/> + </target> + <!-- =================================================================== --> + <!-- Produces new test files (function) --> + <!-- =================================================================== --> + <target name="newTestFiles"> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="basic"> + <fileset dir="basic"> + <include name="**/*.fo"/> + </fileset> + </fop> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="footnotes"> + <fileset dir="footnotes"> + <include name="**/*.fo"/> + </fileset> + </fop> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="pagination"> + <fileset dir="pagination"> + <include name="**/*.fo"/> + </fileset> + </fop> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="keeps_and_breaks"> + <fileset dir="keeps_and_breaks"> + <include name="**/*.fo"/> + </fileset> + </fop> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="markers"> + <fileset dir="markers"> + <include name="**/*.fo"/> + </fileset> + </fop> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="region_body"> + <fileset dir="region_body"> + <include name="**/*.fo"/> + </fileset> + </fop> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="tables"> + <fileset dir="tables"> + <include name="**/*.fo"/> + </fileset> + </fop> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="svg"> + <fileset dir="svg"> + <include name="**/*.fo"/> + </fileset> + </fop> + <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" basedir="advanced"> + <fileset dir="advanced"> + <include name="**/giro.fo"/> + </fileset> + </fop> + </target> + <!-- =================================================================== --> + <!-- Produces new test PDF files --> + <!-- =================================================================== --> + <target name="newPDF" depends="init" description="Creates a new set of PDF test files"> + <antcall target="newTestFiles"> + <param name="mimetype" value="application/pdf"/> + <param name="msglevel" value="warn"/> + <param name="outDir" value="${testDir}"/> + </antcall> + </target> + <!-- =================================================================== --> + <!-- Produces new test ps files --> + <!-- =================================================================== --> + <target name="newPS" depends="init" description="Creates a new set of PostScript test files"> + <antcall target="newTestFiles"> + <param name="mimetype" value="application/postscript"/> + <param name="msglevel" value="warn"/> + <param name="outDir" value="${testDir}"/> + </antcall> + </target> + <!-- =================================================================== --> + <!-- Produces new test areatree files --> + <!-- =================================================================== --> + <target name="newAT" depends="init" description="Creates a new set of AreaTree XML test files"> + <antcall target="newTestFiles"> + <param name="mimetype" value="text/xml"/> + <param name="msglevel" value="warn"/> + <param name="outDir" value="${testDir}"/> + </antcall> + </target> + <!-- =================================================================== --> + <!-- Compares new test pdf files to reference pdf files --> + <!-- =================================================================== --> + <target name="comparePDF" depends="newPDF"> + <compare referenceDirectory="${referenceDir}" testDirectory="${testDir}" filenames="normal.pdf,table.pdf,list.pdf,link.pdf,border.pdf,images.pdf,extensive.pdf,readme.pdf,fonts.pdf,bordershorthand.pdf,character.pdf,corresprop.pdf,hyphen.pdf,inhprop.pdf,instream.pdf,leader.pdf,newlinktest.pdf,normalex.pdf,pdfoutline.pdf,simple.pdf,textdeko.pdf,tableunits.pdf"/> + </target> + <!-- =================================================================== --> + <!-- Produces new reference pdf files --> + <!-- =================================================================== --> + <target name="referencePDF" depends="init"> + <antcall target="newTestFiles"> + <param name="mimetype" value="application/pdf"/> + <param name="msglevel" value="warn"/> + <param name="outDir" value="${referenceDir}"/> + </antcall> + </target> + + <!-- =================================================================== --> + <!-- Starts the test --> + <!-- =================================================================== --> + <target name="runtest" depends="comparePDF"> + <echo message="Running Fop tests"/> + </target> + <!-- =================================================================== --> + <!-- Clean targets --> + <!-- =================================================================== --> + <target name="clean" depends="init"> + <delete dir="${testDir}"/> + </target> + +</project> +<!-- End of file --> diff --git a/examples/fo/footnotes/columns.fo b/examples/fo/footnotes/columns.fo new file mode 100644 index 000000000..3a0ee029a --- /dev/null +++ b/examples/fo/footnotes/columns.fo @@ -0,0 +1,249 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="first" + page-height="11in" + page-width="8.5in" + margin-top="1in" + margin-bottom="1in" + margin-left="0.75in" + margin-right="0.75in"> + <fo:region-body + margin-top="1in" margin-bottom="1in" + column-count="2" column-gap="0.25in"/> + <fo:region-before extent="1in"/> + <fo:region-after extent="1in"/> + </fo:simple-page-master> + + <fo:simple-page-master master-name="next" + page-height="11in" + page-width="8.5in" + margin-top="1in" + margin-bottom="1in" + margin-left="0.75in" + margin-right="0.75in"> + <fo:region-body + margin-top="1in" margin-bottom="1in" + column-count="4" column-gap="0.25in"/> + <fo:region-before extent="1in"/> + <fo:region-after extent="1in"/> + </fo:simple-page-master> + + </fo:layout-master-set> + + <!-- actual layout --> + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="normal" + text-align="start" + color="blue">Footnotes in Columns</fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" + font-family="sans-serif" + line-height="12pt" + space-before.optimum="6pt" + text-align="end" + color="blue">Page #</fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <fo:block color="grey"> +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? + </fo:block> +<fo:block color="red"> + The <fo:footnote> + <fo:inline font-weight="bold">footnote<fo:inline font-size="6pt" vertical-align="super">1</fo:inline></fo:inline> + <fo:footnote-body> + <fo:block color="maroon"> + 1. A footnote is text placed at the bottom of the current page. + </fo:block> + </fo:footnote-body> + </fo:footnote> + at the bottom of the page. +</fo:block> + <fo:block color="grey"> +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? + </fo:block> +<fo:block color="green"> + The <fo:footnote> + <fo:inline font-weight="bold">second footnote<fo:inline font-size="6pt" vertical-align="super">2</fo:inline></fo:inline> + <fo:footnote-body> + <fo:block color="darkgreen"> + 2. Another footnote with a bit more text. + </fo:block> + </fo:footnote-body> + </fo:footnote> + at the bottom of the page after the other footnote. +</fo:block> + + </fo:flow> + </fo:page-sequence> + + <fo:page-sequence master-reference="next"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="normal" + text-align="start" + color="blue">Footnotes in Columns</fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" + font-family="sans-serif" + line-height="12pt" + space-before.optimum="6pt" + text-align="end" + color="blue">Page #</fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <fo:block color="grey"> +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? + </fo:block> +<fo:block color="red"> + The <fo:footnote> + <fo:inline font-weight="bold">footnote<fo:inline font-size="6pt" vertical-align="super">1</fo:inline></fo:inline> + <fo:footnote-body> + <fo:block color="maroon"> + 1. A footnote is text placed at the bottom of the current page. + </fo:block> + </fo:footnote-body> + </fo:footnote> + at the bottom of the page. +</fo:block> + <fo:block color="grey"> +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? +What shall we use to fill the empty spaces, +Where we used to talk? +How shall I fill the final places? +How shall I complete the wall? + </fo:block> +<fo:block color="green"> + The <fo:footnote> + <fo:inline font-weight="bold">second footnote<fo:inline font-size="6pt" vertical-align="super">2</fo:inline></fo:inline> + <fo:footnote-body> + <fo:block color="darkgreen"> + 2. Another footnote with a bit more text. + </fo:block> + </fo:footnote-body> + </fo:footnote> + at the bottom of the page after the other footnote. +</fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/footnotes/simple.fo b/examples/fo/footnotes/simple.fo new file mode 100644 index 000000000..a1abc046a --- /dev/null +++ b/examples/fo/footnotes/simple.fo @@ -0,0 +1,115 @@ +<?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 margin-right="0.5cm" margin-left="1.5cm" margin-bottom="2cm" margin-top="0cm" page-width="21cm" page-height="20cm" master-name="one"> +<fo:region-body margin-bottom="2cm" margin-top="2cm"/> +<fo:region-before extent="0.5cm"/> +<fo:region-after extent="0.5cm"/> +</fo:simple-page-master> +</fo:layout-master-set> +<fo:page-sequence master-reference="one"> +<fo:flow flow-name="xsl-region-body"> + +<fo:block space-after.optimum="10pt" font-weight="bold" font-size="16pt" text-align="center"> + Footnotes +</fo:block> + +<fo:block color="red"> + The <fo:footnote> + <fo:inline font-weight="bold">footnote<fo:inline font-size="6pt" vertical-align="super">1</fo:inline></fo:inline> + <fo:footnote-body> + <fo:block color="maroon"> + 1. A footnote is text placed at the bottom of the current or the next page. + </fo:block> + </fo:footnote-body> + </fo:footnote> + at the bottom of the page. +</fo:block> +<fo:block color="green"> + The <fo:footnote> + <fo:inline font-weight="bold">second footnote<fo:inline font-size="6pt" vertical-align="super">2</fo:inline></fo:inline> + <fo:footnote-body> + <fo:block color="darkgreen"> + 2. Another footnote with a bit more text. + </fo:block> + </fo:footnote-body> + </fo:footnote> + at the bottom of the page after the other footnote. +</fo:block> +<fo:block space-before.optimum="200pt" color="grey"> +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +This text is used to show the body region area. +</fo:block> + +<fo:block break-before="page"> + This is for testing if a footnote cannot fit with the footnote + reference text. +</fo:block> +<fo:block color="grey" space-before.optimum="300pt"> +Some filler text with no other purpose. +Some filler text with no other purpose. +Some filler text with no other purpose. +Some filler text with no other purpose. +Some filler text with no other purpose. +Some filler text with no other purpose. +Some filler text with no other purpose. +Some filler text with no other purpose. +</fo:block> +<fo:block color="blue"> + This <fo:footnote> + <fo:inline font-weight="bold">footnote</fo:inline> + <fo:footnote-body> + <fo:block color="darkblue"> + A footnote with too much text to fit on the same page as the reference. Also the + reference is in the same place as the conditional footnote reference text. + </fo:block> + </fo:footnote-body> + </fo:footnote> + is at the bottom of the page where the conditional footnote reference area is. + +</fo:block> + +<fo:block break-before="page"> + This page also has a footnote and should have the footnote from the last page. +</fo:block> +<fo:block color="grey" space-before.optimum="150pt"> +More boring filler text. +More boring filler text. +More boring filler text. +</fo:block> +<fo:block color="fuchsia"> + This <fo:footnote> + <fo:inline font-weight="bold">footnote</fo:inline> + <fo:footnote-body> + <fo:block color="purple"> + Another footnote. + </fo:block> + </fo:footnote-body> + </fo:footnote> + is at the bottom of the page after the footnote from the previous page. + +</fo:block> + + +</fo:flow> +</fo:page-sequence> +</fo:root> diff --git a/examples/fo/keeps_and_breaks/columnlevel1.fo b/examples/fo/keeps_and_breaks/columnlevel1.fo new file mode 100644 index 000000000..2a286f342 --- /dev/null +++ b/examples/fo/keeps_and_breaks/columnlevel1.fo @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +This file addresses breaks in column context. +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <!-- layout for all pages --> + <fo:simple-page-master master-name="all" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body + margin-top="3cm" margin-bottom="2cm" + column-count="2" column-gap="0.25in"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="all"> + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" text-align="start" + border-style="solid" border-color="blue" border-width="0.5pt" + space-before.optimum="6pt"> + Text excerpt from XSL Candidate Recommendation, 21 Nov 2000. + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are either break-before or break-before conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-before condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="column"> +This is a block with a <fo:inline font-style="italic">break-before="column" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in a column context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-before +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-before trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="column"> +This is a block with a <fo:inline font-style="italic">break-before="column" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in a column context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + <fo:block span="all"> + <fo:leader leader-pattern="rule" + rule-thickness="2.0pt" + leader-length="14cm" + space-before.optimum="0pt" + space-after.optimum="12pt" + start-indent="1cm" + end-indent="1cm" + background-color="blue" + color="yellow"/> + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-after="column"> +This is a block with a <fo:inline font-style="italic">break-after="column" +</fo:inline> break condition. This condition is satisfied if there is +no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the +first normal area generated by the next FO is leading in a column +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are either break-before or break-before conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-before condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-before +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-before trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-after="column"> +This is a block with a <fo:inline font-style="italic">break-after="column" +</fo:inline> break condition. This condition is satisfied if there is +no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the +first normal area generated by the next FO is leading in a column context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> + diff --git a/examples/fo/keeps_and_breaks/pagelevel1.fo b/examples/fo/keeps_and_breaks/pagelevel1.fo new file mode 100644 index 000000000..3b674ee0f --- /dev/null +++ b/examples/fo/keeps_and_breaks/pagelevel1.fo @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +This file addresses breaks in page context. +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <!-- layout for all pages --> + <fo:simple-page-master master-name="all" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body + margin-top="3cm" margin-bottom="2cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="all"> + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" text-align="start" + border-style="solid" border-color="blue" border-width="0.5pt"> + Text excerpt from XSL Candidate Recommendation, 21 Nov 2000. + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + break-after="page"> +<fo:inline color="red">break-after="page"</fo:inline> +Break conditions are either break-before or break-after conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-after condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-after +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-after trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + break-before="page"> +<fo:inline color="red">break-before="page"</fo:inline> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> + diff --git a/examples/fo/keeps_and_breaks/pagelevel2.fo b/examples/fo/keeps_and_breaks/pagelevel2.fo new file mode 100644 index 000000000..9018a3d25 --- /dev/null +++ b/examples/fo/keeps_and_breaks/pagelevel2.fo @@ -0,0 +1,293 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +This file addresses break-after's in page context. +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <!-- layout for all pages --> + <fo:simple-page-master master-name="all" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body + margin-top="3cm" margin-bottom="2cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="all"> + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" text-align="start" + border-style="solid" border-color="blue" border-width="0.5pt" + space-before.optimum="6pt"> + Text excerpt from XSL Candidate Recommendation, 21 Nov 2000. + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are either break-before or break-after conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-after condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-after="even-page"> +This is a block with a <fo:inline font-style="italic">break-after="even-page" +</fo:inline> break condition. This condition is satisfied if there is +no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the +first normal area generated by the next FO is leading in an even-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-after +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-after trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-after="even-page"> +This is a block with a <fo:inline font-style="italic">break-after="even-page" +</fo:inline> break condition. This condition is satisfied if there is +no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the +first normal area generated by the next FO is leading in an even-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + <fo:block> + <fo:leader leader-pattern="rule" + rule-thickness="2.0pt" + leader-length="14cm" + space-before.optimum="0pt" + space-after.optimum="12pt" + start-indent="1cm" + end-indent="1cm" + background-color="blue" + color="yellow"/> + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-after="odd-page"> +This is a block with a <fo:inline font-style="italic">break-after="odd-page" +</fo:inline> break condition. This condition is satisfied if there is +no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the +first normal area generated by the next FO is leading in an odd-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are either break-before or break-after conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-after condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-after +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-after trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-after="odd-page"> +This is a block with a <fo:inline font-style="italic">break-after="odd-page" +</fo:inline> break condition. This condition is satisfied if there is +no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the +first normal area generated by the next FO is leading in an odd-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> + diff --git a/examples/fo/keeps_and_breaks/pagelevel3.fo b/examples/fo/keeps_and_breaks/pagelevel3.fo new file mode 100644 index 000000000..b329a4519 --- /dev/null +++ b/examples/fo/keeps_and_breaks/pagelevel3.fo @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +This file addresses break-before's in page context. +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <!-- layout for all pages --> + <fo:simple-page-master master-name="all" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body + margin-top="3cm" margin-bottom="2cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="all"> + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" text-align="start" + border-style="solid" border-color="blue" border-width="0.5pt" + space-before.optimum="6pt"> + Text excerpt from XSL Candidate Recommendation, 21 Nov 2000. + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are either break-before or break-before conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-before condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="even-page"> +This is a block with a <fo:inline font-style="italic">break-before="even-page" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in an even-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-before +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-before trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="even-page"> +This is a block with a <fo:inline font-style="italic">break-before="even-page" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in an even-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + <fo:block> + <fo:leader leader-pattern="rule" + rule-thickness="2.0pt" + leader-length="14cm" + space-before.optimum="0pt" + space-after.optimum="12pt" + start-indent="1cm" + end-indent="1cm" + background-color="blue" + color="yellow"/> + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="odd-page"> +This is a block with a <fo:inline font-style="italic">break-before="odd-page" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in an odd-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are either break-before or break-before conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-before condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-before +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-before trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="odd-page"> +This is a block with a <fo:inline font-style="italic">break-before="odd-page" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in an odd-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> + diff --git a/examples/fo/keeps_and_breaks/pagelevel4.fo b/examples/fo/keeps_and_breaks/pagelevel4.fo new file mode 100644 index 000000000..cd7f454a9 --- /dev/null +++ b/examples/fo/keeps_and_breaks/pagelevel4.fo @@ -0,0 +1,291 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +This file addresses breaks in page context, with a +2-column layout. +--> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <!-- layout for all pages --> + <fo:simple-page-master master-name="all" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body + margin-top="3cm" margin-bottom="2cm" + column-count="2" column-gap="0.25in"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="all"> + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" text-align="start" + border-style="solid" border-color="blue" border-width="0.5pt" + space-before.optimum="6pt"> + Text excerpt from XSL Candidate Recommendation, 21 Nov 2000. + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are either break-before or break-before conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-before condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="even-page"> +This is a block with a <fo:inline font-style="italic">break-before="even-page" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in an even-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-before +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-before trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="even-page"> +This is a block with a <fo:inline font-style="italic">break-before="even-page" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in an even-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + <fo:block span="all"> + <fo:leader leader-pattern="rule" + rule-thickness="2.0pt" + leader-length="14cm" + space-before.optimum="0pt" + space-after.optimum="12pt" + start-indent="1cm" + end-indent="1cm" + background-color="blue" + color="yellow"/> + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep and break conditions apply to a class of areas, which are typically +page-reference-areas, column-areas, and line-areas. The appropriate class +for a given condition is referred to as a context and an area in this +class is a context-area. As defined in Section 6.4.1, page-reference-areas +are areas generated by an fo:page-sequence using the specifications in a +fo:page-master, and column-areas are normal-flow-reference-areas generated +from a region-body, or region-reference-areas generated from other types +of region-master. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +A keep or break condition is an open statement about a formatting object +and the tree relationships of the areas it generates with the relevant +context-areas. These tree relationships are defined mainly in terms of +leading or trailing areas. If A is a descendant of P, then A is defined +to be leading in P if A has no preceding sibling which is a normal area, +nor does any of its ancestor areas up to but not including P. Similarly, +A is defined to be trailing in P if A has no following sibling which is +a normal area, nor does any of its ancestor areas up to but not including P. +For any given formatting object, the next formatting object in the flow is +the first formatting object following (in the pre-order traversal order) +which generates and returns normal areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="odd-page"> +This is a block with a <fo:inline font-style="italic">break-before="odd-page" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in an odd-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are either break-before or break-before conditions. +A break-before condition is satisfied if the first area generated and +returned by the formatting object is leading within a context-area. A +break-before condition depends on the next formatting object in the flow; +it is satisfied if either there is no such next formatting object, or +if the first normal area generated and returned by that formatting +object is leading in a context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Break conditions are imposed by the break-before and break-before +properties. A refined value of page for these traits imposes a break +condition with a context consisting of the page-reference-areas; a +value of even-page or odd-page imposes a break condition with a +context of even-numbered page-reference-areas or odd-numbered page +reference-areas, respectively; a value of column imposes a break +condition with a context of column-areas. A value of auto in a +break-before or break-before trait imposes no break condition. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are either keep-with-previous, keep-with-next, or +keep-together conditions. A keep-with-previous condition on an +object is satisfied if the first area generated and returned by +the formatting object is not leading within a context-area, or +if there are no preceding areas in a post-order traversal of the +area tree. A keep-with-next condition is satisfied if the last +area generated and returned by the formatting object is not +trailing within a context-area, or if there are no following +areas in a pre-order traversal of the area tree. A keep-together +condition is satisfied if all areas generated and returned by +the formatting object are descendants of a single context-area. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +Keep conditions are imposed by the "within-page", "within-column", +and "within-line" components of the "keep-with-previous", +"keep-with-next", and "keep-together" properties. The refined value +of each component specifies the strength of the keep condition +imposed, with higher numbers being stronger than lower numbers and +the value always being stronger than all numeric values. A component +with value auto does not impose a keep condition. A "within-page" +component imposes a keep-condition with context consisting of the +page-reference-areas; "within-column", with context consisting of +the column-areas; and "within-line" with context consisting of the +line-areas. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt" + color="blue" + break-before="odd-page"> +This is a block with a <fo:inline font-style="italic">break-before="odd-page" +</fo:inline> break condition. This condition is satisfied if the +first normal area generated by this FO is leading in an odd-page +context. + </fo:block> + + <fo:block + font-size="14pt" font-family="sans-serif" + line-height="18pt" space-after.optimum="15pt"> +The area tree is constrained to satisfy all break conditions imposed. +Each keep condition must also be satisfied, except when this would +cause a break condition or a stronger keep condition to fail to be +satisfied. If not all of a set of keep conditions of equal strength +can be satisfied, then some maximal satisfiable subset of conditions +of that strength must be satisfied (together with all break conditions +and maximal subsets of stronger keep conditions, if any). + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> + diff --git a/examples/fo/markers/glossary.xml b/examples/fo/markers/glossary.xml new file mode 100644 index 000000000..7657750fa --- /dev/null +++ b/examples/fo/markers/glossary.xml @@ -0,0 +1,314 @@ +<?xml version="1.0"?> +<glossary> +<term-entry> + <term>basic-link</term> + <definition>The fo:basic-link is used for representing the start resource + of a simple link.</definition> +</term-entry> +<term-entry> + <term>bidi-override</term> + <definition>The fo:bidi-override inline formatting object is used where + it is necessary to override the default Unicode-bidirectionality + algorithm direction for different (or nested) inline scripts in + mixed-language documents.</definition> +</term-entry> +<term-entry> + <term>block</term> + <definition>The fo:block formatting object is commonly used for formatting + paragraphs, titles, headlines, figure and table captions, etc.</definition> +</term-entry> +<term-entry> + <term>block-container</term> + <definition>The fo:block-container flow object is used to generate a + block-level reference-area.</definition> +</term-entry> +<term-entry> + <term>character</term> + <definition>The fo:character flow object represents a character that is + mapped to a glyph for presentation.</definition> +</term-entry> +<term-entry> + <term>color-profile</term> + <definition>Used to declare a color profile for a stylesheet.</definition> +</term-entry> +<term-entry> + <term>conditional-page-master-reference</term> + <definition>The fo:conditional-page-master-reference + is used to identify a page-master that is to be used when the conditions + on its use are satisfied.</definition> +</term-entry> +<term-entry> + <term>declarations</term> + <definition>Used to group global declarations for a stylesheet.</definition> +</term-entry> +<term-entry> + <term>external-graphic</term> + <definition>The fo:external-graphic flow object is used for a graphic + where the graphics data resides outside of the XML result tree in the + fo namespace.</definition> +</term-entry> +<term-entry> + <term>float</term> + <definition>The fo:float serves two purposes. It can be used so that during the + normal placement of content, some related content is formatted into a + separate area at beginning of the page (or of some following page) where + it is available to be read without immediately intruding on the reader. + Alternatively, it can be used when an area is intended to float to one + side, with normal content flowing alongside.</definition> +</term-entry> +<term-entry> + <term>flow</term> + <definition>The content of the fo:flow formatting object is a sequence + of flow objects that provides the flowing text content that is distributed + into pages.</definition> +</term-entry> +<term-entry> + <term>footnote</term> + <definition>The fo:footnote is used to produce a footnote citation and the + corresponding footnote.</definition> +</term-entry> +<term-entry> + <term>footnote-body</term> + <definition>The fo:footnote-body is used to generate the content of the + footnote.</definition> +</term-entry> +<term-entry> + <term>initial-property-set</term> + <definition>The fo:initial-property-set specifies formatting properties + for the first line of an fo:block.</definition> +</term-entry> +<term-entry> + <term>inline</term> + <definition>The fo:inline formatting object is commonly used for + formatting a portion of text with a background or enclosing it in a + border.</definition> +</term-entry> +<term-entry> + <term>inline-container</term> + <definition>The fo:inline-container flow object is used to generate an + inline reference-area.</definition> +</term-entry> +<term-entry> + <term>instream-foreign-object</term> + <definition>The fo:instream-foreign-object flow object is used for an + inline graphic or other "generic" object where the object data resides + as descendants of the fo:instream-foreign-object.</definition> +</term-entry> +<term-entry> + <term>layout-master-set</term> + <definition>The fo:layout-master-set is a wrapper around all masters used + in the document.</definition> +</term-entry> +<term-entry> + <term>leader</term> + <definition>The fo:leader formatting object is used to generate leaders + consisting either of a rule or of a row of a repeating character or + cyclically repeating pattern of characters that may be used for connecting + two text formatting objects.</definition> +</term-entry> +<term-entry> + <term>list-block</term> + <definition>The fo:list-block flow object is used to format a list.</definition> +</term-entry> +<term-entry> + <term>list-item</term> + <definition>The fo:list-item formatting object contains the label and the + body of an item in a list.</definition> +</term-entry> +<term-entry> + <term>list-item-body</term> + <definition>The fo:list-item-body formatting object contains the content + of the body of a list-item.</definition> +</term-entry> +<term-entry> + <term>list-item-label</term> + <definition>The fo:list-item-label formatting object contains the content + of the label of a list-item; typically used to either enumerate, identify, + or adorn the list-item's body.</definition> +</term-entry> +<term-entry> + <term>marker</term> + <definition>The fo:marker is used in conjunction with fo:retrieve-marker + to produce running headers or footers.</definition> +</term-entry> +<term-entry> + <term>multi-case</term> + <definition>The fo:multi-case is used to contain (within an fo:multi-switch) + each alternative sub-tree of formatting objects among which the parent + fo:multi-switch will choose one to show and will hide the rest.</definition> +</term-entry> +<term-entry> + <term>multi-properties</term> + <definition>The fo:multi-properties is used to switch between two or more + property sets that are associated with a given portion of content.</definition> +</term-entry> +<term-entry> + <term>multi-property-set</term> + <definition>The fo:multi-property-set is used to specify an alternative + set of formatting properties that, dependent on a User Agent state, are + applied to the content. </definition> +</term-entry> +<term-entry> + <term>multi-switch</term> + <definition>The fo:multi-switch wraps the specification of alternative + sub-trees of formatting objects (each sub-tree being within an + fo:multi-case), and controls the switching (activated via fo:multi-toggle) + from one alternative to another. </definition> +</term-entry> +<term-entry> + <term>multi-toggle</term> + <definition>The fo:multi-toggle is used within an fo:multi-case to switch + to another fo:multi-case.</definition> +</term-entry> +<term-entry> + <term>page-number</term> + <definition>The fo:page-number formatting object is used to represent the + current page-number.</definition> +</term-entry> +<term-entry> + <term>page-number-citation</term> + <definition>The fo:page-number-citation is used to reference the + page-number for the page containing the first normal area returned by the + cited formatting object.</definition> +</term-entry> +<term-entry> + <term>page-sequence</term> + <definition>The fo:page-sequence formatting object is used to specify how + to create a (sub-)sequence of pages within a document; for example, a + chapter of a report. The content of these pages comes from flow children + of the fo:page-sequence.</definition> +</term-entry> +<term-entry> + <term>page-sequence-master</term> + <definition>The fo:page-sequence-master specifies sequences of page-masters + that are used when generating a sequence of pages.</definition> +</term-entry> +<term-entry> + <term>region-after</term> + <definition>This region defines a viewport that is located on the "after" + side of fo:region-body region. </definition> +</term-entry> +<term-entry> + <term>region-before</term> + <definition>This region defines a viewport that is located on the "before" + side of fo:region-body region.</definition> +</term-entry> +<term-entry> + <term>region-body</term> + <definition>This region specifies a viewport/reference pair that is located + in the "center" of the fo:simple-page-master.</definition> +</term-entry> +<term-entry> + <term>region-end</term> + <definition>This region defines a viewport that is located on the "end" + side of fo:region-body region.</definition> +</term-entry> +<term-entry> + <term>region-start</term> + <definition>This region defines a viewport that is located on the "start" + side of fo:region-body region.</definition> +</term-entry> +<term-entry> + <term>repeatable-page-master-alternatives</term> + <definition>An fo:repeatable-page-master-alternatives specifies a + sub-sequence consisting of repeated instances of a set of alternative + page-masters. The number of repetitions may be bounded or potentially + unbounded.</definition> +</term-entry> +<term-entry> + <term>repeatable-page-master-reference</term> + <definition>An fo:repeatable-page-master-reference specifies a sub-sequence + consisting of repeated instances of a single page-master. The number of + repetitions may be bounded or potentially unbounded.</definition> +</term-entry> +<term-entry> + <term>retrieve-marker</term> + <definition>The fo:retrieve-marker is used in conjunction with fo:marker + to produce running headers or footers.</definition> +</term-entry> +<term-entry> + <term>root</term> + <definition>The fo:root node is the top node of an XSL result tree. This + tree is composed of formatting objects.</definition> +</term-entry> +<term-entry> + <term>simple-page-master</term> + <definition>The fo:simple-page-master is used in the generation of pages + and specifies the geometry of the page. The page may be subdivided into + up to five regions.</definition> +</term-entry> +<term-entry> + <term>single-page-master-reference</term> + <definition>An fo:single-page-master-reference specifies a sub-sequence + consisting of a single instance of a single page-master.</definition> +</term-entry> +<term-entry> + <term>static-content</term> + <definition>The fo:static-content formatting object holds a sequence or a + tree of formatting objects that is to be presented in a single region or + repeated in like-named regions on one or more pages in the page-sequence. + Its common use is for repeating or running headers and footers.</definition> +</term-entry> +<term-entry> + <term>table</term> + <definition>The fo:table flow object is used for formatting the tabular + material of a table.</definition> +</term-entry> +<term-entry> + <term>table-and-caption</term> + <definition>The fo:table-and-caption flow object is used for formatting a + table together with its caption.</definition> +</term-entry> +<term-entry> + <term>table-body</term> + <definition>The fo:table-body formatting object is used to contain the + content of the table body.</definition> +</term-entry> +<term-entry> + <term>table-caption</term> + <definition>The fo:table-caption formatting object is used to contain + block-level formatting objects containing the caption for the table only + when using the fo:table-and-caption.</definition> +</term-entry> +<term-entry> + <term>table-cell</term> + <definition>The fo:table-cell formatting object is used to group content to + be placed in a table cell.</definition> +</term-entry> +<term-entry> + <term>table-column</term> + <definition>The fo:table-column formatting object specifies characteristics + applicable to table cells that have the same column and span.</definition> +</term-entry> +<term-entry> + <term>table-footer</term> + <definition>The fo:table-footer formatting object is used to contain the + content of the table footer.</definition> +</term-entry> +<term-entry> + <term>table-header</term> + <definition>The fo:table-header formatting object is used to contain the + content of the table header.</definition> +</term-entry> +<term-entry> + <term>table-row</term> + <definition>The fo:table-row formatting object is used to group table-cells + into rows.</definition> +</term-entry> +<term-entry> + <term>title</term> + <definition>The fo:title formatting object is used to associate a title with + a given document. This title may be used by an interactive User Agent to + identify the document. For example, the content of the fo:title can be + formatted and displayed in a "title" window or in a "tool tip".</definition> +</term-entry> +<term-entry> + <term>wrapper </term> + <definition>The fo:wrapper formatting object is used to specify inherited + properties for a group of formatting objects. It has no additional + formatting semantics.</definition> +</term-entry> +</glossary> + + + diff --git a/examples/fo/markers/glossary.xsl b/examples/fo/markers/glossary.xsl new file mode 100644 index 000000000..ee679ccf0 --- /dev/null +++ b/examples/fo/markers/glossary.xsl @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.0"> + +<xsl:template match="glossary"> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + + <fo:simple-page-master master-name="all" + page-height="11.5in" page-width="8.5in" + margin-top="1in" margin-bottom="1in" + margin-left="0.75in" margin-right="0.75in"> + <fo:region-body margin-top="1in" margin-bottom="0.75in"/> + <fo:region-before extent="0.75in"/> + <fo:region-after extent="0.5in"/> + </fo:simple-page-master> + + </fo:layout-master-set> + + <fo:page-sequence master-reference="all" format="i"> + + <!-- header with running glossary entries --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="start" + font-size="10pt" font-family="serif" line-height="1em + 2pt"> + <fo:retrieve-marker retrieve-class-name="term" + retrieve-boundary="page" + retrieve-position="first-starting-within-page"/> + <fo:leader leader-alignment="reference-area" leader-pattern="dots" + leader-length="4in"/> + <fo:retrieve-marker retrieve-class-name="term" + retrieve-boundary="page" + retrieve-position="last-ending-within-page"/> + </fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="start" + font-size="10pt" font-family="serif" line-height="1em + 2pt"> + Page (<fo:page-number/>) + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <xsl:apply-templates select="term-entry"/> + </fo:flow> + </fo:page-sequence> +</fo:root> +</xsl:template> + +<xsl:template match="term-entry"> + <fo:block text-align="start" font-size="12pt" font-family="sans-serif"> + <xsl:apply-templates select="term"/> + <xsl:apply-templates select="definition"/> + </fo:block> +</xsl:template> + +<xsl:template match="term"> + <fo:block color="blue" space-before.optimum="3pt"><fo:marker + marker-class-name="term"><xsl:value-of select="."/></fo:marker> + <xsl:value-of select="."/> + </fo:block> +</xsl:template> + +<xsl:template match="definition"> + <fo:block text-align="start" start-indent="2em"> + <xsl:value-of select="."/> + </fo:block> +</xsl:template> + +</xsl:stylesheet> + diff --git a/examples/fo/markers/hide.fo b/examples/fo/markers/hide.fo new file mode 100644 index 000000000..49e62fce1 --- /dev/null +++ b/examples/fo/markers/hide.fo @@ -0,0 +1,140 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="29.7cm" + master-name="first"> + <fo:region-before extent="1cm"/> + <fo:region-body margin-top="1cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> +<fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute"> + <fo:block> + <fo:retrieve-marker retrieve-class-name="message" + retrieve-boundary="page" + retrieve-position="first-starting-within-page"/> + </fo:block> +</fo:block-container> +<fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute"> + <fo:block> + <fo:retrieve-marker retrieve-class-name="term" + retrieve-boundary="page" + retrieve-position="last-ending-within-page"/> + </fo:block> +</fo:block-container> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="start" + font-size="10pt" font-family="serif" line-height="1em + 2pt"> + Page (<fo:page-number/> / <fo:page-number-citation +ref-id="end-seq1"/>) + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> +<fo:block><fo:marker + marker-class-name="message"> + <fo:block> +WARNING: Page sequence contains: <fo:page-number-citation +ref-id="end-seq1"/> pages. + </fo:block> +</fo:marker> + </fo:block> + + <fo:block text-align="start" font-size="12pt" font-family="sans-serif"> +This example shows how it is possible to have a message that appears +only on the first page (in a page sequence) only if there is more +than one page. + </fo:block> + + <fo:block text-align="start" font-size="12pt" font-family="sans-serif"> +This page sequence only has one page so you will not see the message. + </fo:block> + +<fo:block id="end-seq1"><fo:marker + marker-class-name="term"> +<fo:instream-foreign-object> +<svg xmlns="http://www.w3.org/2000/svg" width="15cm" height="1cm" xml:space="preserve"> + <rect style="fill:white;stroke:white" x="0" y="0" width="15cm" height="1cm"/> +</svg> +</fo:instream-foreign-object> +</fo:marker> + </fo:block> + + </fo:flow> + </fo:page-sequence> + + <fo:page-sequence master-reference="first" initial-page-number="1"> + <fo:static-content flow-name="xsl-region-before"> +<fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute"> <fo:block> + <fo:retrieve-marker retrieve-class-name="message" + retrieve-boundary="page" + retrieve-position="first-starting-within-page"/> + </fo:block> +</fo:block-container> +<fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute"> <fo:block> + <fo:retrieve-marker retrieve-class-name="term" + retrieve-boundary="page" + retrieve-position="last-ending-within-page"/> + </fo:block> +</fo:block-container> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="start" + font-size="10pt" font-family="serif" line-height="1em + 2pt"> + Page (<fo:page-number/> / <fo:page-number-citation +ref-id="end-of-document"/>) + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> +<fo:block><fo:marker + marker-class-name="message"> + <fo:block> +WARNING: Page sequence contains: <fo:page-number-citation +ref-id="end-of-document"/> pages. + </fo:block> +</fo:marker> + </fo:block> + + <fo:block text-align="start" font-size="12pt" font-family="sans-serif"> +This page sequence has more than one page so you will see the message +only at the top of the first page. + </fo:block> + + <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif"> +Some text. + </fo:block> + + <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif"> +Some text. + </fo:block> + <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif"> +Some more text on last page. + </fo:block> + +<fo:block id="end-of-document"><fo:marker + marker-class-name="term"> +<fo:instream-foreign-object> +<svg xmlns="http://www.w3.org/2000/svg" width="15cm" height="1cm" xml:space="preserve"> <rect style="fill:white;stroke:white" x="0" y="0" width="15cm" height="1cm"/> +</svg> +</fo:instream-foreign-object> +</fo:marker> + </fo:block> + + </fo:flow> + </fo:page-sequence> + +</fo:root> + diff --git a/examples/fo/pagination/allregions.fo b/examples/fo/pagination/allregions.fo new file mode 100644 index 000000000..341f67fe6 --- /dev/null +++ b/examples/fo/pagination/allregions.fo @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="only" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body + margin-top="3cm" margin-bottom="1.5cm" + margin-left="2cm" margin-right="2cm"/> + <fo:region-before precedence="true" extent="3cm"/> + <fo:region-after precedence="true" extent="1.5cm"/> + <fo:region-start extent="1cm"/> + <fo:region-end extent="1cm"/> + </fo:simple-page-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="only" initial-page-number="1"> + + <!-- usage of page layout --> + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="10pt" + font-family="serif" + line-height="14pt" > + XML Recommendation - p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-start"> + <fo:block-container border-color="black" border-style="solid" border-width="1pt" + height="22.2cm" width="1cm" top="0cm" left="0cm" position="absolute"> + <fo:block text-align="start" font-size="8pt" + font-family="serif" line-height="10pt">Start</fo:block> + </fo:block-container> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-end"> + <fo:block-container border-color="black" border-style="solid" border-width="1pt" + height="22.2cm" width="1cm" top="0cm" left="0cm" position="absolute"> + <fo:block text-align="start" font-size="8pt" + font-family="serif" line-height="10pt">End</fo:block> + </fo:block-container> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines text title level 1--> + <fo:block font-size="18pt" + font-family="sans-serif" + line-height="24pt" + space-after.optimum="15pt" + background-color="blue" + color="white" + text-align="center" + padding-top="0pt"> + Extensible Markup Language (XML) 1.0 + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="0pt"> + Abstract + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="0pt"> + Status of this document + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. For further information go to + <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document specifies a syntax created by subsetting an existing, widely used international text processing standard + (Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It + is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. A list of current W3C + Recommendations and other technical documents can be found at http://www.w3.org/TR. + </fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/pagination/basic1.fo b/examples/fo/pagination/basic1.fo new file mode 100644 index 000000000..031b52a1e --- /dev/null +++ b/examples/fo/pagination/basic1.fo @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="only" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="only" initial-page-number="1"> + + <!-- usage of page layout --> + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="10pt" + font-family="serif" + line-height="14pt" > + XML Recommendation - p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines text title level 1--> + <fo:block font-size="18pt" + font-family="sans-serif" + line-height="24pt" + space-after.optimum="15pt" + background-color="blue" + color="white" + text-align="center" + padding-top="0pt"> + Extensible Markup Language (XML) 1.0 + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="0pt"> + Abstract + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="0pt"> + Status of this document + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. For further information go to + <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document specifies a syntax created by subsetting an existing, widely used international text processing standard + (Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It + is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. A list of current W3C + Recommendations and other technical documents can be found at http://www.w3.org/TR. + </fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/pagination/basic2.fo b/examples/fo/pagination/basic2.fo new file mode 100644 index 000000000..214f43b8f --- /dev/null +++ b/examples/fo/pagination/basic2.fo @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="only" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="3cm"/> + <fo:region-before extent="3cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + + <fo:page-sequence-master master-name="single"> + <fo:single-page-master-reference master-reference="only"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="single" initial-page-number="1"> + + <!-- usage of page layout --> + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" + font-size="10pt" + font-family="serif" + line-height="14pt" > + XML Recommendation - p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines text title level 1--> + <fo:block font-size="18pt" + font-family="sans-serif" + line-height="24pt" + space-after.optimum="15pt" + background-color="blue" + color="white" + text-align="center" + padding-top="0pt"> + Extensible Markup Language (XML) 1.0 + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="0pt"> + Abstract + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- defines text title level 2--> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="20pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="0pt"> + Status of this document + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. For further information go to + <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link> + </fo:block> + + <!-- Normal text --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start"> + This document specifies a syntax created by subsetting an existing, widely used international text processing standard + (Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It + is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. A list of current W3C + Recommendations and other technical documents can be found at http://www.w3.org/TR. + </fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/pagination/franklin_2pageseqs.fo b/examples/fo/pagination/franklin_2pageseqs.fo new file mode 100644 index 000000000..3eabfde51 --- /dev/null +++ b/examples/fo/pagination/franklin_2pageseqs.fo @@ -0,0 +1,1078 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="noheaders_center" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + </fo:simple-page-master> + + <fo:simple-page-master master-name="headers_right" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="3.5cm" + margin-right="1.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:simple-page-master master-name="headers_left" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="1.5cm" + margin-right="3.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:simple-page-master master-name="headers_center" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:page-sequence-master master-name="run1"> + <fo:repeatable-page-master-reference master-reference="noheaders_center" + maximum-repeats="6"/> + </fo:page-sequence-master> + + <fo:page-sequence-master master-name="run2"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference + master-reference="headers_center" + page-position="first" /> + <fo:conditional-page-master-reference + master-reference="headers_right" + odd-or-even="odd" /> + <fo:conditional-page-master-reference + master-reference="headers_left" + odd-or-even="even" /> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="run1" initial-page-number="1"> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines local TOC --> + <fo:block font-size="10pt" + font-family="serif" + line-height="12pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="6pt"> +Journey across the barren Grounds - Difficulty and delay in crossing Copper-Mine River - +Melancholy and fatal Results thereof - Extreme Misery of the whole Party - Murder of +Mr. Hood - Death of several of the Canadians - Desolate State of Fort Enterprise - +Distress suffered at that Place - Dr. Richardson's Narrative - Mr. Back's Narrative - +Conclusion. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">1821. August 17. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +MY original intention, whenever the season should +compel us to relinquish the survey, had been to return by the way +of the Copper-Mine River, and in pursuance of my arrangement +with the Hook to travel to Slave Lake through the line of woods +extending thither by the Great Bear and Marten Lakes, but our +scanty stock of provision and the length of the voyage rendered it +necessary to make for a nearer place. We had already found that +the country, between Cape Barrow and the Copper-Mine River, +would not supply our wants, and this it seemed probable would now +be still more the case ; besides, at this advanced season, we expected +the frequent recurrence of gales, which would cause great detention, +if not danger in proceeding along that very rocky part of the coast. +I determined, therefore, to make at once for Arctic Sound, where +we had found the animals more numerous than at any other place ; +and entering Hood's River, to advance up that stream as far as it +was navigable, and then to construct small canoes out of the +materials of the larger ones, which could be carried in crossing the +barren grounds to Fort Enterprise. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 19. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were almost beaten out of our comfortless abodes +by rain during the night, and this morning the gale continued +without diminution. The thermometer fell to 33 deg. Two men were +sent with Junius to search for the deer which Augustus had killed. +Junius returned in the evening bringing part of the meat, but owing +to the thickness of the weather, his companions parted from him +and did not make their appearance. Divine service was read. On +the 20th we were presented with the most chilling prospect, the +small pools of water being frozen over, the ground being covered +with snow, and the thermometer at the freezing point at mid-day. +Flights of geese were passing to the southward. The wind however +was more moderate, having changed to the eastward. Considerable +anxiety prevailing respecting Belanger and Michel, the two men +who strayed from Junius yesterday, the rest were sent out to look +for them. The search was successful, and they all returned in the +evening. The stragglers were much fatigued, and had suffered +severely from the cold, one of them having his thighs frozen, and +what under our present circumstances was most grievous, they had +thrown away all the meat. The wind during the night returned to +the north-west quarter, blew more violently than ever, and raised a +very turbulent sea. The next day did not improve our condition, +the snow remained on the ground, and the small pools were frozen. +Our hunters were sent out, but they returned after a fatiguing +day's march without having seen any animals. We made a scanty +meal off a handful of pemmican, after which only half a bag +remained. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind abated after midnight, and the surf diminished rapidly, +which caused us to be on the alert at a very early hour on the 22d, +but we had to wait until six A.M. for the return of Augustus who +had continued out all night on an unsuccessful pursuit of deer. +It appears that he had walked a few miles farther along the coast, +than the party had done on the 18th, and from a sketch he drew on +the sand, we were confirmed in our former opinion that the shore +inclined more to the eastward beyond Point Turnagain. He also +drew a river of considerable size, that discharges its waters into +Walker's Bay; on the banks of which stream he saw a piece of +wood, such as the Esquimaux use in producing fire, and other marks +so fresh that he supposed they had recently visited the spot. We +therefore left several iron materials for them. Our men, cheered by +the prospect of returning, embarked with the utmost alacrity; and, +paddling with unusual vigour, carried us across Riley's and Walker's +Bays, a distance of twenty miles before noon, when we landed on +Slate-Clay Point, as the wind had freshened too much to permit us +to continue the voyage. The whole party went to hunt, but returned +without success in the evening, drenched with the heavy rain which +commenced soon after they had set out. Several deer were seen, +but could not be approached in this naked country; and as our +stock of pemmican did not admit of serving out two meals, we went +dinnerless to bed. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Soon after our departure to-day, a sealed tin-case, sufficiently +buoyant to float, was thrown overboard, containing a short account of +our proceedings, and the position of the most conspicuous points. +The wind blew off the land, the water was smooth, and as the sea +is in this part more free from islands than in any other, there was +every probability of its being driven off the shore into the current ; +which, as I have before mentioned, we suppose, from the circumstance +of Mackenzie's River being the only known stream that +brings down the wood we have found along the shores, to set to the +eastward. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 23. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +A severe frost caused us to pass a comfortless night. +At two P.M. we set sail, and the men voluntarily launched out to +make a traverse of fifteen miles across Melville Sound, before a +strong wind and heavy sea. The privation of food, under which +our voyagers were then labouring, absorbed every other terror; +otherwise the most powerful persuasion could not have induced +them to attempt such a traverse. It was with the utmost difficulty +that the canoes were kept from turning their broadsides to the +waves, though we sometimes steered with all the paddles. One of +them narrowly escaped being overset by this accident, happening +in mid-channel, where the waves were so high that the mast-head +of our canoe was often hid from the other, though it was sailing +within hail. The annexed plate, from Mr. Back's sketch, will convey +to the reader an accurate idea of the peril of our situation. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The traverse, however, was made;we were then near a high +rocky lee shore, on which a heavy surf was beating. The wind +being on the beam, the canoes drifted fast to leeward; and, on +rounding a point, the recoil of the sea from the rocks was so great +that they were with difficulty kept from foundering. We looked in +vain for a sheltered bay to land in ; but, at length, being unable to +weather another point, we were obliged to put ashore on the open +beach, which, fortunately, was sandy at this spot. The debarkation +was effected in the manner represented in the plate; and, fortunately, +without further injury than the splitting of the head of +the second canoe, which was easily repaired. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Our encampment being near to the place where we killed the deer +on the 11th, almost the whole party went out to hunt, but they +returned in the evening without having seen any game. The +berries, however, were ripe and plentiful, and, with the addition +of some country tea, furnished a supper. There were some showers +in the afternoon,and the weather was cold, the thermometer +being 42 deg, but the evening and night were calm and fine. It may be +remarked that the mosquitoes disappeared when the late gales +commenced. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 25. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at three A. M., we stretched across +the eastern entrance of Bathurst's Inlet, and arrived at an island, +which I have named after Colonel Barry, of Newton Barry. Some +deer being seen on the beach, the hunters went in pursuit of +them, and succeeded in killing three females, which enabled us to +save our last remaining meal of pemmican. They saw also some +fresh tracks of musk oxen on the banks of a small stream, which +flowed into a lake in the centre of the island. These animals must +have crossed a channel, at least, three miles wide, to reach the nearest +of these islands. Some specimens of variegated pebbles and jasper +were found here imbedded in the amygdaloidal rock. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Re-embarking at two P.M., and continuing through what was +supposed to be a channel between two islands, we found our passage +barred by a gravelly isthmus of only ten yards in width ; the canoes +and cargoes were carried across it, and we passed into Bathurst's Inlet +through another similar channel, bounded on both sides by steep +rocky hills. The wind then changing from S.E. to N.W. brought +heavy rain, and we encamped at seven P.M., having advanced +eighteen miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Starting this morning with a fresh breeze in our favour, +we soon reached that part of Barry's Island where the canoes were +detained on the 2d and 3rd of this month, and contrary to what we +then experienced, the deer were now plentiful. The hunters killed +two, and we were relieved from all apprehension of an immediate +want of food. One would suppose the deer were about to retire to +the main shore from their assembling at this time in such numbers +on the islands nearest to the coast. Those we saw were generally +females with their young, and all of them very lean. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind continued in the same direction until we had rounded +Point Wollaston, and then changed to a quarter, which enabled us +to steer for Hood's River, which we ascended as high as the first +rapid and encamped. Here terminated our voyage on the Arctic +sea, during which we had gone over six hundred and fifty geographical +miles. Our Canadian voyagers could not restrain their expressions +of joy at having turned their backs on the sea, and +they passed the evening talking over their past adventures with +much humour and no little exaggeration. The consideration that +the most painful, and certainly the most hazardous, part of the +journey was yet to come, did not depress their spirits at all. It is +due to their character to mention that they displayed much courage +in encountering the dangers of the sea, magnified to them by their +novelty. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The shores between Cape Barrow and Cape Flinders, including +the extensive branches of Arctic and Melville Sounds, and Bathurst's +Inlet, may be comprehended in one great gulf, which I have distinguished +by the appellation of George IV.'s Coronation Gulf, in +honour of His Most Gracious Majesty, the latter name being added +to mark the time of its discovery. The Archipelago of islands which +fringe the coast from Copper-Mine River to Point Turnagain, I have +named in honour of His Royal Highness the Duke of York. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +It may be deserving of notice that the extremes in temperature +of the sea water during our voyage were 53 deg and 35 deg, but its general +temperature was between 43 deg and 48 deg. Throughout our return from +Point Turnagain we observed that the sea had risen several feet +above marks left at our former encampments. This may, perhaps, +be attributed to the north-west gales. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 26. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Previous to our departure this morning, an assortment +of iron materials, beads, looking-glasses, and other articles +were put up in a conspicuous situation for the Esquimaux, and the +English Union was planted on the loftiest sand-hill, where it might +be seen by any ships passing in the offing. Here also, was deposited +in a tin bow a letter containing an outline of our proceedings, the +latitude and longitude of the principal places, and the course we +intended to pursue towards Slave Lake. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start" + break-after="page" > +Embarking at eight A.M. we proceeded up the river, which is full +of sandy shoals, but sufficiently deep for canoes in the channels. It is +from one hundred to two hundred yards wide, and is bounded by high +and steep banks of clay. We encamped at a cascade of eighteen or +twenty feet high, which is produced by a ridge of rock crossing the +river, and the nets were set. A mile below this cascade Hood's +River is joined by a stream half its own size, which I have called +James' Branch. Bear and deer tracks had been numerous on the +banks of the river when we were here before, but not a single recent +one was to be seen at this time. Credit, however, killed a small +deer at some distance inland, which, with the addition of berries, +furnished a delightful repast this evening. The weather was remarkably +fine, and the temperature so mild, that the mosquitoes again +made their appearance, but not in any great numbers. Our distance +made to-day was not more than six miles. + </fo:block> +</fo:flow> +</fo:page-sequence> + + <fo:page-sequence master-reference="run2" initial-page-number="7"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="start" font-size="10pt" + font-family="sans-serif" + line-height="10pt" > + John Franklin - Journey to the Shores of the Polar Sea + </fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="end" + font-size="10pt" + font-family="sans-serif" + line-height="14pt" > + p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning the net furnished us with ten white fish +and trout. Having made a further deposit of iron work for the +Esquimaux we pursued our voyage up the river, but the shoals and +rapids in this part were so frequent, that we walked along the banks +the whole day, and the crews laboured hard in carrying the canoes +thus lightened over the shoals or dragging them up the rapids, yet +our journey in a direct line was only about seven miles. In the +evening we encamped at the lower end of a narrow chasm through +which the river flows for upwards of a mile. The walls of this +chasm are upwards of two hundred feet high, quite perpendicular, +and in some places only a few yards apart. The river precipitates +itself into it over a rock, forming two magnificent and picturesque +falls close to each other. The upper fall is about sixty feet high, and +the lower one at least one hundred, but perhaps considerably more, +for the narrowness of the chasm into which it fell prevented us from +seeing its bottom, and we could merely discern the top of the spray +far beneath our feet. The lower fall is divided into two, by an +insulated column of rock which rises about forty feet above it. The +whole descent of the river at this place probably exceeds two +hundred and fifty feet. The rock is very fine felspathose sandstone. +It has a smooth surface and a light red colour. I have named these +magnificent cascades Wilberforce Falls, as a tribute of my respect +for that distinguished philanthropist and Christian. Messrs. Back and +Hood took beautiful sketches of this majestic scene, which are +combined in the annexed plate. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The river being surveyed from the summit of a hill, above these +falls, appeared so rapid and shallow, that it seemed useless to +attempt proceeding any farther in the large canoes. I therefore +determined on constructing out of their materials two smaller ones +of sufficient size to contain three persons, for the purpose of crossing +any river that might obstruct our progress. This operation was +accordingly commenced, and by the 31st both the canoes being +finished, we prepared for our departure on the following day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The leather which had been preserved for making shoes was +equally divided among the men, two pairs of flannel socks were given +to each person, and such articles of warm clothing as remained, were +issued to those who most required them. They were also furnished +with one of the officers' tents. This being done, I communicated to +the men my intention of proceeding in as direct a course as possible +to the part of Point Lake, opposite to our spring encampment +which was only distant one hundred and forty-nine miles in a +straight line. They received the communication cheerfully, considered +the journey to be short, and left me, in high spirits, to +arrange their own packages. The stores, books, &c., which were not +absolutely necessary to be carried, were then put up in boxes to be +left en cache here, in order that the men's burdens might be as light +as possible. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning was warm, and very fine. Every one was on +the alert at an early hour, being anxious to commence the journey. +Our luggage consisted of ammunition, nets, hatchets, ice chisels, +astronomical instruments, clothing, blankets, three kettles, and +the two canoes, which were each carried by one man. The +officers carried such a portion of their own things as their strength +would permit;the weight carried by each man was about ninety +pounds, and with this we advanced at the rate of about a mile an +hour, including rests. In the evening the hunters killed a lean cow, +out of a large drove of musk-oxen; but the men were too much +laden to carry more than a small portion of its flesh. The alluvial +soil, which towards the mouth of the river spreads into plains, +covered with grass and willows, was now giving place to a more +barren and hilly country; so that we could but just collect sufficient +brush wood to cook our suppers. The part of the river we skirted +to-day was shallow, and flowed over a bed of sand ; its width about +one hundred and twenty yards. About midnight our tent was blown +down by a squall, and we were completely drenched with rain before +it could be re-pitched. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the morning of the 1st of September a fall of snow took +place; the canoes became a cause of delay, by the difficulty of +carrying them in a high wind, and they sustained much damage +from the falls of those who had charge of them. The face of the +country was broken by hills of moderate elevation, but the ground +was plentifully strewed with small stones, which, to men bearing +heavy burthens, and whose feet were protected only by soft moose +skin shoes, occasioned great pain. At the end of eleven miles we +encamped, and sent for a musk-ox and a deer, which St. Germain +and Augustus had killed. The day was extremely cold, the ther-mometer +varying between 34 deg and 36 deg. In the afternoon a heavy +fall of snow took place, on the wind changing from north-west to +south-west. We found no wood at the encampment, but made a +fire of moss to cook the supper, and crept under our blankets for +warmth. At sun-rise the thermometer was at 31 deg, and the wind +fresh from north-west; but the weather became mild in the course +of the forenoon, and the snow disappeared from the gravel. The +afternoon was remarkably fine, and the thermometer rose to 50 deg. +One of the hunters killed a musk-ox. The hills in this part are +lower and more round-backed than those we passed yesterday, and +exhibited but little naked rock; they were covered with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having ascertained from the summit of the highest hill near the +tents, that the river continued to preserve a west course; and fear-ing +that by pursuing it further we might lose much time, and un-necessarily +walk over a great deal of ground, I determined on +quitting its banks the next day, and making as directly as we could for +Point Lake. We accordingly followed the river on the 3d, only to +the place where the musk-ox had been killed last evening, and after +the meat was procured, crossed the river in our two canoes lashed +together. We now emerged from the valley of the river, and entered +a level, but very barren, country, varied only by small lakes and +marshes, the ground being covered with small stones. Many old tracks +of rein-deer were seen in the clayey soil, and some more recent +ones of the musk-ox. We encamped on the borders of Wright's +River, which flows to the eastward; the direct distance walked to-day +being ten miles and three-quarters. The next morning was +very fine, and,as the day advanced, the weather became quite +warm. We set out at six A. M., and, having forded the river, +walked over a perfectly level country, interspersed with small lakes, +which communicated with each other, by streams running in various +directions. No berry-bearing plants were found in this part, the +surface of the earth being thinly covered in the moister places with +a few grasses, and on the drier spots with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having walked twelve miles and a half, we encamped at seven P.M., +and distributed our last piece of pemmican, and a little arrow-root +for supper, which afforded but a scanty meal. This evening was +warm, but dark clouds overspread the sky. Our men now began to +find their burdens very oppressive, and were much fatigued by this +day's march, but did not complain. One of them was lame from an +inflammation in the knee. Heavy rain commenced at midnight, and +continued without intermission until five in the morning, when it +was succeeded by snow on the wind changing to north-west, which +soon increased to a violent gale. As we had nothing to eat, and +were destitute of the means of making a fire, we remained in our +beds all the day ; but the covering of our blankets was insufficient to +prevent us from feeling the severity of the frost, and suffering in-convenience +from the drifting of the snow into our tents. There +was no abatement of the storm next day ; our tents were completely +frozen, and the snow had drifted around them to a depth of three +feet, and even in the inside there was a covering of several inches on +our blankets. Our suffering from cold, in a comfortless canvass tent +in such weather, with the temperature at 20 deg, and without fire, +will easily be imagined;it was, however, less than that which we +felt from hunger. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The morning of the 7th cleared up a little, but the wind was still +strong, and the weather extremely cold. From the unusual con-tinuance +of the storm, we feared the winter had set in with all its +rigour, and that by longer delay we should only be exposed to an +accumulation of difficulties; we therefore prepared for our journey, +although we were in a very unfit condition for starting, being weak +from fasting, and our garments stiffened by the frost. We had no +means of making a fire to thaw them, the moss, at all times difficult +to kindle, being now covered with ice and snow. A considerable +time was consumed in packing up the frozen tents and bed clothes, +the wind blowing so strong that no one could keep his hands long +out of his mittens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Just as we were about to commence our march, I was seized with +a fainting fit, in consequence of exhaustion and sudden exposure to +the wind; but after eating a morsel of portable soup, I recovered, so +far as to be able to move on. I was unwilling at first to take this +morsel of soup, which was diminishing the small and only remaining +meal for the party; but several of the men urged me to it, with +much kindness. The ground was covered a foot deep with snow, +the margin of the lakes was incrusted with ice, and the swamps over +which we had to pass were entirely frozen; but the ice not being +sufficiently strong to bear us, we frequently plunged knee-deep in +water. Those who carried the canoes were repeatedly blown down +by the violence of the wind, and they often fell, from making an +insecure step on a slippery stone; on one of these occasions, the +largest canoe was so much broken as to be rendered utterly unser-viceable. +This was felt as a serious disaster, as the remaining canoe +having through mistake been made too small, it was doubtful +whether it would be sufficient to carry us across a river. Indeed +we had found it necessary in crossing Hood's River, to lash the two +canoes together. As there was some suspicion that Benoit, who +carried the canoe, had broken it intentionally, he having on a former +occasion been overheard by some of the men to say, that he would +do so when he got it in charge, we closely examined him on the +point; he roundly denied having used the expressions attributed to +him, and insisted that it was broken by his falling accidentally; and +as he brought men to attest the latter fact, who saw him tumble, we +did not press the matter further. I may here remark that our +people had murmured a good deal at having to carry two canoes, +though they were informed of the necessity of taking both, in case +it should be deemed advisable to divide the party; which it had +been thought probable we should be obliged to do, if animals proved +scarce, in order to give the whole the better chance of procuring +subsistence, and also for the purpose of sending forward some of the +best walkers to search for Indians, and to get them to meet us with +supplies of provision. The power of doing this was now at an end. +As the accident could not be remedied we turned it to the best +account by making a fire of the bark and timbers of the broken +vessel, and cooked the remainder of our portable soup and arrow-root. +This was a scanty meal after three days' fasting, but it served +to allay the pangs of hunger, and enabled us to proceed at a quicker +pace than before. The depth of the snow caused us to march in +Indian file, that is in each other's steps; the voyagers taking it in +turn to lead the party. A distant object was pointed out to this +man in the direction we wished to take, and Mr. Hood followed +immediately behind him, to renew the bearings, and keep him from +deviating more than could be helped from the mark. It may be +here observed, that we proceeded in this manner throughout our +route across the barren grounds. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the afternoon we got into a more hilly country, where the +ground was strewed with large stones. The surface of these was +covered with lichens of the genus gyrophora, which the Canadians +term tripe de roche. A considerable quantity was gathered, and +with half a partridge each, (which were shot in the course of the +day,) furnished us with a slender supper, which we cooked with a +few willows, dug up from beneath the snow. We passed a comfortless +night in our damp clothes, but took the precaution of sleeping upon +our socks and shoes to prevent them from freezing. This plan was +afterwards adopted throughout the journey. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +At half past five in the morning we proceeded; and after walking +about two miles, came to Cracroft's River, flowing to the westward, +with a very rapid current over a rocky channel. We had much diffi-culty +in crossing this, the canoe being useless, not only from the bot-tom +of the channel being obstructed by large stones, but also from its +requiring gumming, an operation which, owing to the want of wood +and the frost, we were unable to perform. However, after following +the course of the river some way, we effected a passage by means of a +range of large rocks that crossed a rapid. As the current was strong, +and many of the rocks were covered with water to the depth of two +or three feet, the men were exposed to much danger in carrying their +heavy burthens across, and several of them actually slipped into the +stream, but were immediately rescued by the others. Junius went +farther up the river in search of a better crossing place, and did not +rejoin us to-day. As several of the party were drenched from head to +foot, and we were all wet to the middle, our clothes became stiff with +the frost, and we walked with much pain for the remainder of the day. +The march was continued to a late hour, being anxious to rejoin the +hunters who had gone before, but we were obliged to encamp at the +end of ten miles and a quarter, without seeing them. Our only +meal to-day consisted of a partridge each, (which the hunters shot,) +mixed with tripe de roche. This repast although scanty for men, +with appetites such as our daily fatigue created, proved a cheerful +one, and was received with thankfulness. Most of the men had to +sleep in the open air, in consequence of the absence of Credit, who +carried their tent; but we fortunately found an unusual quantity of +roots to make a fire, which prevented their suffering much from the +cold, though the thermometer was at 17 deg. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We started at six on the 9th, and at the end of two miles re-gained +our hunters, who were halting on the borders of a lake amidst +a clump of stunted willows. This lake stretched to the westward as +far as we could see, and its waters were discharged by a rapid stream +one hundred and fifty yards wide. Being entirely ignorant where +we might be led by pursuing the course of the lake, and dreading +the idea of going a mile unnecessarily out of the way, we deter-mined +on crossing the river if possible; and the canoe was gummed +for the purpose, the willows furnishing us with fire. But we had to +await the return of Junius before we could make the traverse. In +the mean time we gathered a little tripe de roche, and breakfasted +upon it and a few partridges that were killed in the morning. +St. Germain and Adam were sent upon some recent tracks of deer. +Junius arrived in the afternoon, and informed us that he had seen +a large herd of musk-oxen on the banks of Cracroft's River, and had +wounded one of them, but it had escaped. He brought about four +pounds of meat, the remains of a deer that had been devoured by +the wolves. The poor fellow was much fatigued, having walked +throughout the night, but as the weather was particularly favourable +for our crossing the river, we could not allow him to rest. After he +had taken some refreshment we proceeded to the river. The canoe +being put into the water was found extremely ticklish, but it was +managed with much dexterity by St. Germain, Adam, and Peltier, +who ferried over one passenger at a time, causing him to lie flat in its +bottom, by no means a pleasant position, owing to its leakiness, but +there was no alternative. The transport of the whole party was +effected by five o'clock, and we walked about two miles further, and +encamped, having come five miles and three quarters on a south-west +course. Two young alpine hares were shot by St. Germain, which, +with the small piece of meat brought in by Junius, furnished the +supper of the whole party. There was no tripe de roche here. The +country had now become decidedly hilly, and was covered with snow. +The lake preserved its western direction, as far as I could see from +the summit of the highest mountain near the encampment. We +subsequently learned from the Copper Indians, that the part at +which we had crossed the river was the Congecatha-wha-chaga of +Hearne, of which I had little idea at the time, not only from the +difference of latitude, but also from its being so much farther east of +the mouth of the Copper-Mine River, than his track is laid down. +He only making one degree and three quarters difference of lon-gitude, +and we, upwards of four. Had I been aware of the fact, +several days harassing march, and a disastrous accident would have +been prevented by keeping on the western side of the lake, instead +of crossing the river. We were informed also, that this river is +the Anatessy or River of Strangers, and is supposed to fall into +Bathurst's Inlet; but although the Indians have visited its mouth, +their description was not sufficient to identify it with any of the +rivers whose mouths we had seen. It probably falls in that part of +the coast which was hid from our view by Goulburn's or Elliot's +Islands. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 10. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We had a cold north wind, and the atmosphere +was foggy. The thermometer 18 deg at five A.M. In the course of +our march this morning, we passed many small lakes; and the +ground becoming higher and more hilly as we receded from the +river, was covered to a much greater depth with snow. This ren-dered +walking not only extremely laborious, but also hazardous in +the highest degree;for the sides of the hills, as is usual throughout +the barren grounds, abounding in accumulations of large angular +stones, it often happened that the men fell into the interstices +with their loads on their backs, being deceived by the smooth +appearance of the drifted snow. If any one had broken a limb +here, his fate would have been melancholy indeed; we could neither +have remained with him, nor carried him on. We halted at ten to +gather tripe de roche,but it was so frozen, that we were quite +benumbed with cold before a sufficiency could be collected even for +a scanty meal. On proceeding our men were somewhat cheered, by +observing on the sandy summit of a hill, from whence the snow had +been blown, the summer track of a man; and afterwards by seeing +several deer tracks on the snow. About noon the weather cleared +up a little, and, to our great joy, we saw a herd of musk-oxen +grazing in a valley below us. The party instantly halted, and the +best hunters were sent out; they approached the animals with the +utmost caution, no less than two hours being consumed before they +got within gun-shot. In the mean time we beheld their proceed-ings +with extreme anxiety, and many secret prayers were, doubtless, +offered up for their success. At length they opened their fire, and +we had the satisfaction of seeing one of the largest cows fall; another +was wounded, but escaped. This success infused spirit into our +starving party. To skin and cut up the animal was the work of a +few minutes. The contents of its stomach were devoured upon +the spot, and the raw intestines, which were next attacked, were +pronounced by the most delicate amongst us to be excellent. A few +willows, whose tops were seen peeping through the snow in the bottom +of the valley, were quickly grubbed, the tents pitched, and supper +cooked, and devoured with avidity. This was the sixth day since we +had had a good meal. The tripe de roche, even where we got +enough, only serving to allay the pangs of hunger for a short time. +After supper, two of the hunters went in pursuit of the herd, but +could not get near them. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were detained all the next day by a strong southerly wind, +and were much incommoded in the tents by the drift snow. The +temperature was 20 deg. The average for the last ten days about +24.5 deg. We restricted ourselves to one meal to-day as we were at +rest, and there was only meat remaining sufficient for the next day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The gale had not diminished on the 12th, and, as we were +fearful of its continuance for some time, we determined on going +forward; our only doubt regarded the preservation of the canoe, +but the men promised to pay particular attention to it, and the +most careful persons were appointed to take it in charge. The snow +was two feet deep, and the ground much broken, which rendered +the march extremely painful. The whole party complained more of +faintness and weakness than they had ever done before; their +strength seemed to have been impaired by the recent supply of +animal food. In the afternoon the wind abated, and the snow ceased; +cheered with the change we proceeded forward at a quicker pace, +and encamped at six P. M., having come eleven miles. Our supper +consumed the last of our meat. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We set out on the 13th, in thick hazy weather, and, after an hour's +march, had the extreme mortification to find ourselves on the +borders of a large lake, which we subsequently learned from the +Indians was named Contwoy-to, or Rum Lake; neither of its extre- +mities could be seen, and as the portion which lay to the east +seemed the widest, we coasted along to the westward portion in +search of a crossing-place. This lake being bounded by steep and +lofty hills, our march was very fatiguing. Those sides which were +exposed to the sun, were free from snow, and we found upon them +some excellent berries. We encamped at six P. M., having come +only six miles and a half. Credit was then missing, and he did not +return during the night. We supped off a single partridge and +some tripe de roche;this unpalatable weed was now quite nau-seous +to the whole party, and in several it produced bowel com-plaints. +Mr. Hood was the greatest sufferer from this cause. This +evening we were extremely distressed, at discovering that our im-provident +companions,since we left Hood's River, had thrown +away three of the fishing-nets, and burnt the floats ; they knew we +had brought them to procure subsistence for the party, when the +animals should fail, and we could scarcely believe the fact of their +having wilfully deprived themselves of this resource, especially +when we considered that most of them had passed the greater part of +their servitude in situations where the nets alone had supplied them +with food. Being thus deprived of our principal resource, that of +fishing, and the men evidently getting weaker every day, it became +necessary to lighten their burthens of every thing except ammunition, +clothing, and the instruments that were required to find our +way. I, therefore, issued directions to deposit at this encampment +the dipping needle, azimuth compass, magnet, a large thermometer, +and a few books we had carried, having torn out of these such parts +as we should require to work the observations for latitude and +longitude. I also promised,as an excitement to the efforts in +hunting, my gun to St. Germain, and an ample compensation to +Adam, or any of the other men who should kill any animals. +Mr. Hood, on this occasion, lent his gun to Michel, the Iroquois, +who was very eager in the chase, and often successful. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 14. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +This morning the officers being assembled round +a small fire, Perrault presented each of us with a small piece of meat +which he had saved from his allowance. It was received with great +thankfulness, and such an act of self-denial and kindness, being +totally unexpected in a Canadian voyager, filled our eyes with tears. +In directing our course to a river issuing from the lake, we met +Credit, who communicated the joyful intelligence of his having +killed two deer in the morning. We instantly halted, and having +shared the deer that was nearest to us, prepared breakfast. After +which, the other deer was sent for, and we went down to the river, +which was about three hundred yards wide, and flowed with +great velocity through a broken rocky channel. Having searched +for a part where the current was most smooth, the canoe was +placed in the water at the head of a rapid, and St. Germain, Solomon +Belanger, and I, embarked in order to cross. We went from the +shore very well, but in mid-channel the canoe became difficult to +manage under our burden as the breeze was fresh. The current +drove us to the edge of the rapid, when Belanger unfortunately +applied his paddle to avert the apparent danger of being forced +down it, and lost his balance. The canoe was overset in con-sequence +in the middle of the rapid. We fortunately kept hold of +it, until we touched a rock where the water did not reach higher +than our waists; here we kept our footing, notwithstanding the +strength of the current, until the water was emptied out of the +canoe. Belanger then held the canoe steady whilst St. Germain +placed me in it, and afterwards embarked himself in a very dexterous +manner. It was impossible, however, to embark Belanger, +as the canoe would have been hurried down the rapid, the moment +he should have raised his foot from the rock on which he stood. +We were, therefore, compelled to leave him in his perilous situation. +We had not gone twenty yards before the canoe, striking on a +sunken rock, went down. The place being shallow, we were again +enabled to empty it, and the third attempt brought us to the shore. +In the mean time Belanger was suffering extremely, immersed to +his middle in the centre of a rapid, the temperature of which was +very little above the freezing point, and the upper part of his body +covered with wet clothes, exposed in a temperature not much above +zero, to a strong breeze. He called piteously for relief, and +St. Germain on his return endeavoured to embark him, but in vain. +The canoe was hurried down the rapid, and when he landed he was +rendered by the cold incapable of further exertion, and Adam at-tempted +to embark Belanger, but found it impossible. An attempt +was next made to carry out to him a line, made of the slings of the +men's loads. This also failed, the current acting so strongly upon +it, as to prevent the canoe from steering, and it was finally broken +and carried down the stream. At length, when Belanger's strength +seemed almost exhausted, the canoe reached him with a small cord +belonging to one of the nets, and he was dragged perfectly senseless +through the rapid. By the direction of Dr. Richardson, he was +instantly stripped, and being rolled up in blankets, two men un-dressed +themselves and went to bed with him; but it was some +hours before he recovered his warmth and sensations. As soon as +Belanger was placed in his bed, the officers immediately sent over +my blankets, and a person to make a fire. Augustus brought the +canoe over, and in returning he was obliged to descend both the +rapids, before he could get across the stream; which hazardous +service he performed with the greatest coolness and judgment. It +is impossible to describe my sensations as I witnessed the various +unsuccessful attempts to relieve Belanger. The distance prevented +my seeing distinctly what was going on, and I continued pacing up +and down upon the rock on which I landed, regardless of the +coldness of my drenched and stiffening garments. The canoe, in +every attempt to reach him, was hurried down the rapid, and was +lost to the view amongst the rocky islets, with a rapidity that +seemed to threaten certain destruction; once, indeed, I fancied that +I saw it overwhelmed in the waves. Such an event would have +been fatal to the whole party. Separated as I was from my com-panions, +without gun, ammunition, hatchet, or the means of making +a fire, and in wet clothes, my doom would have been speedily sealed. +My companions too, driven to the necessity of coasting the lake, +must have sunk under the fatigue of rounding its innumerable arms +and bays, which, as we have learned from the Indians, are very +extensive. By the goodness of Providence, however, we were spared +at that time, and some of us have been permitted to offer up our +thanksgivings, in a civilized land, for the signal deliverances we then +and afterwards experienced. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/pagination/franklin_alt.fo b/examples/fo/pagination/franklin_alt.fo new file mode 100644 index 000000000..372f77bd5 --- /dev/null +++ b/examples/fo/pagination/franklin_alt.fo @@ -0,0 +1,1053 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="right" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="3.5cm" + margin-right="1.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:simple-page-master master-name="left" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="1.5cm" + margin-right="3.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:simple-page-master master-name="center" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:page-sequence-master master-name="alternating"> + <fo:repeatable-page-master-alternatives maximum-repeats="no-limit"> + <fo:conditional-page-master-reference master-reference="right" + odd-or-even="odd" /> + <fo:conditional-page-master-reference master-reference="left" + odd-or-even="even" /> + <fo:conditional-page-master-reference master-reference="center"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="alternating" initial-page-number="1"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="start" font-size="10pt" + font-family="sans-serif" + line-height="10pt" > + John Franklin - Journey to the Shores of the Polar Sea + </fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="end" + font-size="10pt" + font-family="sans-serif" + line-height="14pt" > + p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines local TOC --> + <fo:block font-size="10pt" + font-family="serif" + line-height="12pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="6pt"> +Journey across the barren Grounds - Difficulty and delay in crossing Copper-Mine River - +Melancholy and fatal Results thereof - Extreme Misery of the whole Party - Murder of +Mr. Hood - Death of several of the Canadians - Desolate State of Fort Enterprise - +Distress suffered at that Place - Dr. Richardson's Narrative - Mr. Back's Narrative - +Conclusion. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">1821. August 17. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +MY original intention, whenever the season should +compel us to relinquish the survey, had been to return by the way +of the Copper-Mine River, and in pursuance of my arrangement +with the Hook to travel to Slave Lake through the line of woods +extending thither by the Great Bear and Marten Lakes, but our +scanty stock of provision and the length of the voyage rendered it +necessary to make for a nearer place. We had already found that +the country, between Cape Barrow and the Copper-Mine River, +would not supply our wants, and this it seemed probable would now +be still more the case ; besides, at this advanced season, we expected +the frequent recurrence of gales, which would cause great detention, +if not danger in proceeding along that very rocky part of the coast. +I determined, therefore, to make at once for Arctic Sound, where +we had found the animals more numerous than at any other place ; +and entering Hood's River, to advance up that stream as far as it +was navigable, and then to construct small canoes out of the +materials of the larger ones, which could be carried in crossing the +barren grounds to Fort Enterprise. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 19. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were almost beaten out of our comfortless abodes +by rain during the night, and this morning the gale continued +without diminution. The thermometer fell to 33 deg. Two men were +sent with Junius to search for the deer which Augustus had killed. +Junius returned in the evening bringing part of the meat, but owing +to the thickness of the weather, his companions parted from him +and did not make their appearance. Divine service was read. On +the 20th we were presented with the most chilling prospect, the +small pools of water being frozen over, the ground being covered +with snow, and the thermometer at the freezing point at mid-day. +Flights of geese were passing to the southward. The wind however +was more moderate, having changed to the eastward. Considerable +anxiety prevailing respecting Belanger and Michel, the two men +who strayed from Junius yesterday, the rest were sent out to look +for them. The search was successful, and they all returned in the +evening. The stragglers were much fatigued, and had suffered +severely from the cold, one of them having his thighs frozen, and +what under our present circumstances was most grievous, they had +thrown away all the meat. The wind during the night returned to +the north-west quarter, blew more violently than ever, and raised a +very turbulent sea. The next day did not improve our condition, +the snow remained on the ground, and the small pools were frozen. +Our hunters were sent out, but they returned after a fatiguing +day's march without having seen any animals. We made a scanty +meal off a handful of pemmican, after which only half a bag +remained. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind abated after midnight, and the surf diminished rapidly, +which caused us to be on the alert at a very early hour on the 22d, +but we had to wait until six A.M. for the return of Augustus who +had continued out all night on an unsuccessful pursuit of deer. +It appears that he had walked a few miles farther along the coast, +than the party had done on the 18th, and from a sketch he drew on +the sand, we were confirmed in our former opinion that the shore +inclined more to the eastward beyond Point Turnagain. He also +drew a river of considerable size, that discharges its waters into +Walker's Bay; on the banks of which stream he saw a piece of +wood, such as the Esquimaux use in producing fire, and other marks +so fresh that he supposed they had recently visited the spot. We +therefore left several iron materials for them. Our men, cheered by +the prospect of returning, embarked with the utmost alacrity; and, +paddling with unusual vigour, carried us across Riley's and Walker's +Bays, a distance of twenty miles before noon, when we landed on +Slate-Clay Point, as the wind had freshened too much to permit us +to continue the voyage. The whole party went to hunt, but returned +without success in the evening, drenched with the heavy rain which +commenced soon after they had set out. Several deer were seen, +but could not be approached in this naked country; and as our +stock of pemmican did not admit of serving out two meals, we went +dinnerless to bed. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Soon after our departure to-day, a sealed tin-case, sufficiently +buoyant to float, was thrown overboard, containing a short account of +our proceedings, and the position of the most conspicuous points. +The wind blew off the land, the water was smooth, and as the sea +is in this part more free from islands than in any other, there was +every probability of its being driven off the shore into the current ; +which, as I have before mentioned, we suppose, from the circumstance +of Mackenzie's River being the only known stream that +brings down the wood we have found along the shores, to set to the +eastward. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 23. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +A severe frost caused us to pass a comfortless night. +At two P.M. we set sail, and the men voluntarily launched out to +make a traverse of fifteen miles across Melville Sound, before a +strong wind and heavy sea. The privation of food, under which +our voyagers were then labouring, absorbed every other terror; +otherwise the most powerful persuasion could not have induced +them to attempt such a traverse. It was with the utmost difficulty +that the canoes were kept from turning their broadsides to the +waves, though we sometimes steered with all the paddles. One of +them narrowly escaped being overset by this accident, happening +in mid-channel, where the waves were so high that the mast-head +of our canoe was often hid from the other, though it was sailing +within hail. The annexed plate, from Mr. Back's sketch, will convey +to the reader an accurate idea of the peril of our situation. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The traverse, however, was made;we were then near a high +rocky lee shore, on which a heavy surf was beating. The wind +being on the beam, the canoes drifted fast to leeward; and, on +rounding a point, the recoil of the sea from the rocks was so great +that they were with difficulty kept from foundering. We looked in +vain for a sheltered bay to land in ; but, at length, being unable to +weather another point, we were obliged to put ashore on the open +beach, which, fortunately, was sandy at this spot. The debarkation +was effected in the manner represented in the plate; and, fortunately, +without further injury than the splitting of the head of +the second canoe, which was easily repaired. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Our encampment being near to the place where we killed the deer +on the 11th, almost the whole party went out to hunt, but they +returned in the evening without having seen any game. The +berries, however, were ripe and plentiful, and, with the addition +of some country tea, furnished a supper. There were some showers +in the afternoon,and the weather was cold, the thermometer +being 42 deg, but the evening and night were calm and fine. It may be +remarked that the mosquitoes disappeared when the late gales +commenced. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 25. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at three A. M., we stretched across +the eastern entrance of Bathurst's Inlet, and arrived at an island, +which I have named after Colonel Barry, of Newton Barry. Some +deer being seen on the beach, the hunters went in pursuit of +them, and succeeded in killing three females, which enabled us to +save our last remaining meal of pemmican. They saw also some +fresh tracks of musk oxen on the banks of a small stream, which +flowed into a lake in the centre of the island. These animals must +have crossed a channel, at least, three miles wide, to reach the nearest +of these islands. Some specimens of variegated pebbles and jasper +were found here imbedded in the amygdaloidal rock. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Re-embarking at two P.M., and continuing through what was +supposed to be a channel between two islands, we found our passage +barred by a gravelly isthmus of only ten yards in width ; the canoes +and cargoes were carried across it, and we passed into Bathurst's Inlet +through another similar channel, bounded on both sides by steep +rocky hills. The wind then changing from S.E. to N.W. brought +heavy rain, and we encamped at seven P.M., having advanced +eighteen miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Starting this morning with a fresh breeze in our favour, +we soon reached that part of Barry's Island where the canoes were +detained on the 2d and 3rd of this month, and contrary to what we +then experienced, the deer were now plentiful. The hunters killed +two, and we were relieved from all apprehension of an immediate +want of food. One would suppose the deer were about to retire to +the main shore from their assembling at this time in such numbers +on the islands nearest to the coast. Those we saw were generally +females with their young, and all of them very lean. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind continued in the same direction until we had rounded +Point Wollaston, and then changed to a quarter, which enabled us +to steer for Hood's River, which we ascended as high as the first +rapid and encamped. Here terminated our voyage on the Arctic +sea, during which we had gone over six hundred and fifty geographical +miles. Our Canadian voyagers could not restrain their expressions +of joy at having turned their backs on the sea, and +they passed the evening talking over their past adventures with +much humour and no little exaggeration. The consideration that +the most painful, and certainly the most hazardous, part of the +journey was yet to come, did not depress their spirits at all. It is +due to their character to mention that they displayed much courage +in encountering the dangers of the sea, magnified to them by their +novelty. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The shores between Cape Barrow and Cape Flinders, including +the extensive branches of Arctic and Melville Sounds, and Bathurst's +Inlet, may be comprehended in one great gulf, which I have distinguished +by the appellation of George IV.'s Coronation Gulf, in +honour of His Most Gracious Majesty, the latter name being added +to mark the time of its discovery. The Archipelago of islands which +fringe the coast from Copper-Mine River to Point Turnagain, I have +named in honour of His Royal Highness the Duke of York. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +It may be deserving of notice that the extremes in temperature +of the sea water during our voyage were 53 deg and 35 deg, but its general +temperature was between 43 deg and 48 deg. Throughout our return from +Point Turnagain we observed that the sea had risen several feet +above marks left at our former encampments. This may, perhaps, +be attributed to the north-west gales. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 26. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Previous to our departure this morning, an assortment +of iron materials, beads, looking-glasses, and other articles +were put up in a conspicuous situation for the Esquimaux, and the +English Union was planted on the loftiest sand-hill, where it might +be seen by any ships passing in the offing. Here also, was deposited +in a tin bow a letter containing an outline of our proceedings, the +latitude and longitude of the principal places, and the course we +intended to pursue towards Slave Lake. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at eight A.M. we proceeded up the river, which is full +of sandy shoals, but sufficiently deep for canoes in the channels. It is +from one hundred to two hundred yards wide, and is bounded by high +and steep banks of clay. We encamped at a cascade of eighteen or +twenty feet high, which is produced by a ridge of rock crossing the +river, and the nets were set. A mile below this cascade Hood's +River is joined by a stream half its own size, which I have called +James' Branch. Bear and deer tracks had been numerous on the +banks of the river when we were here before, but not a single recent +one was to be seen at this time. Credit, however, killed a small +deer at some distance inland, which, with the addition of berries, +furnished a delightful repast this evening. The weather was remarkably +fine, and the temperature so mild, that the mosquitoes again +made their appearance, but not in any great numbers. Our distance +made to-day was not more than six miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning the net furnished us with ten white fish +and trout. Having made a further deposit of iron work for the +Esquimaux we pursued our voyage up the river, but the shoals and +rapids in this part were so frequent, that we walked along the banks +the whole day, and the crews laboured hard in carrying the canoes +thus lightened over the shoals or dragging them up the rapids, yet +our journey in a direct line was only about seven miles. In the +evening we encamped at the lower end of a narrow chasm through +which the river flows for upwards of a mile. The walls of this +chasm are upwards of two hundred feet high, quite perpendicular, +and in some places only a few yards apart. The river precipitates +itself into it over a rock, forming two magnificent and picturesque +falls close to each other. The upper fall is about sixty feet high, and +the lower one at least one hundred, but perhaps considerably more, +for the narrowness of the chasm into which it fell prevented us from +seeing its bottom, and we could merely discern the top of the spray +far beneath our feet. The lower fall is divided into two, by an +insulated column of rock which rises about forty feet above it. The +whole descent of the river at this place probably exceeds two +hundred and fifty feet. The rock is very fine felspathose sandstone. +It has a smooth surface and a light red colour. I have named these +magnificent cascades Wilberforce Falls, as a tribute of my respect +for that distinguished philanthropist and Christian. Messrs. Back and +Hood took beautiful sketches of this majestic scene, which are +combined in the annexed plate. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The river being surveyed from the summit of a hill, above these +falls, appeared so rapid and shallow, that it seemed useless to +attempt proceeding any farther in the large canoes. I therefore +determined on constructing out of their materials two smaller ones +of sufficient size to contain three persons, for the purpose of crossing +any river that might obstruct our progress. This operation was +accordingly commenced, and by the 31st both the canoes being +finished, we prepared for our departure on the following day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The leather which had been preserved for making shoes was +equally divided among the men, two pairs of flannel socks were given +to each person, and such articles of warm clothing as remained, were +issued to those who most required them. They were also furnished +with one of the officers' tents. This being done, I communicated to +the men my intention of proceeding in as direct a course as possible +to the part of Point Lake, opposite to our spring encampment +which was only distant one hundred and forty-nine miles in a +straight line. They received the communication cheerfully, considered +the journey to be short, and left me, in high spirits, to +arrange their own packages. The stores, books, &c., which were not +absolutely necessary to be carried, were then put up in boxes to be +left en cache here, in order that the men's burdens might be as light +as possible. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning was warm, and very fine. Every one was on +the alert at an early hour, being anxious to commence the journey. +Our luggage consisted of ammunition, nets, hatchets, ice chisels, +astronomical instruments, clothing, blankets, three kettles, and +the two canoes, which were each carried by one man. The +officers carried such a portion of their own things as their strength +would permit;the weight carried by each man was about ninety +pounds, and with this we advanced at the rate of about a mile an +hour, including rests. In the evening the hunters killed a lean cow, +out of a large drove of musk-oxen; but the men were too much +laden to carry more than a small portion of its flesh. The alluvial +soil, which towards the mouth of the river spreads into plains, +covered with grass and willows, was now giving place to a more +barren and hilly country; so that we could but just collect sufficient +brush wood to cook our suppers. The part of the river we skirted +to-day was shallow, and flowed over a bed of sand ; its width about +one hundred and twenty yards. About midnight our tent was blown +down by a squall, and we were completely drenched with rain before +it could be re-pitched. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the morning of the 1st of September a fall of snow took +place; the canoes became a cause of delay, by the difficulty of +carrying them in a high wind, and they sustained much damage +from the falls of those who had charge of them. The face of the +country was broken by hills of moderate elevation, but the ground +was plentifully strewed with small stones, which, to men bearing +heavy burthens, and whose feet were protected only by soft moose +skin shoes, occasioned great pain. At the end of eleven miles we +encamped, and sent for a musk-ox and a deer, which St. Germain +and Augustus had killed. The day was extremely cold, the ther-mometer +varying between 34 deg and 36 deg. In the afternoon a heavy +fall of snow took place, on the wind changing from north-west to +south-west. We found no wood at the encampment, but made a +fire of moss to cook the supper, and crept under our blankets for +warmth. At sun-rise the thermometer was at 31 deg, and the wind +fresh from north-west; but the weather became mild in the course +of the forenoon, and the snow disappeared from the gravel. The +afternoon was remarkably fine, and the thermometer rose to 50 deg. +One of the hunters killed a musk-ox. The hills in this part are +lower and more round-backed than those we passed yesterday, and +exhibited but little naked rock; they were covered with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having ascertained from the summit of the highest hill near the +tents, that the river continued to preserve a west course; and fear-ing +that by pursuing it further we might lose much time, and un-necessarily +walk over a great deal of ground, I determined on +quitting its banks the next day, and making as directly as we could for +Point Lake. We accordingly followed the river on the 3d, only to +the place where the musk-ox had been killed last evening, and after +the meat was procured, crossed the river in our two canoes lashed +together. We now emerged from the valley of the river, and entered +a level, but very barren, country, varied only by small lakes and +marshes, the ground being covered with small stones. Many old tracks +of rein-deer were seen in the clayey soil, and some more recent +ones of the musk-ox. We encamped on the borders of Wright's +River, which flows to the eastward; the direct distance walked to-day +being ten miles and three-quarters. The next morning was +very fine, and,as the day advanced, the weather became quite +warm. We set out at six A. M., and, having forded the river, +walked over a perfectly level country, interspersed with small lakes, +which communicated with each other, by streams running in various +directions. No berry-bearing plants were found in this part, the +surface of the earth being thinly covered in the moister places with +a few grasses, and on the drier spots with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having walked twelve miles and a half, we encamped at seven P.M., +and distributed our last piece of pemmican, and a little arrow-root +for supper, which afforded but a scanty meal. This evening was +warm, but dark clouds overspread the sky. Our men now began to +find their burdens very oppressive, and were much fatigued by this +day's march, but did not complain. One of them was lame from an +inflammation in the knee. Heavy rain commenced at midnight, and +continued without intermission until five in the morning, when it +was succeeded by snow on the wind changing to north-west, which +soon increased to a violent gale. As we had nothing to eat, and +were destitute of the means of making a fire, we remained in our +beds all the day ; but the covering of our blankets was insufficient to +prevent us from feeling the severity of the frost, and suffering in-convenience +from the drifting of the snow into our tents. There +was no abatement of the storm next day ; our tents were completely +frozen, and the snow had drifted around them to a depth of three +feet, and even in the inside there was a covering of several inches on +our blankets. Our suffering from cold, in a comfortless canvass tent +in such weather, with the temperature at 20 deg, and without fire, +will easily be imagined;it was, however, less than that which we +felt from hunger. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The morning of the 7th cleared up a little, but the wind was still +strong, and the weather extremely cold. From the unusual con-tinuance +of the storm, we feared the winter had set in with all its +rigour, and that by longer delay we should only be exposed to an +accumulation of difficulties; we therefore prepared for our journey, +although we were in a very unfit condition for starting, being weak +from fasting, and our garments stiffened by the frost. We had no +means of making a fire to thaw them, the moss, at all times difficult +to kindle, being now covered with ice and snow. A considerable +time was consumed in packing up the frozen tents and bed clothes, +the wind blowing so strong that no one could keep his hands long +out of his mittens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Just as we were about to commence our march, I was seized with +a fainting fit, in consequence of exhaustion and sudden exposure to +the wind; but after eating a morsel of portable soup, I recovered, so +far as to be able to move on. I was unwilling at first to take this +morsel of soup, which was diminishing the small and only remaining +meal for the party; but several of the men urged me to it, with +much kindness. The ground was covered a foot deep with snow, +the margin of the lakes was incrusted with ice, and the swamps over +which we had to pass were entirely frozen; but the ice not being +sufficiently strong to bear us, we frequently plunged knee-deep in +water. Those who carried the canoes were repeatedly blown down +by the violence of the wind, and they often fell, from making an +insecure step on a slippery stone; on one of these occasions, the +largest canoe was so much broken as to be rendered utterly unser-viceable. +This was felt as a serious disaster, as the remaining canoe +having through mistake been made too small, it was doubtful +whether it would be sufficient to carry us across a river. Indeed +we had found it necessary in crossing Hood's River, to lash the two +canoes together. As there was some suspicion that Benoit, who +carried the canoe, had broken it intentionally, he having on a former +occasion been overheard by some of the men to say, that he would +do so when he got it in charge, we closely examined him on the +point; he roundly denied having used the expressions attributed to +him, and insisted that it was broken by his falling accidentally; and +as he brought men to attest the latter fact, who saw him tumble, we +did not press the matter further. I may here remark that our +people had murmured a good deal at having to carry two canoes, +though they were informed of the necessity of taking both, in case +it should be deemed advisable to divide the party; which it had +been thought probable we should be obliged to do, if animals proved +scarce, in order to give the whole the better chance of procuring +subsistence, and also for the purpose of sending forward some of the +best walkers to search for Indians, and to get them to meet us with +supplies of provision. The power of doing this was now at an end. +As the accident could not be remedied we turned it to the best +account by making a fire of the bark and timbers of the broken +vessel, and cooked the remainder of our portable soup and arrow-root. +This was a scanty meal after three days' fasting, but it served +to allay the pangs of hunger, and enabled us to proceed at a quicker +pace than before. The depth of the snow caused us to march in +Indian file, that is in each other's steps; the voyagers taking it in +turn to lead the party. A distant object was pointed out to this +man in the direction we wished to take, and Mr. Hood followed +immediately behind him, to renew the bearings, and keep him from +deviating more than could be helped from the mark. It may be +here observed, that we proceeded in this manner throughout our +route across the barren grounds. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the afternoon we got into a more hilly country, where the +ground was strewed with large stones. The surface of these was +covered with lichens of the genus gyrophora, which the Canadians +term tripe de roche. A considerable quantity was gathered, and +with half a partridge each, (which were shot in the course of the +day,) furnished us with a slender supper, which we cooked with a +few willows, dug up from beneath the snow. We passed a comfortless +night in our damp clothes, but took the precaution of sleeping upon +our socks and shoes to prevent them from freezing. This plan was +afterwards adopted throughout the journey. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +At half past five in the morning we proceeded; and after walking +about two miles, came to Cracroft's River, flowing to the westward, +with a very rapid current over a rocky channel. We had much diffi-culty +in crossing this, the canoe being useless, not only from the bot-tom +of the channel being obstructed by large stones, but also from its +requiring gumming, an operation which, owing to the want of wood +and the frost, we were unable to perform. However, after following +the course of the river some way, we effected a passage by means of a +range of large rocks that crossed a rapid. As the current was strong, +and many of the rocks were covered with water to the depth of two +or three feet, the men were exposed to much danger in carrying their +heavy burthens across, and several of them actually slipped into the +stream, but were immediately rescued by the others. Junius went +farther up the river in search of a better crossing place, and did not +rejoin us to-day. As several of the party were drenched from head to +foot, and we were all wet to the middle, our clothes became stiff with +the frost, and we walked with much pain for the remainder of the day. +The march was continued to a late hour, being anxious to rejoin the +hunters who had gone before, but we were obliged to encamp at the +end of ten miles and a quarter, without seeing them. Our only +meal to-day consisted of a partridge each, (which the hunters shot,) +mixed with tripe de roche. This repast although scanty for men, +with appetites such as our daily fatigue created, proved a cheerful +one, and was received with thankfulness. Most of the men had to +sleep in the open air, in consequence of the absence of Credit, who +carried their tent; but we fortunately found an unusual quantity of +roots to make a fire, which prevented their suffering much from the +cold, though the thermometer was at 17 deg. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We started at six on the 9th, and at the end of two miles re-gained +our hunters, who were halting on the borders of a lake amidst +a clump of stunted willows. This lake stretched to the westward as +far as we could see, and its waters were discharged by a rapid stream +one hundred and fifty yards wide. Being entirely ignorant where +we might be led by pursuing the course of the lake, and dreading +the idea of going a mile unnecessarily out of the way, we deter-mined +on crossing the river if possible; and the canoe was gummed +for the purpose, the willows furnishing us with fire. But we had to +await the return of Junius before we could make the traverse. In +the mean time we gathered a little tripe de roche, and breakfasted +upon it and a few partridges that were killed in the morning. +St. Germain and Adam were sent upon some recent tracks of deer. +Junius arrived in the afternoon, and informed us that he had seen +a large herd of musk-oxen on the banks of Cracroft's River, and had +wounded one of them, but it had escaped. He brought about four +pounds of meat, the remains of a deer that had been devoured by +the wolves. The poor fellow was much fatigued, having walked +throughout the night, but as the weather was particularly favourable +for our crossing the river, we could not allow him to rest. After he +had taken some refreshment we proceeded to the river. The canoe +being put into the water was found extremely ticklish, but it was +managed with much dexterity by St. Germain, Adam, and Peltier, +who ferried over one passenger at a time, causing him to lie flat in its +bottom, by no means a pleasant position, owing to its leakiness, but +there was no alternative. The transport of the whole party was +effected by five o'clock, and we walked about two miles further, and +encamped, having come five miles and three quarters on a south-west +course. Two young alpine hares were shot by St. Germain, which, +with the small piece of meat brought in by Junius, furnished the +supper of the whole party. There was no tripe de roche here. The +country had now become decidedly hilly, and was covered with snow. +The lake preserved its western direction, as far as I could see from +the summit of the highest mountain near the encampment. We +subsequently learned from the Copper Indians, that the part at +which we had crossed the river was the Congecatha-wha-chaga of +Hearne, of which I had little idea at the time, not only from the +difference of latitude, but also from its being so much farther east of +the mouth of the Copper-Mine River, than his track is laid down. +He only making one degree and three quarters difference of lon-gitude, +and we, upwards of four. Had I been aware of the fact, +several days harassing march, and a disastrous accident would have +been prevented by keeping on the western side of the lake, instead +of crossing the river. We were informed also, that this river is +the Anatessy or River of Strangers, and is supposed to fall into +Bathurst's Inlet; but although the Indians have visited its mouth, +their description was not sufficient to identify it with any of the +rivers whose mouths we had seen. It probably falls in that part of +the coast which was hid from our view by Goulburn's or Elliot's +Islands. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 10. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We had a cold north wind, and the atmosphere +was foggy. The thermometer 18 deg at five A.M. In the course of +our march this morning, we passed many small lakes; and the +ground becoming higher and more hilly as we receded from the +river, was covered to a much greater depth with snow. This ren-dered +walking not only extremely laborious, but also hazardous in +the highest degree;for the sides of the hills, as is usual throughout +the barren grounds, abounding in accumulations of large angular +stones, it often happened that the men fell into the interstices +with their loads on their backs, being deceived by the smooth +appearance of the drifted snow. If any one had broken a limb +here, his fate would have been melancholy indeed; we could neither +have remained with him, nor carried him on. We halted at ten to +gather tripe de roche,but it was so frozen, that we were quite +benumbed with cold before a sufficiency could be collected even for +a scanty meal. On proceeding our men were somewhat cheered, by +observing on the sandy summit of a hill, from whence the snow had +been blown, the summer track of a man; and afterwards by seeing +several deer tracks on the snow. About noon the weather cleared +up a little, and, to our great joy, we saw a herd of musk-oxen +grazing in a valley below us. The party instantly halted, and the +best hunters were sent out; they approached the animals with the +utmost caution, no less than two hours being consumed before they +got within gun-shot. In the mean time we beheld their proceed-ings +with extreme anxiety, and many secret prayers were, doubtless, +offered up for their success. At length they opened their fire, and +we had the satisfaction of seeing one of the largest cows fall; another +was wounded, but escaped. This success infused spirit into our +starving party. To skin and cut up the animal was the work of a +few minutes. The contents of its stomach were devoured upon +the spot, and the raw intestines, which were next attacked, were +pronounced by the most delicate amongst us to be excellent. A few +willows, whose tops were seen peeping through the snow in the bottom +of the valley, were quickly grubbed, the tents pitched, and supper +cooked, and devoured with avidity. This was the sixth day since we +had had a good meal. The tripe de roche, even where we got +enough, only serving to allay the pangs of hunger for a short time. +After supper, two of the hunters went in pursuit of the herd, but +could not get near them. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were detained all the next day by a strong southerly wind, +and were much incommoded in the tents by the drift snow. The +temperature was 20 deg. The average for the last ten days about +24.5 deg. We restricted ourselves to one meal to-day as we were at +rest, and there was only meat remaining sufficient for the next day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The gale had not diminished on the 12th, and, as we were +fearful of its continuance for some time, we determined on going +forward; our only doubt regarded the preservation of the canoe, +but the men promised to pay particular attention to it, and the +most careful persons were appointed to take it in charge. The snow +was two feet deep, and the ground much broken, which rendered +the march extremely painful. The whole party complained more of +faintness and weakness than they had ever done before; their +strength seemed to have been impaired by the recent supply of +animal food. In the afternoon the wind abated, and the snow ceased; +cheered with the change we proceeded forward at a quicker pace, +and encamped at six P. M., having come eleven miles. Our supper +consumed the last of our meat. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We set out on the 13th, in thick hazy weather, and, after an hour's +march, had the extreme mortification to find ourselves on the +borders of a large lake, which we subsequently learned from the +Indians was named Contwoy-to, or Rum Lake; neither of its extre- +mities could be seen, and as the portion which lay to the east +seemed the widest, we coasted along to the westward portion in +search of a crossing-place. This lake being bounded by steep and +lofty hills, our march was very fatiguing. Those sides which were +exposed to the sun, were free from snow, and we found upon them +some excellent berries. We encamped at six P. M., having come +only six miles and a half. Credit was then missing, and he did not +return during the night. We supped off a single partridge and +some tripe de roche;this unpalatable weed was now quite nau-seous +to the whole party, and in several it produced bowel com-plaints. +Mr. Hood was the greatest sufferer from this cause. This +evening we were extremely distressed, at discovering that our im-provident +companions,since we left Hood's River, had thrown +away three of the fishing-nets, and burnt the floats ; they knew we +had brought them to procure subsistence for the party, when the +animals should fail, and we could scarcely believe the fact of their +having wilfully deprived themselves of this resource, especially +when we considered that most of them had passed the greater part of +their servitude in situations where the nets alone had supplied them +with food. Being thus deprived of our principal resource, that of +fishing, and the men evidently getting weaker every day, it became +necessary to lighten their burthens of every thing except ammunition, +clothing, and the instruments that were required to find our +way. I, therefore, issued directions to deposit at this encampment +the dipping needle, azimuth compass, magnet, a large thermometer, +and a few books we had carried, having torn out of these such parts +as we should require to work the observations for latitude and +longitude. I also promised,as an excitement to the efforts in +hunting, my gun to St. Germain, and an ample compensation to +Adam, or any of the other men who should kill any animals. +Mr. Hood, on this occasion, lent his gun to Michel, the Iroquois, +who was very eager in the chase, and often successful. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 14. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +This morning the officers being assembled round +a small fire, Perrault presented each of us with a small piece of meat +which he had saved from his allowance. It was received with great +thankfulness, and such an act of self-denial and kindness, being +totally unexpected in a Canadian voyager, filled our eyes with tears. +In directing our course to a river issuing from the lake, we met +Credit, who communicated the joyful intelligence of his having +killed two deer in the morning. We instantly halted, and having +shared the deer that was nearest to us, prepared breakfast. After +which, the other deer was sent for, and we went down to the river, +which was about three hundred yards wide, and flowed with +great velocity through a broken rocky channel. Having searched +for a part where the current was most smooth, the canoe was +placed in the water at the head of a rapid, and St. Germain, Solomon +Belanger, and I, embarked in order to cross. We went from the +shore very well, but in mid-channel the canoe became difficult to +manage under our burden as the breeze was fresh. The current +drove us to the edge of the rapid, when Belanger unfortunately +applied his paddle to avert the apparent danger of being forced +down it, and lost his balance. The canoe was overset in con-sequence +in the middle of the rapid. We fortunately kept hold of +it, until we touched a rock where the water did not reach higher +than our waists; here we kept our footing, notwithstanding the +strength of the current, until the water was emptied out of the +canoe. Belanger then held the canoe steady whilst St. Germain +placed me in it, and afterwards embarked himself in a very dexterous +manner. It was impossible, however, to embark Belanger, +as the canoe would have been hurried down the rapid, the moment +he should have raised his foot from the rock on which he stood. +We were, therefore, compelled to leave him in his perilous situation. +We had not gone twenty yards before the canoe, striking on a +sunken rock, went down. The place being shallow, we were again +enabled to empty it, and the third attempt brought us to the shore. +In the mean time Belanger was suffering extremely, immersed to +his middle in the centre of a rapid, the temperature of which was +very little above the freezing point, and the upper part of his body +covered with wet clothes, exposed in a temperature not much above +zero, to a strong breeze. He called piteously for relief, and +St. Germain on his return endeavoured to embark him, but in vain. +The canoe was hurried down the rapid, and when he landed he was +rendered by the cold incapable of further exertion, and Adam at-tempted +to embark Belanger, but found it impossible. An attempt +was next made to carry out to him a line, made of the slings of the +men's loads. This also failed, the current acting so strongly upon +it, as to prevent the canoe from steering, and it was finally broken +and carried down the stream. At length, when Belanger's strength +seemed almost exhausted, the canoe reached him with a small cord +belonging to one of the nets, and he was dragged perfectly senseless +through the rapid. By the direction of Dr. Richardson, he was +instantly stripped, and being rolled up in blankets, two men un-dressed +themselves and went to bed with him; but it was some +hours before he recovered his warmth and sensations. As soon as +Belanger was placed in his bed, the officers immediately sent over +my blankets, and a person to make a fire. Augustus brought the +canoe over, and in returning he was obliged to descend both the +rapids, before he could get across the stream; which hazardous +service he performed with the greatest coolness and judgment. It +is impossible to describe my sensations as I witnessed the various +unsuccessful attempts to relieve Belanger. The distance prevented +my seeing distinctly what was going on, and I continued pacing up +and down upon the rock on which I landed, regardless of the +coldness of my drenched and stiffening garments. The canoe, in +every attempt to reach him, was hurried down the rapid, and was +lost to the view amongst the rocky islets, with a rapidity that +seemed to threaten certain destruction; once, indeed, I fancied that +I saw it overwhelmed in the waves. Such an event would have +been fatal to the whole party. Separated as I was from my com-panions, +without gun, ammunition, hatchet, or the means of making +a fire, and in wet clothes, my doom would have been speedily sealed. +My companions too, driven to the necessity of coasting the lake, +must have sunk under the fatigue of rounding its innumerable arms +and bays, which, as we have learned from the Indians, are very +extensive. By the goodness of Providence, however, we were spared +at that time, and some of us have been permitted to offer up our +thanksgivings, in a civilized land, for the signal deliverances we then +and afterwards experienced. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/pagination/franklin_rep.fo b/examples/fo/pagination/franklin_rep.fo new file mode 100644 index 000000000..166324fff --- /dev/null +++ b/examples/fo/pagination/franklin_rep.fo @@ -0,0 +1,1022 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="repeating" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:page-sequence-master master-name="repeating_pm"> + <fo:repeatable-page-master-reference master-reference="repeating"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="repeating_pm" initial-page-number="1"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="start" font-size="10pt" + font-family="sans-serif" + line-height="10pt" > + John Franklin - Journey to the Shores of the Polar Sea + </fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="end" + font-size="10pt" + font-family="sans-serif" + line-height="14pt" > + p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines local TOC --> + <fo:block font-size="10pt" + font-family="serif" + line-height="12pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="6pt"> +Journey across the barren Grounds - Difficulty and delay in crossing Copper-Mine River - +Melancholy and fatal Results thereof - Extreme Misery of the whole Party - Murder of +Mr. Hood - Death of several of the Canadians - Desolate State of Fort Enterprise - +Distress suffered at that Place - Dr. Richardson's Narrative - Mr. Back's Narrative - +Conclusion. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">1821. August 17. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +MY original intention, whenever the season should +compel us to relinquish the survey, had been to return by the way +of the Copper-Mine River, and in pursuance of my arrangement +with the Hook to travel to Slave Lake through the line of woods +extending thither by the Great Bear and Marten Lakes, but our +scanty stock of provision and the length of the voyage rendered it +necessary to make for a nearer place. We had already found that +the country, between Cape Barrow and the Copper-Mine River, +would not supply our wants, and this it seemed probable would now +be still more the case ; besides, at this advanced season, we expected +the frequent recurrence of gales, which would cause great detention, +if not danger in proceeding along that very rocky part of the coast. +I determined, therefore, to make at once for Arctic Sound, where +we had found the animals more numerous than at any other place ; +and entering Hood's River, to advance up that stream as far as it +was navigable, and then to construct small canoes out of the +materials of the larger ones, which could be carried in crossing the +barren grounds to Fort Enterprise. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 19. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were almost beaten out of our comfortless abodes +by rain during the night, and this morning the gale continued +without diminution. The thermometer fell to 33 deg. Two men were +sent with Junius to search for the deer which Augustus had killed. +Junius returned in the evening bringing part of the meat, but owing +to the thickness of the weather, his companions parted from him +and did not make their appearance. Divine service was read. On +the 20th we were presented with the most chilling prospect, the +small pools of water being frozen over, the ground being covered +with snow, and the thermometer at the freezing point at mid-day. +Flights of geese were passing to the southward. The wind however +was more moderate, having changed to the eastward. Considerable +anxiety prevailing respecting Belanger and Michel, the two men +who strayed from Junius yesterday, the rest were sent out to look +for them. The search was successful, and they all returned in the +evening. The stragglers were much fatigued, and had suffered +severely from the cold, one of them having his thighs frozen, and +what under our present circumstances was most grievous, they had +thrown away all the meat. The wind during the night returned to +the north-west quarter, blew more violently than ever, and raised a +very turbulent sea. The next day did not improve our condition, +the snow remained on the ground, and the small pools were frozen. +Our hunters were sent out, but they returned after a fatiguing +day's march without having seen any animals. We made a scanty +meal off a handful of pemmican, after which only half a bag +remained. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind abated after midnight, and the surf diminished rapidly, +which caused us to be on the alert at a very early hour on the 22d, +but we had to wait until six A.M. for the return of Augustus who +had continued out all night on an unsuccessful pursuit of deer. +It appears that he had walked a few miles farther along the coast, +than the party had done on the 18th, and from a sketch he drew on +the sand, we were confirmed in our former opinion that the shore +inclined more to the eastward beyond Point Turnagain. He also +drew a river of considerable size, that discharges its waters into +Walker's Bay; on the banks of which stream he saw a piece of +wood, such as the Esquimaux use in producing fire, and other marks +so fresh that he supposed they had recently visited the spot. We +therefore left several iron materials for them. Our men, cheered by +the prospect of returning, embarked with the utmost alacrity; and, +paddling with unusual vigour, carried us across Riley's and Walker's +Bays, a distance of twenty miles before noon, when we landed on +Slate-Clay Point, as the wind had freshened too much to permit us +to continue the voyage. The whole party went to hunt, but returned +without success in the evening, drenched with the heavy rain which +commenced soon after they had set out. Several deer were seen, +but could not be approached in this naked country; and as our +stock of pemmican did not admit of serving out two meals, we went +dinnerless to bed. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Soon after our departure to-day, a sealed tin-case, sufficiently +buoyant to float, was thrown overboard, containing a short account of +our proceedings, and the position of the most conspicuous points. +The wind blew off the land, the water was smooth, and as the sea +is in this part more free from islands than in any other, there was +every probability of its being driven off the shore into the current ; +which, as I have before mentioned, we suppose, from the circumstance +of Mackenzie's River being the only known stream that +brings down the wood we have found along the shores, to set to the +eastward. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 23. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +A severe frost caused us to pass a comfortless night. +At two P.M. we set sail, and the men voluntarily launched out to +make a traverse of fifteen miles across Melville Sound, before a +strong wind and heavy sea. The privation of food, under which +our voyagers were then labouring, absorbed every other terror; +otherwise the most powerful persuasion could not have induced +them to attempt such a traverse. It was with the utmost difficulty +that the canoes were kept from turning their broadsides to the +waves, though we sometimes steered with all the paddles. One of +them narrowly escaped being overset by this accident, happening +in mid-channel, where the waves were so high that the mast-head +of our canoe was often hid from the other, though it was sailing +within hail. The annexed plate, from Mr. Back's sketch, will convey +to the reader an accurate idea of the peril of our situation. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The traverse, however, was made;we were then near a high +rocky lee shore, on which a heavy surf was beating. The wind +being on the beam, the canoes drifted fast to leeward; and, on +rounding a point, the recoil of the sea from the rocks was so great +that they were with difficulty kept from foundering. We looked in +vain for a sheltered bay to land in ; but, at length, being unable to +weather another point, we were obliged to put ashore on the open +beach, which, fortunately, was sandy at this spot. The debarkation +was effected in the manner represented in the plate; and, fortunately, +without further injury than the splitting of the head of +the second canoe, which was easily repaired. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Our encampment being near to the place where we killed the deer +on the 11th, almost the whole party went out to hunt, but they +returned in the evening without having seen any game. The +berries, however, were ripe and plentiful, and, with the addition +of some country tea, furnished a supper. There were some showers +in the afternoon,and the weather was cold, the thermometer +being 42 deg, but the evening and night were calm and fine. It may be +remarked that the mosquitoes disappeared when the late gales +commenced. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 25. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at three A. M., we stretched across +the eastern entrance of Bathurst's Inlet, and arrived at an island, +which I have named after Colonel Barry, of Newton Barry. Some +deer being seen on the beach, the hunters went in pursuit of +them, and succeeded in killing three females, which enabled us to +save our last remaining meal of pemmican. They saw also some +fresh tracks of musk oxen on the banks of a small stream, which +flowed into a lake in the centre of the island. These animals must +have crossed a channel, at least, three miles wide, to reach the nearest +of these islands. Some specimens of variegated pebbles and jasper +were found here imbedded in the amygdaloidal rock. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Re-embarking at two P.M., and continuing through what was +supposed to be a channel between two islands, we found our passage +barred by a gravelly isthmus of only ten yards in width ; the canoes +and cargoes were carried across it, and we passed into Bathurst's Inlet +through another similar channel, bounded on both sides by steep +rocky hills. The wind then changing from S.E. to N.W. brought +heavy rain, and we encamped at seven P.M., having advanced +eighteen miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Starting this morning with a fresh breeze in our favour, +we soon reached that part of Barry's Island where the canoes were +detained on the 2d and 3rd of this month, and contrary to what we +then experienced, the deer were now plentiful. The hunters killed +two, and we were relieved from all apprehension of an immediate +want of food. One would suppose the deer were about to retire to +the main shore from their assembling at this time in such numbers +on the islands nearest to the coast. Those we saw were generally +females with their young, and all of them very lean. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind continued in the same direction until we had rounded +Point Wollaston, and then changed to a quarter, which enabled us +to steer for Hood's River, which we ascended as high as the first +rapid and encamped. Here terminated our voyage on the Arctic +sea, during which we had gone over six hundred and fifty geographical +miles. Our Canadian voyagers could not restrain their expressions +of joy at having turned their backs on the sea, and +they passed the evening talking over their past adventures with +much humour and no little exaggeration. The consideration that +the most painful, and certainly the most hazardous, part of the +journey was yet to come, did not depress their spirits at all. It is +due to their character to mention that they displayed much courage +in encountering the dangers of the sea, magnified to them by their +novelty. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The shores between Cape Barrow and Cape Flinders, including +the extensive branches of Arctic and Melville Sounds, and Bathurst's +Inlet, may be comprehended in one great gulf, which I have distinguished +by the appellation of George IV.'s Coronation Gulf, in +honour of His Most Gracious Majesty, the latter name being added +to mark the time of its discovery. The Archipelago of islands which +fringe the coast from Copper-Mine River to Point Turnagain, I have +named in honour of His Royal Highness the Duke of York. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +It may be deserving of notice that the extremes in temperature +of the sea water during our voyage were 53 deg and 35 deg, but its general +temperature was between 43 deg and 48 deg. Throughout our return from +Point Turnagain we observed that the sea had risen several feet +above marks left at our former encampments. This may, perhaps, +be attributed to the north-west gales. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 26. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Previous to our departure this morning, an assortment +of iron materials, beads, looking-glasses, and other articles +were put up in a conspicuous situation for the Esquimaux, and the +English Union was planted on the loftiest sand-hill, where it might +be seen by any ships passing in the offing. Here also, was deposited +in a tin bow a letter containing an outline of our proceedings, the +latitude and longitude of the principal places, and the course we +intended to pursue towards Slave Lake. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at eight A.M. we proceeded up the river, which is full +of sandy shoals, but sufficiently deep for canoes in the channels. It is +from one hundred to two hundred yards wide, and is bounded by high +and steep banks of clay. We encamped at a cascade of eighteen or +twenty feet high, which is produced by a ridge of rock crossing the +river, and the nets were set. A mile below this cascade Hood's +River is joined by a stream half its own size, which I have called +James' Branch. Bear and deer tracks had been numerous on the +banks of the river when we were here before, but not a single recent +one was to be seen at this time. Credit, however, killed a small +deer at some distance inland, which, with the addition of berries, +furnished a delightful repast this evening. The weather was remarkably +fine, and the temperature so mild, that the mosquitoes again +made their appearance, but not in any great numbers. Our distance +made to-day was not more than six miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning the net furnished us with ten white fish +and trout. Having made a further deposit of iron work for the +Esquimaux we pursued our voyage up the river, but the shoals and +rapids in this part were so frequent, that we walked along the banks +the whole day, and the crews laboured hard in carrying the canoes +thus lightened over the shoals or dragging them up the rapids, yet +our journey in a direct line was only about seven miles. In the +evening we encamped at the lower end of a narrow chasm through +which the river flows for upwards of a mile. The walls of this +chasm are upwards of two hundred feet high, quite perpendicular, +and in some places only a few yards apart. The river precipitates +itself into it over a rock, forming two magnificent and picturesque +falls close to each other. The upper fall is about sixty feet high, and +the lower one at least one hundred, but perhaps considerably more, +for the narrowness of the chasm into which it fell prevented us from +seeing its bottom, and we could merely discern the top of the spray +far beneath our feet. The lower fall is divided into two, by an +insulated column of rock which rises about forty feet above it. The +whole descent of the river at this place probably exceeds two +hundred and fifty feet. The rock is very fine felspathose sandstone. +It has a smooth surface and a light red colour. I have named these +magnificent cascades Wilberforce Falls, as a tribute of my respect +for that distinguished philanthropist and Christian. Messrs. Back and +Hood took beautiful sketches of this majestic scene, which are +combined in the annexed plate. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The river being surveyed from the summit of a hill, above these +falls, appeared so rapid and shallow, that it seemed useless to +attempt proceeding any farther in the large canoes. I therefore +determined on constructing out of their materials two smaller ones +of sufficient size to contain three persons, for the purpose of crossing +any river that might obstruct our progress. This operation was +accordingly commenced, and by the 31st both the canoes being +finished, we prepared for our departure on the following day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The leather which had been preserved for making shoes was +equally divided among the men, two pairs of flannel socks were given +to each person, and such articles of warm clothing as remained, were +issued to those who most required them. They were also furnished +with one of the officers' tents. This being done, I communicated to +the men my intention of proceeding in as direct a course as possible +to the part of Point Lake, opposite to our spring encampment +which was only distant one hundred and forty-nine miles in a +straight line. They received the communication cheerfully, considered +the journey to be short, and left me, in high spirits, to +arrange their own packages. The stores, books, &c., which were not +absolutely necessary to be carried, were then put up in boxes to be +left en cache here, in order that the men's burdens might be as light +as possible. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning was warm, and very fine. Every one was on +the alert at an early hour, being anxious to commence the journey. +Our luggage consisted of ammunition, nets, hatchets, ice chisels, +astronomical instruments, clothing, blankets, three kettles, and +the two canoes, which were each carried by one man. The +officers carried such a portion of their own things as their strength +would permit;the weight carried by each man was about ninety +pounds, and with this we advanced at the rate of about a mile an +hour, including rests. In the evening the hunters killed a lean cow, +out of a large drove of musk-oxen; but the men were too much +laden to carry more than a small portion of its flesh. The alluvial +soil, which towards the mouth of the river spreads into plains, +covered with grass and willows, was now giving place to a more +barren and hilly country; so that we could but just collect sufficient +brush wood to cook our suppers. The part of the river we skirted +to-day was shallow, and flowed over a bed of sand ; its width about +one hundred and twenty yards. About midnight our tent was blown +down by a squall, and we were completely drenched with rain before +it could be re-pitched. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the morning of the 1st of September a fall of snow took +place; the canoes became a cause of delay, by the difficulty of +carrying them in a high wind, and they sustained much damage +from the falls of those who had charge of them. The face of the +country was broken by hills of moderate elevation, but the ground +was plentifully strewed with small stones, which, to men bearing +heavy burthens, and whose feet were protected only by soft moose +skin shoes, occasioned great pain. At the end of eleven miles we +encamped, and sent for a musk-ox and a deer, which St. Germain +and Augustus had killed. The day was extremely cold, the ther-mometer +varying between 34 deg and 36 deg. In the afternoon a heavy +fall of snow took place, on the wind changing from north-west to +south-west. We found no wood at the encampment, but made a +fire of moss to cook the supper, and crept under our blankets for +warmth. At sun-rise the thermometer was at 31 deg, and the wind +fresh from north-west; but the weather became mild in the course +of the forenoon, and the snow disappeared from the gravel. The +afternoon was remarkably fine, and the thermometer rose to 50 deg. +One of the hunters killed a musk-ox. The hills in this part are +lower and more round-backed than those we passed yesterday, and +exhibited but little naked rock; they were covered with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having ascertained from the summit of the highest hill near the +tents, that the river continued to preserve a west course; and fear-ing +that by pursuing it further we might lose much time, and un-necessarily +walk over a great deal of ground, I determined on +quitting its banks the next day, and making as directly as we could for +Point Lake. We accordingly followed the river on the 3d, only to +the place where the musk-ox had been killed last evening, and after +the meat was procured, crossed the river in our two canoes lashed +together. We now emerged from the valley of the river, and entered +a level, but very barren, country, varied only by small lakes and +marshes, the ground being covered with small stones. Many old tracks +of rein-deer were seen in the clayey soil, and some more recent +ones of the musk-ox. We encamped on the borders of Wright's +River, which flows to the eastward; the direct distance walked to-day +being ten miles and three-quarters. The next morning was +very fine, and,as the day advanced, the weather became quite +warm. We set out at six A. M., and, having forded the river, +walked over a perfectly level country, interspersed with small lakes, +which communicated with each other, by streams running in various +directions. No berry-bearing plants were found in this part, the +surface of the earth being thinly covered in the moister places with +a few grasses, and on the drier spots with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having walked twelve miles and a half, we encamped at seven P.M., +and distributed our last piece of pemmican, and a little arrow-root +for supper, which afforded but a scanty meal. This evening was +warm, but dark clouds overspread the sky. Our men now began to +find their burdens very oppressive, and were much fatigued by this +day's march, but did not complain. One of them was lame from an +inflammation in the knee. Heavy rain commenced at midnight, and +continued without intermission until five in the morning, when it +was succeeded by snow on the wind changing to north-west, which +soon increased to a violent gale. As we had nothing to eat, and +were destitute of the means of making a fire, we remained in our +beds all the day ; but the covering of our blankets was insufficient to +prevent us from feeling the severity of the frost, and suffering in-convenience +from the drifting of the snow into our tents. There +was no abatement of the storm next day ; our tents were completely +frozen, and the snow had drifted around them to a depth of three +feet, and even in the inside there was a covering of several inches on +our blankets. Our suffering from cold, in a comfortless canvass tent +in such weather, with the temperature at 20 deg, and without fire, +will easily be imagined;it was, however, less than that which we +felt from hunger. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The morning of the 7th cleared up a little, but the wind was still +strong, and the weather extremely cold. From the unusual con-tinuance +of the storm, we feared the winter had set in with all its +rigour, and that by longer delay we should only be exposed to an +accumulation of difficulties; we therefore prepared for our journey, +although we were in a very unfit condition for starting, being weak +from fasting, and our garments stiffened by the frost. We had no +means of making a fire to thaw them, the moss, at all times difficult +to kindle, being now covered with ice and snow. A considerable +time was consumed in packing up the frozen tents and bed clothes, +the wind blowing so strong that no one could keep his hands long +out of his mittens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Just as we were about to commence our march, I was seized with +a fainting fit, in consequence of exhaustion and sudden exposure to +the wind; but after eating a morsel of portable soup, I recovered, so +far as to be able to move on. I was unwilling at first to take this +morsel of soup, which was diminishing the small and only remaining +meal for the party; but several of the men urged me to it, with +much kindness. The ground was covered a foot deep with snow, +the margin of the lakes was incrusted with ice, and the swamps over +which we had to pass were entirely frozen; but the ice not being +sufficiently strong to bear us, we frequently plunged knee-deep in +water. Those who carried the canoes were repeatedly blown down +by the violence of the wind, and they often fell, from making an +insecure step on a slippery stone; on one of these occasions, the +largest canoe was so much broken as to be rendered utterly unser-viceable. +This was felt as a serious disaster, as the remaining canoe +having through mistake been made too small, it was doubtful +whether it would be sufficient to carry us across a river. Indeed +we had found it necessary in crossing Hood's River, to lash the two +canoes together. As there was some suspicion that Benoit, who +carried the canoe, had broken it intentionally, he having on a former +occasion been overheard by some of the men to say, that he would +do so when he got it in charge, we closely examined him on the +point; he roundly denied having used the expressions attributed to +him, and insisted that it was broken by his falling accidentally; and +as he brought men to attest the latter fact, who saw him tumble, we +did not press the matter further. I may here remark that our +people had murmured a good deal at having to carry two canoes, +though they were informed of the necessity of taking both, in case +it should be deemed advisable to divide the party; which it had +been thought probable we should be obliged to do, if animals proved +scarce, in order to give the whole the better chance of procuring +subsistence, and also for the purpose of sending forward some of the +best walkers to search for Indians, and to get them to meet us with +supplies of provision. The power of doing this was now at an end. +As the accident could not be remedied we turned it to the best +account by making a fire of the bark and timbers of the broken +vessel, and cooked the remainder of our portable soup and arrow-root. +This was a scanty meal after three days' fasting, but it served +to allay the pangs of hunger, and enabled us to proceed at a quicker +pace than before. The depth of the snow caused us to march in +Indian file, that is in each other's steps; the voyagers taking it in +turn to lead the party. A distant object was pointed out to this +man in the direction we wished to take, and Mr. Hood followed +immediately behind him, to renew the bearings, and keep him from +deviating more than could be helped from the mark. It may be +here observed, that we proceeded in this manner throughout our +route across the barren grounds. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the afternoon we got into a more hilly country, where the +ground was strewed with large stones. The surface of these was +covered with lichens of the genus gyrophora, which the Canadians +term tripe de roche. A considerable quantity was gathered, and +with half a partridge each, (which were shot in the course of the +day,) furnished us with a slender supper, which we cooked with a +few willows, dug up from beneath the snow. We passed a comfortless +night in our damp clothes, but took the precaution of sleeping upon +our socks and shoes to prevent them from freezing. This plan was +afterwards adopted throughout the journey. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +At half past five in the morning we proceeded; and after walking +about two miles, came to Cracroft's River, flowing to the westward, +with a very rapid current over a rocky channel. We had much diffi-culty +in crossing this, the canoe being useless, not only from the bot-tom +of the channel being obstructed by large stones, but also from its +requiring gumming, an operation which, owing to the want of wood +and the frost, we were unable to perform. However, after following +the course of the river some way, we effected a passage by means of a +range of large rocks that crossed a rapid. As the current was strong, +and many of the rocks were covered with water to the depth of two +or three feet, the men were exposed to much danger in carrying their +heavy burthens across, and several of them actually slipped into the +stream, but were immediately rescued by the others. Junius went +farther up the river in search of a better crossing place, and did not +rejoin us to-day. As several of the party were drenched from head to +foot, and we were all wet to the middle, our clothes became stiff with +the frost, and we walked with much pain for the remainder of the day. +The march was continued to a late hour, being anxious to rejoin the +hunters who had gone before, but we were obliged to encamp at the +end of ten miles and a quarter, without seeing them. Our only +meal to-day consisted of a partridge each, (which the hunters shot,) +mixed with tripe de roche. This repast although scanty for men, +with appetites such as our daily fatigue created, proved a cheerful +one, and was received with thankfulness. Most of the men had to +sleep in the open air, in consequence of the absence of Credit, who +carried their tent; but we fortunately found an unusual quantity of +roots to make a fire, which prevented their suffering much from the +cold, though the thermometer was at 17 deg. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We started at six on the 9th, and at the end of two miles re-gained +our hunters, who were halting on the borders of a lake amidst +a clump of stunted willows. This lake stretched to the westward as +far as we could see, and its waters were discharged by a rapid stream +one hundred and fifty yards wide. Being entirely ignorant where +we might be led by pursuing the course of the lake, and dreading +the idea of going a mile unnecessarily out of the way, we deter-mined +on crossing the river if possible; and the canoe was gummed +for the purpose, the willows furnishing us with fire. But we had to +await the return of Junius before we could make the traverse. In +the mean time we gathered a little tripe de roche, and breakfasted +upon it and a few partridges that were killed in the morning. +St. Germain and Adam were sent upon some recent tracks of deer. +Junius arrived in the afternoon, and informed us that he had seen +a large herd of musk-oxen on the banks of Cracroft's River, and had +wounded one of them, but it had escaped. He brought about four +pounds of meat, the remains of a deer that had been devoured by +the wolves. The poor fellow was much fatigued, having walked +throughout the night, but as the weather was particularly favourable +for our crossing the river, we could not allow him to rest. After he +had taken some refreshment we proceeded to the river. The canoe +being put into the water was found extremely ticklish, but it was +managed with much dexterity by St. Germain, Adam, and Peltier, +who ferried over one passenger at a time, causing him to lie flat in its +bottom, by no means a pleasant position, owing to its leakiness, but +there was no alternative. The transport of the whole party was +effected by five o'clock, and we walked about two miles further, and +encamped, having come five miles and three quarters on a south-west +course. Two young alpine hares were shot by St. Germain, which, +with the small piece of meat brought in by Junius, furnished the +supper of the whole party. There was no tripe de roche here. The +country had now become decidedly hilly, and was covered with snow. +The lake preserved its western direction, as far as I could see from +the summit of the highest mountain near the encampment. We +subsequently learned from the Copper Indians, that the part at +which we had crossed the river was the Congecatha-wha-chaga of +Hearne, of which I had little idea at the time, not only from the +difference of latitude, but also from its being so much farther east of +the mouth of the Copper-Mine River, than his track is laid down. +He only making one degree and three quarters difference of lon-gitude, +and we, upwards of four. Had I been aware of the fact, +several days harassing march, and a disastrous accident would have +been prevented by keeping on the western side of the lake, instead +of crossing the river. We were informed also, that this river is +the Anatessy or River of Strangers, and is supposed to fall into +Bathurst's Inlet; but although the Indians have visited its mouth, +their description was not sufficient to identify it with any of the +rivers whose mouths we had seen. It probably falls in that part of +the coast which was hid from our view by Goulburn's or Elliot's +Islands. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 10. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We had a cold north wind, and the atmosphere +was foggy. The thermometer 18 deg at five A.M. In the course of +our march this morning, we passed many small lakes; and the +ground becoming higher and more hilly as we receded from the +river, was covered to a much greater depth with snow. This ren-dered +walking not only extremely laborious, but also hazardous in +the highest degree;for the sides of the hills, as is usual throughout +the barren grounds, abounding in accumulations of large angular +stones, it often happened that the men fell into the interstices +with their loads on their backs, being deceived by the smooth +appearance of the drifted snow. If any one had broken a limb +here, his fate would have been melancholy indeed; we could neither +have remained with him, nor carried him on. We halted at ten to +gather tripe de roche,but it was so frozen, that we were quite +benumbed with cold before a sufficiency could be collected even for +a scanty meal. On proceeding our men were somewhat cheered, by +observing on the sandy summit of a hill, from whence the snow had +been blown, the summer track of a man; and afterwards by seeing +several deer tracks on the snow. About noon the weather cleared +up a little, and, to our great joy, we saw a herd of musk-oxen +grazing in a valley below us. The party instantly halted, and the +best hunters were sent out; they approached the animals with the +utmost caution, no less than two hours being consumed before they +got within gun-shot. In the mean time we beheld their proceed-ings +with extreme anxiety, and many secret prayers were, doubtless, +offered up for their success. At length they opened their fire, and +we had the satisfaction of seeing one of the largest cows fall; another +was wounded, but escaped. This success infused spirit into our +starving party. To skin and cut up the animal was the work of a +few minutes. The contents of its stomach were devoured upon +the spot, and the raw intestines, which were next attacked, were +pronounced by the most delicate amongst us to be excellent. A few +willows, whose tops were seen peeping through the snow in the bottom +of the valley, were quickly grubbed, the tents pitched, and supper +cooked, and devoured with avidity. This was the sixth day since we +had had a good meal. The tripe de roche, even where we got +enough, only serving to allay the pangs of hunger for a short time. +After supper, two of the hunters went in pursuit of the herd, but +could not get near them. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were detained all the next day by a strong southerly wind, +and were much incommoded in the tents by the drift snow. The +temperature was 20 deg. The average for the last ten days about +24.5 deg. We restricted ourselves to one meal to-day as we were at +rest, and there was only meat remaining sufficient for the next day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The gale had not diminished on the 12th, and, as we were +fearful of its continuance for some time, we determined on going +forward; our only doubt regarded the preservation of the canoe, +but the men promised to pay particular attention to it, and the +most careful persons were appointed to take it in charge. The snow +was two feet deep, and the ground much broken, which rendered +the march extremely painful. The whole party complained more of +faintness and weakness than they had ever done before; their +strength seemed to have been impaired by the recent supply of +animal food. In the afternoon the wind abated, and the snow ceased; +cheered with the change we proceeded forward at a quicker pace, +and encamped at six P. M., having come eleven miles. Our supper +consumed the last of our meat. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We set out on the 13th, in thick hazy weather, and, after an hour's +march, had the extreme mortification to find ourselves on the +borders of a large lake, which we subsequently learned from the +Indians was named Contwoy-to, or Rum Lake; neither of its extre- +mities could be seen, and as the portion which lay to the east +seemed the widest, we coasted along to the westward portion in +search of a crossing-place. This lake being bounded by steep and +lofty hills, our march was very fatiguing. Those sides which were +exposed to the sun, were free from snow, and we found upon them +some excellent berries. We encamped at six P. M., having come +only six miles and a half. Credit was then missing, and he did not +return during the night. We supped off a single partridge and +some tripe de roche;this unpalatable weed was now quite nau-seous +to the whole party, and in several it produced bowel com-plaints. +Mr. Hood was the greatest sufferer from this cause. This +evening we were extremely distressed, at discovering that our im-provident +companions,since we left Hood's River, had thrown +away three of the fishing-nets, and burnt the floats ; they knew we +had brought them to procure subsistence for the party, when the +animals should fail, and we could scarcely believe the fact of their +having wilfully deprived themselves of this resource, especially +when we considered that most of them had passed the greater part of +their servitude in situations where the nets alone had supplied them +with food. Being thus deprived of our principal resource, that of +fishing, and the men evidently getting weaker every day, it became +necessary to lighten their burthens of every thing except ammunition, +clothing, and the instruments that were required to find our +way. I, therefore, issued directions to deposit at this encampment +the dipping needle, azimuth compass, magnet, a large thermometer, +and a few books we had carried, having torn out of these such parts +as we should require to work the observations for latitude and +longitude. I also promised,as an excitement to the efforts in +hunting, my gun to St. Germain, and an ample compensation to +Adam, or any of the other men who should kill any animals. +Mr. Hood, on this occasion, lent his gun to Michel, the Iroquois, +who was very eager in the chase, and often successful. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 14. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +This morning the officers being assembled round +a small fire, Perrault presented each of us with a small piece of meat +which he had saved from his allowance. It was received with great +thankfulness, and such an act of self-denial and kindness, being +totally unexpected in a Canadian voyager, filled our eyes with tears. +In directing our course to a river issuing from the lake, we met +Credit, who communicated the joyful intelligence of his having +killed two deer in the morning. We instantly halted, and having +shared the deer that was nearest to us, prepared breakfast. After +which, the other deer was sent for, and we went down to the river, +which was about three hundred yards wide, and flowed with +great velocity through a broken rocky channel. Having searched +for a part where the current was most smooth, the canoe was +placed in the water at the head of a rapid, and St. Germain, Solomon +Belanger, and I, embarked in order to cross. We went from the +shore very well, but in mid-channel the canoe became difficult to +manage under our burden as the breeze was fresh. The current +drove us to the edge of the rapid, when Belanger unfortunately +applied his paddle to avert the apparent danger of being forced +down it, and lost his balance. The canoe was overset in con-sequence +in the middle of the rapid. We fortunately kept hold of +it, until we touched a rock where the water did not reach higher +than our waists; here we kept our footing, notwithstanding the +strength of the current, until the water was emptied out of the +canoe. Belanger then held the canoe steady whilst St. Germain +placed me in it, and afterwards embarked himself in a very dexterous +manner. It was impossible, however, to embark Belanger, +as the canoe would have been hurried down the rapid, the moment +he should have raised his foot from the rock on which he stood. +We were, therefore, compelled to leave him in his perilous situation. +We had not gone twenty yards before the canoe, striking on a +sunken rock, went down. The place being shallow, we were again +enabled to empty it, and the third attempt brought us to the shore. +In the mean time Belanger was suffering extremely, immersed to +his middle in the centre of a rapid, the temperature of which was +very little above the freezing point, and the upper part of his body +covered with wet clothes, exposed in a temperature not much above +zero, to a strong breeze. He called piteously for relief, and +St. Germain on his return endeavoured to embark him, but in vain. +The canoe was hurried down the rapid, and when he landed he was +rendered by the cold incapable of further exertion, and Adam at-tempted +to embark Belanger, but found it impossible. An attempt +was next made to carry out to him a line, made of the slings of the +men's loads. This also failed, the current acting so strongly upon +it, as to prevent the canoe from steering, and it was finally broken +and carried down the stream. At length, when Belanger's strength +seemed almost exhausted, the canoe reached him with a small cord +belonging to one of the nets, and he was dragged perfectly senseless +through the rapid. By the direction of Dr. Richardson, he was +instantly stripped, and being rolled up in blankets, two men un-dressed +themselves and went to bed with him; but it was some +hours before he recovered his warmth and sensations. As soon as +Belanger was placed in his bed, the officers immediately sent over +my blankets, and a person to make a fire. Augustus brought the +canoe over, and in returning he was obliged to descend both the +rapids, before he could get across the stream; which hazardous +service he performed with the greatest coolness and judgment. It +is impossible to describe my sensations as I witnessed the various +unsuccessful attempts to relieve Belanger. The distance prevented +my seeing distinctly what was going on, and I continued pacing up +and down upon the rock on which I landed, regardless of the +coldness of my drenched and stiffening garments. The canoe, in +every attempt to reach him, was hurried down the rapid, and was +lost to the view amongst the rocky islets, with a rapidity that +seemed to threaten certain destruction; once, indeed, I fancied that +I saw it overwhelmed in the waves. Such an event would have +been fatal to the whole party. Separated as I was from my com-panions, +without gun, ammunition, hatchet, or the means of making +a fire, and in wet clothes, my doom would have been speedily sealed. +My companions too, driven to the necessity of coasting the lake, +must have sunk under the fatigue of rounding its innumerable arms +and bays, which, as we have learned from the Indians, are very +extensive. By the goodness of Providence, however, we were spared +at that time, and some of us have been permitted to offer up our +thanksgivings, in a civilized land, for the signal deliverances we then +and afterwards experienced. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/pagination/franklin_rep_max_repeats.fo b/examples/fo/pagination/franklin_rep_max_repeats.fo new file mode 100644 index 000000000..9fb5f3189 --- /dev/null +++ b/examples/fo/pagination/franklin_rep_max_repeats.fo @@ -0,0 +1,1024 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="repeating" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:page-sequence-master master-name="repeating_pm"> + <fo:repeatable-page-master-reference master-reference="repeating" + maximum-repeats="15"/> + <fo:single-page-master-reference master-reference="repeating"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="repeating_pm" initial-page-number="1"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="start" font-size="10pt" + font-family="sans-serif" + line-height="10pt" > + John Franklin - Journey to the Shores of the Polar Sea + </fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="end" + font-size="10pt" + font-family="sans-serif" + line-height="14pt" > + p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines local TOC --> + <fo:block font-size="10pt" + font-family="serif" + line-height="12pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="6pt"> +Journey across the barren Grounds - Difficulty and delay in crossing Copper-Mine River - +Melancholy and fatal Results thereof - Extreme Misery of the whole Party - Murder of +Mr. Hood - Death of several of the Canadians - Desolate State of Fort Enterprise - +Distress suffered at that Place - Dr. Richardson's Narrative - Mr. Back's Narrative - +Conclusion. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">1821. August 17. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +MY original intention, whenever the season should +compel us to relinquish the survey, had been to return by the way +of the Copper-Mine River, and in pursuance of my arrangement +with the Hook to travel to Slave Lake through the line of woods +extending thither by the Great Bear and Marten Lakes, but our +scanty stock of provision and the length of the voyage rendered it +necessary to make for a nearer place. We had already found that +the country, between Cape Barrow and the Copper-Mine River, +would not supply our wants, and this it seemed probable would now +be still more the case ; besides, at this advanced season, we expected +the frequent recurrence of gales, which would cause great detention, +if not danger in proceeding along that very rocky part of the coast. +I determined, therefore, to make at once for Arctic Sound, where +we had found the animals more numerous than at any other place ; +and entering Hood's River, to advance up that stream as far as it +was navigable, and then to construct small canoes out of the +materials of the larger ones, which could be carried in crossing the +barren grounds to Fort Enterprise. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 19. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were almost beaten out of our comfortless abodes +by rain during the night, and this morning the gale continued +without diminution. The thermometer fell to 33 deg. Two men were +sent with Junius to search for the deer which Augustus had killed. +Junius returned in the evening bringing part of the meat, but owing +to the thickness of the weather, his companions parted from him +and did not make their appearance. Divine service was read. On +the 20th we were presented with the most chilling prospect, the +small pools of water being frozen over, the ground being covered +with snow, and the thermometer at the freezing point at mid-day. +Flights of geese were passing to the southward. The wind however +was more moderate, having changed to the eastward. Considerable +anxiety prevailing respecting Belanger and Michel, the two men +who strayed from Junius yesterday, the rest were sent out to look +for them. The search was successful, and they all returned in the +evening. The stragglers were much fatigued, and had suffered +severely from the cold, one of them having his thighs frozen, and +what under our present circumstances was most grievous, they had +thrown away all the meat. The wind during the night returned to +the north-west quarter, blew more violently than ever, and raised a +very turbulent sea. The next day did not improve our condition, +the snow remained on the ground, and the small pools were frozen. +Our hunters were sent out, but they returned after a fatiguing +day's march without having seen any animals. We made a scanty +meal off a handful of pemmican, after which only half a bag +remained. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind abated after midnight, and the surf diminished rapidly, +which caused us to be on the alert at a very early hour on the 22d, +but we had to wait until six A.M. for the return of Augustus who +had continued out all night on an unsuccessful pursuit of deer. +It appears that he had walked a few miles farther along the coast, +than the party had done on the 18th, and from a sketch he drew on +the sand, we were confirmed in our former opinion that the shore +inclined more to the eastward beyond Point Turnagain. He also +drew a river of considerable size, that discharges its waters into +Walker's Bay; on the banks of which stream he saw a piece of +wood, such as the Esquimaux use in producing fire, and other marks +so fresh that he supposed they had recently visited the spot. We +therefore left several iron materials for them. Our men, cheered by +the prospect of returning, embarked with the utmost alacrity; and, +paddling with unusual vigour, carried us across Riley's and Walker's +Bays, a distance of twenty miles before noon, when we landed on +Slate-Clay Point, as the wind had freshened too much to permit us +to continue the voyage. The whole party went to hunt, but returned +without success in the evening, drenched with the heavy rain which +commenced soon after they had set out. Several deer were seen, +but could not be approached in this naked country; and as our +stock of pemmican did not admit of serving out two meals, we went +dinnerless to bed. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Soon after our departure to-day, a sealed tin-case, sufficiently +buoyant to float, was thrown overboard, containing a short account of +our proceedings, and the position of the most conspicuous points. +The wind blew off the land, the water was smooth, and as the sea +is in this part more free from islands than in any other, there was +every probability of its being driven off the shore into the current ; +which, as I have before mentioned, we suppose, from the circumstance +of Mackenzie's River being the only known stream that +brings down the wood we have found along the shores, to set to the +eastward. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 23. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +A severe frost caused us to pass a comfortless night. +At two P.M. we set sail, and the men voluntarily launched out to +make a traverse of fifteen miles across Melville Sound, before a +strong wind and heavy sea. The privation of food, under which +our voyagers were then labouring, absorbed every other terror; +otherwise the most powerful persuasion could not have induced +them to attempt such a traverse. It was with the utmost difficulty +that the canoes were kept from turning their broadsides to the +waves, though we sometimes steered with all the paddles. One of +them narrowly escaped being overset by this accident, happening +in mid-channel, where the waves were so high that the mast-head +of our canoe was often hid from the other, though it was sailing +within hail. The annexed plate, from Mr. Back's sketch, will convey +to the reader an accurate idea of the peril of our situation. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The traverse, however, was made;we were then near a high +rocky lee shore, on which a heavy surf was beating. The wind +being on the beam, the canoes drifted fast to leeward; and, on +rounding a point, the recoil of the sea from the rocks was so great +that they were with difficulty kept from foundering. We looked in +vain for a sheltered bay to land in ; but, at length, being unable to +weather another point, we were obliged to put ashore on the open +beach, which, fortunately, was sandy at this spot. The debarkation +was effected in the manner represented in the plate; and, fortunately, +without further injury than the splitting of the head of +the second canoe, which was easily repaired. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Our encampment being near to the place where we killed the deer +on the 11th, almost the whole party went out to hunt, but they +returned in the evening without having seen any game. The +berries, however, were ripe and plentiful, and, with the addition +of some country tea, furnished a supper. There were some showers +in the afternoon,and the weather was cold, the thermometer +being 42 deg, but the evening and night were calm and fine. It may be +remarked that the mosquitoes disappeared when the late gales +commenced. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 25. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at three A. M., we stretched across +the eastern entrance of Bathurst's Inlet, and arrived at an island, +which I have named after Colonel Barry, of Newton Barry. Some +deer being seen on the beach, the hunters went in pursuit of +them, and succeeded in killing three females, which enabled us to +save our last remaining meal of pemmican. They saw also some +fresh tracks of musk oxen on the banks of a small stream, which +flowed into a lake in the centre of the island. These animals must +have crossed a channel, at least, three miles wide, to reach the nearest +of these islands. Some specimens of variegated pebbles and jasper +were found here imbedded in the amygdaloidal rock. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Re-embarking at two P.M., and continuing through what was +supposed to be a channel between two islands, we found our passage +barred by a gravelly isthmus of only ten yards in width ; the canoes +and cargoes were carried across it, and we passed into Bathurst's Inlet +through another similar channel, bounded on both sides by steep +rocky hills. The wind then changing from S.E. to N.W. brought +heavy rain, and we encamped at seven P.M., having advanced +eighteen miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Starting this morning with a fresh breeze in our favour, +we soon reached that part of Barry's Island where the canoes were +detained on the 2d and 3rd of this month, and contrary to what we +then experienced, the deer were now plentiful. The hunters killed +two, and we were relieved from all apprehension of an immediate +want of food. One would suppose the deer were about to retire to +the main shore from their assembling at this time in such numbers +on the islands nearest to the coast. Those we saw were generally +females with their young, and all of them very lean. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind continued in the same direction until we had rounded +Point Wollaston, and then changed to a quarter, which enabled us +to steer for Hood's River, which we ascended as high as the first +rapid and encamped. Here terminated our voyage on the Arctic +sea, during which we had gone over six hundred and fifty geographical +miles. Our Canadian voyagers could not restrain their expressions +of joy at having turned their backs on the sea, and +they passed the evening talking over their past adventures with +much humour and no little exaggeration. The consideration that +the most painful, and certainly the most hazardous, part of the +journey was yet to come, did not depress their spirits at all. It is +due to their character to mention that they displayed much courage +in encountering the dangers of the sea, magnified to them by their +novelty. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The shores between Cape Barrow and Cape Flinders, including +the extensive branches of Arctic and Melville Sounds, and Bathurst's +Inlet, may be comprehended in one great gulf, which I have distinguished +by the appellation of George IV.'s Coronation Gulf, in +honour of His Most Gracious Majesty, the latter name being added +to mark the time of its discovery. The Archipelago of islands which +fringe the coast from Copper-Mine River to Point Turnagain, I have +named in honour of His Royal Highness the Duke of York. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +It may be deserving of notice that the extremes in temperature +of the sea water during our voyage were 53 deg and 35 deg, but its general +temperature was between 43 deg and 48 deg. Throughout our return from +Point Turnagain we observed that the sea had risen several feet +above marks left at our former encampments. This may, perhaps, +be attributed to the north-west gales. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 26. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Previous to our departure this morning, an assortment +of iron materials, beads, looking-glasses, and other articles +were put up in a conspicuous situation for the Esquimaux, and the +English Union was planted on the loftiest sand-hill, where it might +be seen by any ships passing in the offing. Here also, was deposited +in a tin bow a letter containing an outline of our proceedings, the +latitude and longitude of the principal places, and the course we +intended to pursue towards Slave Lake. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at eight A.M. we proceeded up the river, which is full +of sandy shoals, but sufficiently deep for canoes in the channels. It is +from one hundred to two hundred yards wide, and is bounded by high +and steep banks of clay. We encamped at a cascade of eighteen or +twenty feet high, which is produced by a ridge of rock crossing the +river, and the nets were set. A mile below this cascade Hood's +River is joined by a stream half its own size, which I have called +James' Branch. Bear and deer tracks had been numerous on the +banks of the river when we were here before, but not a single recent +one was to be seen at this time. Credit, however, killed a small +deer at some distance inland, which, with the addition of berries, +furnished a delightful repast this evening. The weather was remarkably +fine, and the temperature so mild, that the mosquitoes again +made their appearance, but not in any great numbers. Our distance +made to-day was not more than six miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning the net furnished us with ten white fish +and trout. Having made a further deposit of iron work for the +Esquimaux we pursued our voyage up the river, but the shoals and +rapids in this part were so frequent, that we walked along the banks +the whole day, and the crews laboured hard in carrying the canoes +thus lightened over the shoals or dragging them up the rapids, yet +our journey in a direct line was only about seven miles. In the +evening we encamped at the lower end of a narrow chasm through +which the river flows for upwards of a mile. The walls of this +chasm are upwards of two hundred feet high, quite perpendicular, +and in some places only a few yards apart. The river precipitates +itself into it over a rock, forming two magnificent and picturesque +falls close to each other. The upper fall is about sixty feet high, and +the lower one at least one hundred, but perhaps considerably more, +for the narrowness of the chasm into which it fell prevented us from +seeing its bottom, and we could merely discern the top of the spray +far beneath our feet. The lower fall is divided into two, by an +insulated column of rock which rises about forty feet above it. The +whole descent of the river at this place probably exceeds two +hundred and fifty feet. The rock is very fine felspathose sandstone. +It has a smooth surface and a light red colour. I have named these +magnificent cascades Wilberforce Falls, as a tribute of my respect +for that distinguished philanthropist and Christian. Messrs. Back and +Hood took beautiful sketches of this majestic scene, which are +combined in the annexed plate. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The river being surveyed from the summit of a hill, above these +falls, appeared so rapid and shallow, that it seemed useless to +attempt proceeding any farther in the large canoes. I therefore +determined on constructing out of their materials two smaller ones +of sufficient size to contain three persons, for the purpose of crossing +any river that might obstruct our progress. This operation was +accordingly commenced, and by the 31st both the canoes being +finished, we prepared for our departure on the following day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The leather which had been preserved for making shoes was +equally divided among the men, two pairs of flannel socks were given +to each person, and such articles of warm clothing as remained, were +issued to those who most required them. They were also furnished +with one of the officers' tents. This being done, I communicated to +the men my intention of proceeding in as direct a course as possible +to the part of Point Lake, opposite to our spring encampment +which was only distant one hundred and forty-nine miles in a +straight line. They received the communication cheerfully, considered +the journey to be short, and left me, in high spirits, to +arrange their own packages. The stores, books, &c., which were not +absolutely necessary to be carried, were then put up in boxes to be +left en cache here, in order that the men's burdens might be as light +as possible. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning was warm, and very fine. Every one was on +the alert at an early hour, being anxious to commence the journey. +Our luggage consisted of ammunition, nets, hatchets, ice chisels, +astronomical instruments, clothing, blankets, three kettles, and +the two canoes, which were each carried by one man. The +officers carried such a portion of their own things as their strength +would permit;the weight carried by each man was about ninety +pounds, and with this we advanced at the rate of about a mile an +hour, including rests. In the evening the hunters killed a lean cow, +out of a large drove of musk-oxen; but the men were too much +laden to carry more than a small portion of its flesh. The alluvial +soil, which towards the mouth of the river spreads into plains, +covered with grass and willows, was now giving place to a more +barren and hilly country; so that we could but just collect sufficient +brush wood to cook our suppers. The part of the river we skirted +to-day was shallow, and flowed over a bed of sand ; its width about +one hundred and twenty yards. About midnight our tent was blown +down by a squall, and we were completely drenched with rain before +it could be re-pitched. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the morning of the 1st of September a fall of snow took +place; the canoes became a cause of delay, by the difficulty of +carrying them in a high wind, and they sustained much damage +from the falls of those who had charge of them. The face of the +country was broken by hills of moderate elevation, but the ground +was plentifully strewed with small stones, which, to men bearing +heavy burthens, and whose feet were protected only by soft moose +skin shoes, occasioned great pain. At the end of eleven miles we +encamped, and sent for a musk-ox and a deer, which St. Germain +and Augustus had killed. The day was extremely cold, the ther-mometer +varying between 34 deg and 36 deg. In the afternoon a heavy +fall of snow took place, on the wind changing from north-west to +south-west. We found no wood at the encampment, but made a +fire of moss to cook the supper, and crept under our blankets for +warmth. At sun-rise the thermometer was at 31 deg, and the wind +fresh from north-west; but the weather became mild in the course +of the forenoon, and the snow disappeared from the gravel. The +afternoon was remarkably fine, and the thermometer rose to 50 deg. +One of the hunters killed a musk-ox. The hills in this part are +lower and more round-backed than those we passed yesterday, and +exhibited but little naked rock; they were covered with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having ascertained from the summit of the highest hill near the +tents, that the river continued to preserve a west course; and fear-ing +that by pursuing it further we might lose much time, and un-necessarily +walk over a great deal of ground, I determined on +quitting its banks the next day, and making as directly as we could for +Point Lake. We accordingly followed the river on the 3d, only to +the place where the musk-ox had been killed last evening, and after +the meat was procured, crossed the river in our two canoes lashed +together. We now emerged from the valley of the river, and entered +a level, but very barren, country, varied only by small lakes and +marshes, the ground being covered with small stones. Many old tracks +of rein-deer were seen in the clayey soil, and some more recent +ones of the musk-ox. We encamped on the borders of Wright's +River, which flows to the eastward; the direct distance walked to-day +being ten miles and three-quarters. The next morning was +very fine, and,as the day advanced, the weather became quite +warm. We set out at six A. M., and, having forded the river, +walked over a perfectly level country, interspersed with small lakes, +which communicated with each other, by streams running in various +directions. No berry-bearing plants were found in this part, the +surface of the earth being thinly covered in the moister places with +a few grasses, and on the drier spots with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having walked twelve miles and a half, we encamped at seven P.M., +and distributed our last piece of pemmican, and a little arrow-root +for supper, which afforded but a scanty meal. This evening was +warm, but dark clouds overspread the sky. Our men now began to +find their burdens very oppressive, and were much fatigued by this +day's march, but did not complain. One of them was lame from an +inflammation in the knee. Heavy rain commenced at midnight, and +continued without intermission until five in the morning, when it +was succeeded by snow on the wind changing to north-west, which +soon increased to a violent gale. As we had nothing to eat, and +were destitute of the means of making a fire, we remained in our +beds all the day ; but the covering of our blankets was insufficient to +prevent us from feeling the severity of the frost, and suffering in-convenience +from the drifting of the snow into our tents. There +was no abatement of the storm next day ; our tents were completely +frozen, and the snow had drifted around them to a depth of three +feet, and even in the inside there was a covering of several inches on +our blankets. Our suffering from cold, in a comfortless canvass tent +in such weather, with the temperature at 20 deg, and without fire, +will easily be imagined;it was, however, less than that which we +felt from hunger. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The morning of the 7th cleared up a little, but the wind was still +strong, and the weather extremely cold. From the unusual con-tinuance +of the storm, we feared the winter had set in with all its +rigour, and that by longer delay we should only be exposed to an +accumulation of difficulties; we therefore prepared for our journey, +although we were in a very unfit condition for starting, being weak +from fasting, and our garments stiffened by the frost. We had no +means of making a fire to thaw them, the moss, at all times difficult +to kindle, being now covered with ice and snow. A considerable +time was consumed in packing up the frozen tents and bed clothes, +the wind blowing so strong that no one could keep his hands long +out of his mittens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Just as we were about to commence our march, I was seized with +a fainting fit, in consequence of exhaustion and sudden exposure to +the wind; but after eating a morsel of portable soup, I recovered, so +far as to be able to move on. I was unwilling at first to take this +morsel of soup, which was diminishing the small and only remaining +meal for the party; but several of the men urged me to it, with +much kindness. The ground was covered a foot deep with snow, +the margin of the lakes was incrusted with ice, and the swamps over +which we had to pass were entirely frozen; but the ice not being +sufficiently strong to bear us, we frequently plunged knee-deep in +water. Those who carried the canoes were repeatedly blown down +by the violence of the wind, and they often fell, from making an +insecure step on a slippery stone; on one of these occasions, the +largest canoe was so much broken as to be rendered utterly unser-viceable. +This was felt as a serious disaster, as the remaining canoe +having through mistake been made too small, it was doubtful +whether it would be sufficient to carry us across a river. Indeed +we had found it necessary in crossing Hood's River, to lash the two +canoes together. As there was some suspicion that Benoit, who +carried the canoe, had broken it intentionally, he having on a former +occasion been overheard by some of the men to say, that he would +do so when he got it in charge, we closely examined him on the +point; he roundly denied having used the expressions attributed to +him, and insisted that it was broken by his falling accidentally; and +as he brought men to attest the latter fact, who saw him tumble, we +did not press the matter further. I may here remark that our +people had murmured a good deal at having to carry two canoes, +though they were informed of the necessity of taking both, in case +it should be deemed advisable to divide the party; which it had +been thought probable we should be obliged to do, if animals proved +scarce, in order to give the whole the better chance of procuring +subsistence, and also for the purpose of sending forward some of the +best walkers to search for Indians, and to get them to meet us with +supplies of provision. The power of doing this was now at an end. +As the accident could not be remedied we turned it to the best +account by making a fire of the bark and timbers of the broken +vessel, and cooked the remainder of our portable soup and arrow-root. +This was a scanty meal after three days' fasting, but it served +to allay the pangs of hunger, and enabled us to proceed at a quicker +pace than before. The depth of the snow caused us to march in +Indian file, that is in each other's steps; the voyagers taking it in +turn to lead the party. A distant object was pointed out to this +man in the direction we wished to take, and Mr. Hood followed +immediately behind him, to renew the bearings, and keep him from +deviating more than could be helped from the mark. It may be +here observed, that we proceeded in this manner throughout our +route across the barren grounds. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the afternoon we got into a more hilly country, where the +ground was strewed with large stones. The surface of these was +covered with lichens of the genus gyrophora, which the Canadians +term tripe de roche. A considerable quantity was gathered, and +with half a partridge each, (which were shot in the course of the +day,) furnished us with a slender supper, which we cooked with a +few willows, dug up from beneath the snow. We passed a comfortless +night in our damp clothes, but took the precaution of sleeping upon +our socks and shoes to prevent them from freezing. This plan was +afterwards adopted throughout the journey. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +At half past five in the morning we proceeded; and after walking +about two miles, came to Cracroft's River, flowing to the westward, +with a very rapid current over a rocky channel. We had much diffi-culty +in crossing this, the canoe being useless, not only from the bot-tom +of the channel being obstructed by large stones, but also from its +requiring gumming, an operation which, owing to the want of wood +and the frost, we were unable to perform. However, after following +the course of the river some way, we effected a passage by means of a +range of large rocks that crossed a rapid. As the current was strong, +and many of the rocks were covered with water to the depth of two +or three feet, the men were exposed to much danger in carrying their +heavy burthens across, and several of them actually slipped into the +stream, but were immediately rescued by the others. Junius went +farther up the river in search of a better crossing place, and did not +rejoin us to-day. As several of the party were drenched from head to +foot, and we were all wet to the middle, our clothes became stiff with +the frost, and we walked with much pain for the remainder of the day. +The march was continued to a late hour, being anxious to rejoin the +hunters who had gone before, but we were obliged to encamp at the +end of ten miles and a quarter, without seeing them. Our only +meal to-day consisted of a partridge each, (which the hunters shot,) +mixed with tripe de roche. This repast although scanty for men, +with appetites such as our daily fatigue created, proved a cheerful +one, and was received with thankfulness. Most of the men had to +sleep in the open air, in consequence of the absence of Credit, who +carried their tent; but we fortunately found an unusual quantity of +roots to make a fire, which prevented their suffering much from the +cold, though the thermometer was at 17 deg. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We started at six on the 9th, and at the end of two miles re-gained +our hunters, who were halting on the borders of a lake amidst +a clump of stunted willows. This lake stretched to the westward as +far as we could see, and its waters were discharged by a rapid stream +one hundred and fifty yards wide. Being entirely ignorant where +we might be led by pursuing the course of the lake, and dreading +the idea of going a mile unnecessarily out of the way, we deter-mined +on crossing the river if possible; and the canoe was gummed +for the purpose, the willows furnishing us with fire. But we had to +await the return of Junius before we could make the traverse. In +the mean time we gathered a little tripe de roche, and breakfasted +upon it and a few partridges that were killed in the morning. +St. Germain and Adam were sent upon some recent tracks of deer. +Junius arrived in the afternoon, and informed us that he had seen +a large herd of musk-oxen on the banks of Cracroft's River, and had +wounded one of them, but it had escaped. He brought about four +pounds of meat, the remains of a deer that had been devoured by +the wolves. The poor fellow was much fatigued, having walked +throughout the night, but as the weather was particularly favourable +for our crossing the river, we could not allow him to rest. After he +had taken some refreshment we proceeded to the river. The canoe +being put into the water was found extremely ticklish, but it was +managed with much dexterity by St. Germain, Adam, and Peltier, +who ferried over one passenger at a time, causing him to lie flat in its +bottom, by no means a pleasant position, owing to its leakiness, but +there was no alternative. The transport of the whole party was +effected by five o'clock, and we walked about two miles further, and +encamped, having come five miles and three quarters on a south-west +course. Two young alpine hares were shot by St. Germain, which, +with the small piece of meat brought in by Junius, furnished the +supper of the whole party. There was no tripe de roche here. The +country had now become decidedly hilly, and was covered with snow. +The lake preserved its western direction, as far as I could see from +the summit of the highest mountain near the encampment. We +subsequently learned from the Copper Indians, that the part at +which we had crossed the river was the Congecatha-wha-chaga of +Hearne, of which I had little idea at the time, not only from the +difference of latitude, but also from its being so much farther east of +the mouth of the Copper-Mine River, than his track is laid down. +He only making one degree and three quarters difference of lon-gitude, +and we, upwards of four. Had I been aware of the fact, +several days harassing march, and a disastrous accident would have +been prevented by keeping on the western side of the lake, instead +of crossing the river. We were informed also, that this river is +the Anatessy or River of Strangers, and is supposed to fall into +Bathurst's Inlet; but although the Indians have visited its mouth, +their description was not sufficient to identify it with any of the +rivers whose mouths we had seen. It probably falls in that part of +the coast which was hid from our view by Goulburn's or Elliot's +Islands. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 10. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We had a cold north wind, and the atmosphere +was foggy. The thermometer 18 deg at five A.M. In the course of +our march this morning, we passed many small lakes; and the +ground becoming higher and more hilly as we receded from the +river, was covered to a much greater depth with snow. This ren-dered +walking not only extremely laborious, but also hazardous in +the highest degree;for the sides of the hills, as is usual throughout +the barren grounds, abounding in accumulations of large angular +stones, it often happened that the men fell into the interstices +with their loads on their backs, being deceived by the smooth +appearance of the drifted snow. If any one had broken a limb +here, his fate would have been melancholy indeed; we could neither +have remained with him, nor carried him on. We halted at ten to +gather tripe de roche,but it was so frozen, that we were quite +benumbed with cold before a sufficiency could be collected even for +a scanty meal. On proceeding our men were somewhat cheered, by +observing on the sandy summit of a hill, from whence the snow had +been blown, the summer track of a man; and afterwards by seeing +several deer tracks on the snow. About noon the weather cleared +up a little, and, to our great joy, we saw a herd of musk-oxen +grazing in a valley below us. The party instantly halted, and the +best hunters were sent out; they approached the animals with the +utmost caution, no less than two hours being consumed before they +got within gun-shot. In the mean time we beheld their proceed-ings +with extreme anxiety, and many secret prayers were, doubtless, +offered up for their success. At length they opened their fire, and +we had the satisfaction of seeing one of the largest cows fall; another +was wounded, but escaped. This success infused spirit into our +starving party. To skin and cut up the animal was the work of a +few minutes. The contents of its stomach were devoured upon +the spot, and the raw intestines, which were next attacked, were +pronounced by the most delicate amongst us to be excellent. A few +willows, whose tops were seen peeping through the snow in the bottom +of the valley, were quickly grubbed, the tents pitched, and supper +cooked, and devoured with avidity. This was the sixth day since we +had had a good meal. The tripe de roche, even where we got +enough, only serving to allay the pangs of hunger for a short time. +After supper, two of the hunters went in pursuit of the herd, but +could not get near them. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were detained all the next day by a strong southerly wind, +and were much incommoded in the tents by the drift snow. The +temperature was 20 deg. The average for the last ten days about +24.5 deg. We restricted ourselves to one meal to-day as we were at +rest, and there was only meat remaining sufficient for the next day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The gale had not diminished on the 12th, and, as we were +fearful of its continuance for some time, we determined on going +forward; our only doubt regarded the preservation of the canoe, +but the men promised to pay particular attention to it, and the +most careful persons were appointed to take it in charge. The snow +was two feet deep, and the ground much broken, which rendered +the march extremely painful. The whole party complained more of +faintness and weakness than they had ever done before; their +strength seemed to have been impaired by the recent supply of +animal food. In the afternoon the wind abated, and the snow ceased; +cheered with the change we proceeded forward at a quicker pace, +and encamped at six P. M., having come eleven miles. Our supper +consumed the last of our meat. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We set out on the 13th, in thick hazy weather, and, after an hour's +march, had the extreme mortification to find ourselves on the +borders of a large lake, which we subsequently learned from the +Indians was named Contwoy-to, or Rum Lake; neither of its extre- +mities could be seen, and as the portion which lay to the east +seemed the widest, we coasted along to the westward portion in +search of a crossing-place. This lake being bounded by steep and +lofty hills, our march was very fatiguing. Those sides which were +exposed to the sun, were free from snow, and we found upon them +some excellent berries. We encamped at six P. M., having come +only six miles and a half. Credit was then missing, and he did not +return during the night. We supped off a single partridge and +some tripe de roche;this unpalatable weed was now quite nau-seous +to the whole party, and in several it produced bowel com-plaints. +Mr. Hood was the greatest sufferer from this cause. This +evening we were extremely distressed, at discovering that our im-provident +companions,since we left Hood's River, had thrown +away three of the fishing-nets, and burnt the floats ; they knew we +had brought them to procure subsistence for the party, when the +animals should fail, and we could scarcely believe the fact of their +having wilfully deprived themselves of this resource, especially +when we considered that most of them had passed the greater part of +their servitude in situations where the nets alone had supplied them +with food. Being thus deprived of our principal resource, that of +fishing, and the men evidently getting weaker every day, it became +necessary to lighten their burthens of every thing except ammunition, +clothing, and the instruments that were required to find our +way. I, therefore, issued directions to deposit at this encampment +the dipping needle, azimuth compass, magnet, a large thermometer, +and a few books we had carried, having torn out of these such parts +as we should require to work the observations for latitude and +longitude. I also promised,as an excitement to the efforts in +hunting, my gun to St. Germain, and an ample compensation to +Adam, or any of the other men who should kill any animals. +Mr. Hood, on this occasion, lent his gun to Michel, the Iroquois, +who was very eager in the chase, and often successful. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 14. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +This morning the officers being assembled round +a small fire, Perrault presented each of us with a small piece of meat +which he had saved from his allowance. It was received with great +thankfulness, and such an act of self-denial and kindness, being +totally unexpected in a Canadian voyager, filled our eyes with tears. +In directing our course to a river issuing from the lake, we met +Credit, who communicated the joyful intelligence of his having +killed two deer in the morning. We instantly halted, and having +shared the deer that was nearest to us, prepared breakfast. After +which, the other deer was sent for, and we went down to the river, +which was about three hundred yards wide, and flowed with +great velocity through a broken rocky channel. Having searched +for a part where the current was most smooth, the canoe was +placed in the water at the head of a rapid, and St. Germain, Solomon +Belanger, and I, embarked in order to cross. We went from the +shore very well, but in mid-channel the canoe became difficult to +manage under our burden as the breeze was fresh. The current +drove us to the edge of the rapid, when Belanger unfortunately +applied his paddle to avert the apparent danger of being forced +down it, and lost his balance. The canoe was overset in con-sequence +in the middle of the rapid. We fortunately kept hold of +it, until we touched a rock where the water did not reach higher +than our waists; here we kept our footing, notwithstanding the +strength of the current, until the water was emptied out of the +canoe. Belanger then held the canoe steady whilst St. Germain +placed me in it, and afterwards embarked himself in a very dexterous +manner. It was impossible, however, to embark Belanger, +as the canoe would have been hurried down the rapid, the moment +he should have raised his foot from the rock on which he stood. +We were, therefore, compelled to leave him in his perilous situation. +We had not gone twenty yards before the canoe, striking on a +sunken rock, went down. The place being shallow, we were again +enabled to empty it, and the third attempt brought us to the shore. +In the mean time Belanger was suffering extremely, immersed to +his middle in the centre of a rapid, the temperature of which was +very little above the freezing point, and the upper part of his body +covered with wet clothes, exposed in a temperature not much above +zero, to a strong breeze. He called piteously for relief, and +St. Germain on his return endeavoured to embark him, but in vain. +The canoe was hurried down the rapid, and when he landed he was +rendered by the cold incapable of further exertion, and Adam at-tempted +to embark Belanger, but found it impossible. An attempt +was next made to carry out to him a line, made of the slings of the +men's loads. This also failed, the current acting so strongly upon +it, as to prevent the canoe from steering, and it was finally broken +and carried down the stream. At length, when Belanger's strength +seemed almost exhausted, the canoe reached him with a small cord +belonging to one of the nets, and he was dragged perfectly senseless +through the rapid. By the direction of Dr. Richardson, he was +instantly stripped, and being rolled up in blankets, two men un-dressed +themselves and went to bed with him; but it was some +hours before he recovered his warmth and sensations. As soon as +Belanger was placed in his bed, the officers immediately sent over +my blankets, and a person to make a fire. Augustus brought the +canoe over, and in returning he was obliged to descend both the +rapids, before he could get across the stream; which hazardous +service he performed with the greatest coolness and judgment. It +is impossible to describe my sensations as I witnessed the various +unsuccessful attempts to relieve Belanger. The distance prevented +my seeing distinctly what was going on, and I continued pacing up +and down upon the rock on which I landed, regardless of the +coldness of my drenched and stiffening garments. The canoe, in +every attempt to reach him, was hurried down the rapid, and was +lost to the view amongst the rocky islets, with a rapidity that +seemed to threaten certain destruction; once, indeed, I fancied that +I saw it overwhelmed in the waves. Such an event would have +been fatal to the whole party. Separated as I was from my com-panions, +without gun, ammunition, hatchet, or the means of making +a fire, and in wet clothes, my doom would have been speedily sealed. +My companions too, driven to the necessity of coasting the lake, +must have sunk under the fatigue of rounding its innumerable arms +and bays, which, as we have learned from the Indians, are very +extensive. By the goodness of Providence, however, we were spared +at that time, and some of us have been permitted to offer up our +thanksgivings, in a civilized land, for the signal deliverances we then +and afterwards experienced. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/pagination/franklin_rep_max_repeats_expl.fo b/examples/fo/pagination/franklin_rep_max_repeats_expl.fo new file mode 100644 index 000000000..f8df79662 --- /dev/null +++ b/examples/fo/pagination/franklin_rep_max_repeats_expl.fo @@ -0,0 +1,1024 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="repeating" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:page-sequence-master master-name="repeating_pm"> + <fo:repeatable-page-master-reference master-reference="repeating" + maximum-repeats="15"/> + <fo:single-page-master-reference master-reference="repeating"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="repeating_pm" initial-page-number="1"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="start" font-size="10pt" + font-family="sans-serif" + line-height="10pt" > + John Franklin - Journey to the Shores of the Polar Sea + </fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="end" + font-size="10pt" + font-family="sans-serif" + line-height="14pt" > + p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines local TOC --> + <fo:block font-size="10pt" + font-family="serif" + line-height="12pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="6pt"> +Journey across the barren Grounds - Difficulty and delay in crossing Copper-Mine River - +Melancholy and fatal Results thereof - Extreme Misery of the whole Party - Murder of +Mr. Hood - Death of several of the Canadians - Desolate State of Fort Enterprise - +Distress suffered at that Place - Dr. Richardson's Narrative - Mr. Back's Narrative - +Conclusion. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">1821. August 17. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +MY original intention, whenever the season should +compel us to relinquish the survey, had been to return by the way +of the Copper-Mine River, and in pursuance of my arrangement +with the Hook to travel to Slave Lake through the line of woods +extending thither by the Great Bear and Marten Lakes, but our +scanty stock of provision and the length of the voyage rendered it +necessary to make for a nearer place. We had already found that +the country, between Cape Barrow and the Copper-Mine River, +would not supply our wants, and this it seemed probable would now +be still more the case ; besides, at this advanced season, we expected +the frequent recurrence of gales, which would cause great detention, +if not danger in proceeding along that very rocky part of the coast. +I determined, therefore, to make at once for Arctic Sound, where +we had found the animals more numerous than at any other place ; +and entering Hood's River, to advance up that stream as far as it +was navigable, and then to construct small canoes out of the +materials of the larger ones, which could be carried in crossing the +barren grounds to Fort Enterprise. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 19. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were almost beaten out of our comfortless abodes +by rain during the night, and this morning the gale continued +without diminution. The thermometer fell to 33 deg. Two men were +sent with Junius to search for the deer which Augustus had killed. +Junius returned in the evening bringing part of the meat, but owing +to the thickness of the weather, his companions parted from him +and did not make their appearance. Divine service was read. On +the 20th we were presented with the most chilling prospect, the +small pools of water being frozen over, the ground being covered +with snow, and the thermometer at the freezing point at mid-day. +Flights of geese were passing to the southward. The wind however +was more moderate, having changed to the eastward. Considerable +anxiety prevailing respecting Belanger and Michel, the two men +who strayed from Junius yesterday, the rest were sent out to look +for them. The search was successful, and they all returned in the +evening. The stragglers were much fatigued, and had suffered +severely from the cold, one of them having his thighs frozen, and +what under our present circumstances was most grievous, they had +thrown away all the meat. The wind during the night returned to +the north-west quarter, blew more violently than ever, and raised a +very turbulent sea. The next day did not improve our condition, +the snow remained on the ground, and the small pools were frozen. +Our hunters were sent out, but they returned after a fatiguing +day's march without having seen any animals. We made a scanty +meal off a handful of pemmican, after which only half a bag +remained. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind abated after midnight, and the surf diminished rapidly, +which caused us to be on the alert at a very early hour on the 22d, +but we had to wait until six A.M. for the return of Augustus who +had continued out all night on an unsuccessful pursuit of deer. +It appears that he had walked a few miles farther along the coast, +than the party had done on the 18th, and from a sketch he drew on +the sand, we were confirmed in our former opinion that the shore +inclined more to the eastward beyond Point Turnagain. He also +drew a river of considerable size, that discharges its waters into +Walker's Bay; on the banks of which stream he saw a piece of +wood, such as the Esquimaux use in producing fire, and other marks +so fresh that he supposed they had recently visited the spot. We +therefore left several iron materials for them. Our men, cheered by +the prospect of returning, embarked with the utmost alacrity; and, +paddling with unusual vigour, carried us across Riley's and Walker's +Bays, a distance of twenty miles before noon, when we landed on +Slate-Clay Point, as the wind had freshened too much to permit us +to continue the voyage. The whole party went to hunt, but returned +without success in the evening, drenched with the heavy rain which +commenced soon after they had set out. Several deer were seen, +but could not be approached in this naked country; and as our +stock of pemmican did not admit of serving out two meals, we went +dinnerless to bed. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Soon after our departure to-day, a sealed tin-case, sufficiently +buoyant to float, was thrown overboard, containing a short account of +our proceedings, and the position of the most conspicuous points. +The wind blew off the land, the water was smooth, and as the sea +is in this part more free from islands than in any other, there was +every probability of its being driven off the shore into the current ; +which, as I have before mentioned, we suppose, from the circumstance +of Mackenzie's River being the only known stream that +brings down the wood we have found along the shores, to set to the +eastward. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 23. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +A severe frost caused us to pass a comfortless night. +At two P.M. we set sail, and the men voluntarily launched out to +make a traverse of fifteen miles across Melville Sound, before a +strong wind and heavy sea. The privation of food, under which +our voyagers were then labouring, absorbed every other terror; +otherwise the most powerful persuasion could not have induced +them to attempt such a traverse. It was with the utmost difficulty +that the canoes were kept from turning their broadsides to the +waves, though we sometimes steered with all the paddles. One of +them narrowly escaped being overset by this accident, happening +in mid-channel, where the waves were so high that the mast-head +of our canoe was often hid from the other, though it was sailing +within hail. The annexed plate, from Mr. Back's sketch, will convey +to the reader an accurate idea of the peril of our situation. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The traverse, however, was made;we were then near a high +rocky lee shore, on which a heavy surf was beating. The wind +being on the beam, the canoes drifted fast to leeward; and, on +rounding a point, the recoil of the sea from the rocks was so great +that they were with difficulty kept from foundering. We looked in +vain for a sheltered bay to land in ; but, at length, being unable to +weather another point, we were obliged to put ashore on the open +beach, which, fortunately, was sandy at this spot. The debarkation +was effected in the manner represented in the plate; and, fortunately, +without further injury than the splitting of the head of +the second canoe, which was easily repaired. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Our encampment being near to the place where we killed the deer +on the 11th, almost the whole party went out to hunt, but they +returned in the evening without having seen any game. The +berries, however, were ripe and plentiful, and, with the addition +of some country tea, furnished a supper. There were some showers +in the afternoon,and the weather was cold, the thermometer +being 42 deg, but the evening and night were calm and fine. It may be +remarked that the mosquitoes disappeared when the late gales +commenced. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 25. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at three A. M., we stretched across +the eastern entrance of Bathurst's Inlet, and arrived at an island, +which I have named after Colonel Barry, of Newton Barry. Some +deer being seen on the beach, the hunters went in pursuit of +them, and succeeded in killing three females, which enabled us to +save our last remaining meal of pemmican. They saw also some +fresh tracks of musk oxen on the banks of a small stream, which +flowed into a lake in the centre of the island. These animals must +have crossed a channel, at least, three miles wide, to reach the nearest +of these islands. Some specimens of variegated pebbles and jasper +were found here imbedded in the amygdaloidal rock. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Re-embarking at two P.M., and continuing through what was +supposed to be a channel between two islands, we found our passage +barred by a gravelly isthmus of only ten yards in width ; the canoes +and cargoes were carried across it, and we passed into Bathurst's Inlet +through another similar channel, bounded on both sides by steep +rocky hills. The wind then changing from S.E. to N.W. brought +heavy rain, and we encamped at seven P.M., having advanced +eighteen miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Starting this morning with a fresh breeze in our favour, +we soon reached that part of Barry's Island where the canoes were +detained on the 2d and 3rd of this month, and contrary to what we +then experienced, the deer were now plentiful. The hunters killed +two, and we were relieved from all apprehension of an immediate +want of food. One would suppose the deer were about to retire to +the main shore from their assembling at this time in such numbers +on the islands nearest to the coast. Those we saw were generally +females with their young, and all of them very lean. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind continued in the same direction until we had rounded +Point Wollaston, and then changed to a quarter, which enabled us +to steer for Hood's River, which we ascended as high as the first +rapid and encamped. Here terminated our voyage on the Arctic +sea, during which we had gone over six hundred and fifty geographical +miles. Our Canadian voyagers could not restrain their expressions +of joy at having turned their backs on the sea, and +they passed the evening talking over their past adventures with +much humour and no little exaggeration. The consideration that +the most painful, and certainly the most hazardous, part of the +journey was yet to come, did not depress their spirits at all. It is +due to their character to mention that they displayed much courage +in encountering the dangers of the sea, magnified to them by their +novelty. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The shores between Cape Barrow and Cape Flinders, including +the extensive branches of Arctic and Melville Sounds, and Bathurst's +Inlet, may be comprehended in one great gulf, which I have distinguished +by the appellation of George IV.'s Coronation Gulf, in +honour of His Most Gracious Majesty, the latter name being added +to mark the time of its discovery. The Archipelago of islands which +fringe the coast from Copper-Mine River to Point Turnagain, I have +named in honour of His Royal Highness the Duke of York. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +It may be deserving of notice that the extremes in temperature +of the sea water during our voyage were 53 deg and 35 deg, but its general +temperature was between 43 deg and 48 deg. Throughout our return from +Point Turnagain we observed that the sea had risen several feet +above marks left at our former encampments. This may, perhaps, +be attributed to the north-west gales. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 26. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Previous to our departure this morning, an assortment +of iron materials, beads, looking-glasses, and other articles +were put up in a conspicuous situation for the Esquimaux, and the +English Union was planted on the loftiest sand-hill, where it might +be seen by any ships passing in the offing. Here also, was deposited +in a tin bow a letter containing an outline of our proceedings, the +latitude and longitude of the principal places, and the course we +intended to pursue towards Slave Lake. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at eight A.M. we proceeded up the river, which is full +of sandy shoals, but sufficiently deep for canoes in the channels. It is +from one hundred to two hundred yards wide, and is bounded by high +and steep banks of clay. We encamped at a cascade of eighteen or +twenty feet high, which is produced by a ridge of rock crossing the +river, and the nets were set. A mile below this cascade Hood's +River is joined by a stream half its own size, which I have called +James' Branch. Bear and deer tracks had been numerous on the +banks of the river when we were here before, but not a single recent +one was to be seen at this time. Credit, however, killed a small +deer at some distance inland, which, with the addition of berries, +furnished a delightful repast this evening. The weather was remarkably +fine, and the temperature so mild, that the mosquitoes again +made their appearance, but not in any great numbers. Our distance +made to-day was not more than six miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning the net furnished us with ten white fish +and trout. Having made a further deposit of iron work for the +Esquimaux we pursued our voyage up the river, but the shoals and +rapids in this part were so frequent, that we walked along the banks +the whole day, and the crews laboured hard in carrying the canoes +thus lightened over the shoals or dragging them up the rapids, yet +our journey in a direct line was only about seven miles. In the +evening we encamped at the lower end of a narrow chasm through +which the river flows for upwards of a mile. The walls of this +chasm are upwards of two hundred feet high, quite perpendicular, +and in some places only a few yards apart. The river precipitates +itself into it over a rock, forming two magnificent and picturesque +falls close to each other. The upper fall is about sixty feet high, and +the lower one at least one hundred, but perhaps considerably more, +for the narrowness of the chasm into which it fell prevented us from +seeing its bottom, and we could merely discern the top of the spray +far beneath our feet. The lower fall is divided into two, by an +insulated column of rock which rises about forty feet above it. The +whole descent of the river at this place probably exceeds two +hundred and fifty feet. The rock is very fine felspathose sandstone. +It has a smooth surface and a light red colour. I have named these +magnificent cascades Wilberforce Falls, as a tribute of my respect +for that distinguished philanthropist and Christian. Messrs. Back and +Hood took beautiful sketches of this majestic scene, which are +combined in the annexed plate. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The river being surveyed from the summit of a hill, above these +falls, appeared so rapid and shallow, that it seemed useless to +attempt proceeding any farther in the large canoes. I therefore +determined on constructing out of their materials two smaller ones +of sufficient size to contain three persons, for the purpose of crossing +any river that might obstruct our progress. This operation was +accordingly commenced, and by the 31st both the canoes being +finished, we prepared for our departure on the following day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The leather which had been preserved for making shoes was +equally divided among the men, two pairs of flannel socks were given +to each person, and such articles of warm clothing as remained, were +issued to those who most required them. They were also furnished +with one of the officers' tents. This being done, I communicated to +the men my intention of proceeding in as direct a course as possible +to the part of Point Lake, opposite to our spring encampment +which was only distant one hundred and forty-nine miles in a +straight line. They received the communication cheerfully, considered +the journey to be short, and left me, in high spirits, to +arrange their own packages. The stores, books, &c., which were not +absolutely necessary to be carried, were then put up in boxes to be +left en cache here, in order that the men's burdens might be as light +as possible. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning was warm, and very fine. Every one was on +the alert at an early hour, being anxious to commence the journey. +Our luggage consisted of ammunition, nets, hatchets, ice chisels, +astronomical instruments, clothing, blankets, three kettles, and +the two canoes, which were each carried by one man. The +officers carried such a portion of their own things as their strength +would permit;the weight carried by each man was about ninety +pounds, and with this we advanced at the rate of about a mile an +hour, including rests. In the evening the hunters killed a lean cow, +out of a large drove of musk-oxen; but the men were too much +laden to carry more than a small portion of its flesh. The alluvial +soil, which towards the mouth of the river spreads into plains, +covered with grass and willows, was now giving place to a more +barren and hilly country; so that we could but just collect sufficient +brush wood to cook our suppers. The part of the river we skirted +to-day was shallow, and flowed over a bed of sand ; its width about +one hundred and twenty yards. About midnight our tent was blown +down by a squall, and we were completely drenched with rain before +it could be re-pitched. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the morning of the 1st of September a fall of snow took +place; the canoes became a cause of delay, by the difficulty of +carrying them in a high wind, and they sustained much damage +from the falls of those who had charge of them. The face of the +country was broken by hills of moderate elevation, but the ground +was plentifully strewed with small stones, which, to men bearing +heavy burthens, and whose feet were protected only by soft moose +skin shoes, occasioned great pain. At the end of eleven miles we +encamped, and sent for a musk-ox and a deer, which St. Germain +and Augustus had killed. The day was extremely cold, the ther-mometer +varying between 34 deg and 36 deg. In the afternoon a heavy +fall of snow took place, on the wind changing from north-west to +south-west. We found no wood at the encampment, but made a +fire of moss to cook the supper, and crept under our blankets for +warmth. At sun-rise the thermometer was at 31 deg, and the wind +fresh from north-west; but the weather became mild in the course +of the forenoon, and the snow disappeared from the gravel. The +afternoon was remarkably fine, and the thermometer rose to 50 deg. +One of the hunters killed a musk-ox. The hills in this part are +lower and more round-backed than those we passed yesterday, and +exhibited but little naked rock; they were covered with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having ascertained from the summit of the highest hill near the +tents, that the river continued to preserve a west course; and fear-ing +that by pursuing it further we might lose much time, and un-necessarily +walk over a great deal of ground, I determined on +quitting its banks the next day, and making as directly as we could for +Point Lake. We accordingly followed the river on the 3d, only to +the place where the musk-ox had been killed last evening, and after +the meat was procured, crossed the river in our two canoes lashed +together. We now emerged from the valley of the river, and entered +a level, but very barren, country, varied only by small lakes and +marshes, the ground being covered with small stones. Many old tracks +of rein-deer were seen in the clayey soil, and some more recent +ones of the musk-ox. We encamped on the borders of Wright's +River, which flows to the eastward; the direct distance walked to-day +being ten miles and three-quarters. The next morning was +very fine, and,as the day advanced, the weather became quite +warm. We set out at six A. M., and, having forded the river, +walked over a perfectly level country, interspersed with small lakes, +which communicated with each other, by streams running in various +directions. No berry-bearing plants were found in this part, the +surface of the earth being thinly covered in the moister places with +a few grasses, and on the drier spots with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having walked twelve miles and a half, we encamped at seven P.M., +and distributed our last piece of pemmican, and a little arrow-root +for supper, which afforded but a scanty meal. This evening was +warm, but dark clouds overspread the sky. Our men now began to +find their burdens very oppressive, and were much fatigued by this +day's march, but did not complain. One of them was lame from an +inflammation in the knee. Heavy rain commenced at midnight, and +continued without intermission until five in the morning, when it +was succeeded by snow on the wind changing to north-west, which +soon increased to a violent gale. As we had nothing to eat, and +were destitute of the means of making a fire, we remained in our +beds all the day ; but the covering of our blankets was insufficient to +prevent us from feeling the severity of the frost, and suffering in-convenience +from the drifting of the snow into our tents. There +was no abatement of the storm next day ; our tents were completely +frozen, and the snow had drifted around them to a depth of three +feet, and even in the inside there was a covering of several inches on +our blankets. Our suffering from cold, in a comfortless canvass tent +in such weather, with the temperature at 20 deg, and without fire, +will easily be imagined;it was, however, less than that which we +felt from hunger. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The morning of the 7th cleared up a little, but the wind was still +strong, and the weather extremely cold. From the unusual con-tinuance +of the storm, we feared the winter had set in with all its +rigour, and that by longer delay we should only be exposed to an +accumulation of difficulties; we therefore prepared for our journey, +although we were in a very unfit condition for starting, being weak +from fasting, and our garments stiffened by the frost. We had no +means of making a fire to thaw them, the moss, at all times difficult +to kindle, being now covered with ice and snow. A considerable +time was consumed in packing up the frozen tents and bed clothes, +the wind blowing so strong that no one could keep his hands long +out of his mittens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Just as we were about to commence our march, I was seized with +a fainting fit, in consequence of exhaustion and sudden exposure to +the wind; but after eating a morsel of portable soup, I recovered, so +far as to be able to move on. I was unwilling at first to take this +morsel of soup, which was diminishing the small and only remaining +meal for the party; but several of the men urged me to it, with +much kindness. The ground was covered a foot deep with snow, +the margin of the lakes was incrusted with ice, and the swamps over +which we had to pass were entirely frozen; but the ice not being +sufficiently strong to bear us, we frequently plunged knee-deep in +water. Those who carried the canoes were repeatedly blown down +by the violence of the wind, and they often fell, from making an +insecure step on a slippery stone; on one of these occasions, the +largest canoe was so much broken as to be rendered utterly unser-viceable. +This was felt as a serious disaster, as the remaining canoe +having through mistake been made too small, it was doubtful +whether it would be sufficient to carry us across a river. Indeed +we had found it necessary in crossing Hood's River, to lash the two +canoes together. As there was some suspicion that Benoit, who +carried the canoe, had broken it intentionally, he having on a former +occasion been overheard by some of the men to say, that he would +do so when he got it in charge, we closely examined him on the +point; he roundly denied having used the expressions attributed to +him, and insisted that it was broken by his falling accidentally; and +as he brought men to attest the latter fact, who saw him tumble, we +did not press the matter further. I may here remark that our +people had murmured a good deal at having to carry two canoes, +though they were informed of the necessity of taking both, in case +it should be deemed advisable to divide the party; which it had +been thought probable we should be obliged to do, if animals proved +scarce, in order to give the whole the better chance of procuring +subsistence, and also for the purpose of sending forward some of the +best walkers to search for Indians, and to get them to meet us with +supplies of provision. The power of doing this was now at an end. +As the accident could not be remedied we turned it to the best +account by making a fire of the bark and timbers of the broken +vessel, and cooked the remainder of our portable soup and arrow-root. +This was a scanty meal after three days' fasting, but it served +to allay the pangs of hunger, and enabled us to proceed at a quicker +pace than before. The depth of the snow caused us to march in +Indian file, that is in each other's steps; the voyagers taking it in +turn to lead the party. A distant object was pointed out to this +man in the direction we wished to take, and Mr. Hood followed +immediately behind him, to renew the bearings, and keep him from +deviating more than could be helped from the mark. It may be +here observed, that we proceeded in this manner throughout our +route across the barren grounds. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the afternoon we got into a more hilly country, where the +ground was strewed with large stones. The surface of these was +covered with lichens of the genus gyrophora, which the Canadians +term tripe de roche. A considerable quantity was gathered, and +with half a partridge each, (which were shot in the course of the +day,) furnished us with a slender supper, which we cooked with a +few willows, dug up from beneath the snow. We passed a comfortless +night in our damp clothes, but took the precaution of sleeping upon +our socks and shoes to prevent them from freezing. This plan was +afterwards adopted throughout the journey. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +At half past five in the morning we proceeded; and after walking +about two miles, came to Cracroft's River, flowing to the westward, +with a very rapid current over a rocky channel. We had much diffi-culty +in crossing this, the canoe being useless, not only from the bot-tom +of the channel being obstructed by large stones, but also from its +requiring gumming, an operation which, owing to the want of wood +and the frost, we were unable to perform. However, after following +the course of the river some way, we effected a passage by means of a +range of large rocks that crossed a rapid. As the current was strong, +and many of the rocks were covered with water to the depth of two +or three feet, the men were exposed to much danger in carrying their +heavy burthens across, and several of them actually slipped into the +stream, but were immediately rescued by the others. Junius went +farther up the river in search of a better crossing place, and did not +rejoin us to-day. As several of the party were drenched from head to +foot, and we were all wet to the middle, our clothes became stiff with +the frost, and we walked with much pain for the remainder of the day. +The march was continued to a late hour, being anxious to rejoin the +hunters who had gone before, but we were obliged to encamp at the +end of ten miles and a quarter, without seeing them. Our only +meal to-day consisted of a partridge each, (which the hunters shot,) +mixed with tripe de roche. This repast although scanty for men, +with appetites such as our daily fatigue created, proved a cheerful +one, and was received with thankfulness. Most of the men had to +sleep in the open air, in consequence of the absence of Credit, who +carried their tent; but we fortunately found an unusual quantity of +roots to make a fire, which prevented their suffering much from the +cold, though the thermometer was at 17 deg. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We started at six on the 9th, and at the end of two miles re-gained +our hunters, who were halting on the borders of a lake amidst +a clump of stunted willows. This lake stretched to the westward as +far as we could see, and its waters were discharged by a rapid stream +one hundred and fifty yards wide. Being entirely ignorant where +we might be led by pursuing the course of the lake, and dreading +the idea of going a mile unnecessarily out of the way, we deter-mined +on crossing the river if possible; and the canoe was gummed +for the purpose, the willows furnishing us with fire. But we had to +await the return of Junius before we could make the traverse. In +the mean time we gathered a little tripe de roche, and breakfasted +upon it and a few partridges that were killed in the morning. +St. Germain and Adam were sent upon some recent tracks of deer. +Junius arrived in the afternoon, and informed us that he had seen +a large herd of musk-oxen on the banks of Cracroft's River, and had +wounded one of them, but it had escaped. He brought about four +pounds of meat, the remains of a deer that had been devoured by +the wolves. The poor fellow was much fatigued, having walked +throughout the night, but as the weather was particularly favourable +for our crossing the river, we could not allow him to rest. After he +had taken some refreshment we proceeded to the river. The canoe +being put into the water was found extremely ticklish, but it was +managed with much dexterity by St. Germain, Adam, and Peltier, +who ferried over one passenger at a time, causing him to lie flat in its +bottom, by no means a pleasant position, owing to its leakiness, but +there was no alternative. The transport of the whole party was +effected by five o'clock, and we walked about two miles further, and +encamped, having come five miles and three quarters on a south-west +course. Two young alpine hares were shot by St. Germain, which, +with the small piece of meat brought in by Junius, furnished the +supper of the whole party. There was no tripe de roche here. The +country had now become decidedly hilly, and was covered with snow. +The lake preserved its western direction, as far as I could see from +the summit of the highest mountain near the encampment. We +subsequently learned from the Copper Indians, that the part at +which we had crossed the river was the Congecatha-wha-chaga of +Hearne, of which I had little idea at the time, not only from the +difference of latitude, but also from its being so much farther east of +the mouth of the Copper-Mine River, than his track is laid down. +He only making one degree and three quarters difference of lon-gitude, +and we, upwards of four. Had I been aware of the fact, +several days harassing march, and a disastrous accident would have +been prevented by keeping on the western side of the lake, instead +of crossing the river. We were informed also, that this river is +the Anatessy or River of Strangers, and is supposed to fall into +Bathurst's Inlet; but although the Indians have visited its mouth, +their description was not sufficient to identify it with any of the +rivers whose mouths we had seen. It probably falls in that part of +the coast which was hid from our view by Goulburn's or Elliot's +Islands. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 10. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We had a cold north wind, and the atmosphere +was foggy. The thermometer 18 deg at five A.M. In the course of +our march this morning, we passed many small lakes; and the +ground becoming higher and more hilly as we receded from the +river, was covered to a much greater depth with snow. This ren-dered +walking not only extremely laborious, but also hazardous in +the highest degree;for the sides of the hills, as is usual throughout +the barren grounds, abounding in accumulations of large angular +stones, it often happened that the men fell into the interstices +with their loads on their backs, being deceived by the smooth +appearance of the drifted snow. If any one had broken a limb +here, his fate would have been melancholy indeed; we could neither +have remained with him, nor carried him on. We halted at ten to +gather tripe de roche,but it was so frozen, that we were quite +benumbed with cold before a sufficiency could be collected even for +a scanty meal. On proceeding our men were somewhat cheered, by +observing on the sandy summit of a hill, from whence the snow had +been blown, the summer track of a man; and afterwards by seeing +several deer tracks on the snow. About noon the weather cleared +up a little, and, to our great joy, we saw a herd of musk-oxen +grazing in a valley below us. The party instantly halted, and the +best hunters were sent out; they approached the animals with the +utmost caution, no less than two hours being consumed before they +got within gun-shot. In the mean time we beheld their proceed-ings +with extreme anxiety, and many secret prayers were, doubtless, +offered up for their success. At length they opened their fire, and +we had the satisfaction of seeing one of the largest cows fall; another +was wounded, but escaped. This success infused spirit into our +starving party. To skin and cut up the animal was the work of a +few minutes. The contents of its stomach were devoured upon +the spot, and the raw intestines, which were next attacked, were +pronounced by the most delicate amongst us to be excellent. A few +willows, whose tops were seen peeping through the snow in the bottom +of the valley, were quickly grubbed, the tents pitched, and supper +cooked, and devoured with avidity. This was the sixth day since we +had had a good meal. The tripe de roche, even where we got +enough, only serving to allay the pangs of hunger for a short time. +After supper, two of the hunters went in pursuit of the herd, but +could not get near them. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were detained all the next day by a strong southerly wind, +and were much incommoded in the tents by the drift snow. The +temperature was 20 deg. The average for the last ten days about +24.5 deg. We restricted ourselves to one meal to-day as we were at +rest, and there was only meat remaining sufficient for the next day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The gale had not diminished on the 12th, and, as we were +fearful of its continuance for some time, we determined on going +forward; our only doubt regarded the preservation of the canoe, +but the men promised to pay particular attention to it, and the +most careful persons were appointed to take it in charge. The snow +was two feet deep, and the ground much broken, which rendered +the march extremely painful. The whole party complained more of +faintness and weakness than they had ever done before; their +strength seemed to have been impaired by the recent supply of +animal food. In the afternoon the wind abated, and the snow ceased; +cheered with the change we proceeded forward at a quicker pace, +and encamped at six P. M., having come eleven miles. Our supper +consumed the last of our meat. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We set out on the 13th, in thick hazy weather, and, after an hour's +march, had the extreme mortification to find ourselves on the +borders of a large lake, which we subsequently learned from the +Indians was named Contwoy-to, or Rum Lake; neither of its extre- +mities could be seen, and as the portion which lay to the east +seemed the widest, we coasted along to the westward portion in +search of a crossing-place. This lake being bounded by steep and +lofty hills, our march was very fatiguing. Those sides which were +exposed to the sun, were free from snow, and we found upon them +some excellent berries. We encamped at six P. M., having come +only six miles and a half. Credit was then missing, and he did not +return during the night. We supped off a single partridge and +some tripe de roche;this unpalatable weed was now quite nau-seous +to the whole party, and in several it produced bowel com-plaints. +Mr. Hood was the greatest sufferer from this cause. This +evening we were extremely distressed, at discovering that our im-provident +companions,since we left Hood's River, had thrown +away three of the fishing-nets, and burnt the floats ; they knew we +had brought them to procure subsistence for the party, when the +animals should fail, and we could scarcely believe the fact of their +having wilfully deprived themselves of this resource, especially +when we considered that most of them had passed the greater part of +their servitude in situations where the nets alone had supplied them +with food. Being thus deprived of our principal resource, that of +fishing, and the men evidently getting weaker every day, it became +necessary to lighten their burthens of every thing except ammunition, +clothing, and the instruments that were required to find our +way. I, therefore, issued directions to deposit at this encampment +the dipping needle, azimuth compass, magnet, a large thermometer, +and a few books we had carried, having torn out of these such parts +as we should require to work the observations for latitude and +longitude. I also promised,as an excitement to the efforts in +hunting, my gun to St. Germain, and an ample compensation to +Adam, or any of the other men who should kill any animals. +Mr. Hood, on this occasion, lent his gun to Michel, the Iroquois, +who was very eager in the chase, and often successful. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 14. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +This morning the officers being assembled round +a small fire, Perrault presented each of us with a small piece of meat +which he had saved from his allowance. It was received with great +thankfulness, and such an act of self-denial and kindness, being +totally unexpected in a Canadian voyager, filled our eyes with tears. +In directing our course to a river issuing from the lake, we met +Credit, who communicated the joyful intelligence of his having +killed two deer in the morning. We instantly halted, and having +shared the deer that was nearest to us, prepared breakfast. After +which, the other deer was sent for, and we went down to the river, +which was about three hundred yards wide, and flowed with +great velocity through a broken rocky channel. Having searched +for a part where the current was most smooth, the canoe was +placed in the water at the head of a rapid, and St. Germain, Solomon +Belanger, and I, embarked in order to cross. We went from the +shore very well, but in mid-channel the canoe became difficult to +manage under our burden as the breeze was fresh. The current +drove us to the edge of the rapid, when Belanger unfortunately +applied his paddle to avert the apparent danger of being forced +down it, and lost his balance. The canoe was overset in con-sequence +in the middle of the rapid. We fortunately kept hold of +it, until we touched a rock where the water did not reach higher +than our waists; here we kept our footing, notwithstanding the +strength of the current, until the water was emptied out of the +canoe. Belanger then held the canoe steady whilst St. Germain +placed me in it, and afterwards embarked himself in a very dexterous +manner. It was impossible, however, to embark Belanger, +as the canoe would have been hurried down the rapid, the moment +he should have raised his foot from the rock on which he stood. +We were, therefore, compelled to leave him in his perilous situation. +We had not gone twenty yards before the canoe, striking on a +sunken rock, went down. The place being shallow, we were again +enabled to empty it, and the third attempt brought us to the shore. +In the mean time Belanger was suffering extremely, immersed to +his middle in the centre of a rapid, the temperature of which was +very little above the freezing point, and the upper part of his body +covered with wet clothes, exposed in a temperature not much above +zero, to a strong breeze. He called piteously for relief, and +St. Germain on his return endeavoured to embark him, but in vain. +The canoe was hurried down the rapid, and when he landed he was +rendered by the cold incapable of further exertion, and Adam at-tempted +to embark Belanger, but found it impossible. An attempt +was next made to carry out to him a line, made of the slings of the +men's loads. This also failed, the current acting so strongly upon +it, as to prevent the canoe from steering, and it was finally broken +and carried down the stream. At length, when Belanger's strength +seemed almost exhausted, the canoe reached him with a small cord +belonging to one of the nets, and he was dragged perfectly senseless +through the rapid. By the direction of Dr. Richardson, he was +instantly stripped, and being rolled up in blankets, two men un-dressed +themselves and went to bed with him; but it was some +hours before he recovered his warmth and sensations. As soon as +Belanger was placed in his bed, the officers immediately sent over +my blankets, and a person to make a fire. Augustus brought the +canoe over, and in returning he was obliged to descend both the +rapids, before he could get across the stream; which hazardous +service he performed with the greatest coolness and judgment. It +is impossible to describe my sensations as I witnessed the various +unsuccessful attempts to relieve Belanger. The distance prevented +my seeing distinctly what was going on, and I continued pacing up +and down upon the rock on which I landed, regardless of the +coldness of my drenched and stiffening garments. The canoe, in +every attempt to reach him, was hurried down the rapid, and was +lost to the view amongst the rocky islets, with a rapidity that +seemed to threaten certain destruction; once, indeed, I fancied that +I saw it overwhelmed in the waves. Such an event would have +been fatal to the whole party. Separated as I was from my com-panions, +without gun, ammunition, hatchet, or the means of making +a fire, and in wet clothes, my doom would have been speedily sealed. +My companions too, driven to the necessity of coasting the lake, +must have sunk under the fatigue of rounding its innumerable arms +and bays, which, as we have learned from the Indians, are very +extensive. By the goodness of Providence, however, we were spared +at that time, and some of us have been permitted to offer up our +thanksgivings, in a civilized land, for the signal deliverances we then +and afterwards experienced. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/pagination/franklin_rep_max_repeats_nl.fo b/examples/fo/pagination/franklin_rep_max_repeats_nl.fo new file mode 100644 index 000000000..34c35e746 --- /dev/null +++ b/examples/fo/pagination/franklin_rep_max_repeats_nl.fo @@ -0,0 +1,1024 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="repeating" + page-height="21.7cm" + page-width="16cm" + margin-top="1cm" + margin-bottom="1cm" + margin-left="2.5cm" + margin-right="2.5cm"> + <fo:region-body margin-top="2cm" margin-bottom="2cm"/> + <fo:region-before extent="2cm"/> + <fo:region-after extent="2cm"/> + </fo:simple-page-master> + + <fo:page-sequence-master master-name="repeating_pm"> + <fo:repeatable-page-master-reference master-reference="repeating" + maximum-repeats="no-limit"/> + <fo:single-page-master-reference master-reference="repeating"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + <!-- actual layout --> + <fo:page-sequence master-reference="repeating_pm" initial-page-number="1"> + + <!-- header --> + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="start" font-size="10pt" + font-family="sans-serif" + line-height="10pt" > + John Franklin - Journey to the Shores of the Polar Sea + </fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block text-align="end" + font-size="10pt" + font-family="sans-serif" + line-height="14pt" > + p. <fo:page-number/> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- defines local TOC --> + <fo:block font-size="10pt" + font-family="serif" + line-height="12pt" + space-before.optimum="10pt" + space-after.optimum="10pt" + text-align="start" + padding-top="6pt"> +Journey across the barren Grounds - Difficulty and delay in crossing Copper-Mine River - +Melancholy and fatal Results thereof - Extreme Misery of the whole Party - Murder of +Mr. Hood - Death of several of the Canadians - Desolate State of Fort Enterprise - +Distress suffered at that Place - Dr. Richardson's Narrative - Mr. Back's Narrative - +Conclusion. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">1821. August 17. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +MY original intention, whenever the season should +compel us to relinquish the survey, had been to return by the way +of the Copper-Mine River, and in pursuance of my arrangement +with the Hook to travel to Slave Lake through the line of woods +extending thither by the Great Bear and Marten Lakes, but our +scanty stock of provision and the length of the voyage rendered it +necessary to make for a nearer place. We had already found that +the country, between Cape Barrow and the Copper-Mine River, +would not supply our wants, and this it seemed probable would now +be still more the case ; besides, at this advanced season, we expected +the frequent recurrence of gales, which would cause great detention, +if not danger in proceeding along that very rocky part of the coast. +I determined, therefore, to make at once for Arctic Sound, where +we had found the animals more numerous than at any other place ; +and entering Hood's River, to advance up that stream as far as it +was navigable, and then to construct small canoes out of the +materials of the larger ones, which could be carried in crossing the +barren grounds to Fort Enterprise. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 19. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were almost beaten out of our comfortless abodes +by rain during the night, and this morning the gale continued +without diminution. The thermometer fell to 33 deg. Two men were +sent with Junius to search for the deer which Augustus had killed. +Junius returned in the evening bringing part of the meat, but owing +to the thickness of the weather, his companions parted from him +and did not make their appearance. Divine service was read. On +the 20th we were presented with the most chilling prospect, the +small pools of water being frozen over, the ground being covered +with snow, and the thermometer at the freezing point at mid-day. +Flights of geese were passing to the southward. The wind however +was more moderate, having changed to the eastward. Considerable +anxiety prevailing respecting Belanger and Michel, the two men +who strayed from Junius yesterday, the rest were sent out to look +for them. The search was successful, and they all returned in the +evening. The stragglers were much fatigued, and had suffered +severely from the cold, one of them having his thighs frozen, and +what under our present circumstances was most grievous, they had +thrown away all the meat. The wind during the night returned to +the north-west quarter, blew more violently than ever, and raised a +very turbulent sea. The next day did not improve our condition, +the snow remained on the ground, and the small pools were frozen. +Our hunters were sent out, but they returned after a fatiguing +day's march without having seen any animals. We made a scanty +meal off a handful of pemmican, after which only half a bag +remained. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind abated after midnight, and the surf diminished rapidly, +which caused us to be on the alert at a very early hour on the 22d, +but we had to wait until six A.M. for the return of Augustus who +had continued out all night on an unsuccessful pursuit of deer. +It appears that he had walked a few miles farther along the coast, +than the party had done on the 18th, and from a sketch he drew on +the sand, we were confirmed in our former opinion that the shore +inclined more to the eastward beyond Point Turnagain. He also +drew a river of considerable size, that discharges its waters into +Walker's Bay; on the banks of which stream he saw a piece of +wood, such as the Esquimaux use in producing fire, and other marks +so fresh that he supposed they had recently visited the spot. We +therefore left several iron materials for them. Our men, cheered by +the prospect of returning, embarked with the utmost alacrity; and, +paddling with unusual vigour, carried us across Riley's and Walker's +Bays, a distance of twenty miles before noon, when we landed on +Slate-Clay Point, as the wind had freshened too much to permit us +to continue the voyage. The whole party went to hunt, but returned +without success in the evening, drenched with the heavy rain which +commenced soon after they had set out. Several deer were seen, +but could not be approached in this naked country; and as our +stock of pemmican did not admit of serving out two meals, we went +dinnerless to bed. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Soon after our departure to-day, a sealed tin-case, sufficiently +buoyant to float, was thrown overboard, containing a short account of +our proceedings, and the position of the most conspicuous points. +The wind blew off the land, the water was smooth, and as the sea +is in this part more free from islands than in any other, there was +every probability of its being driven off the shore into the current ; +which, as I have before mentioned, we suppose, from the circumstance +of Mackenzie's River being the only known stream that +brings down the wood we have found along the shores, to set to the +eastward. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 23. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +A severe frost caused us to pass a comfortless night. +At two P.M. we set sail, and the men voluntarily launched out to +make a traverse of fifteen miles across Melville Sound, before a +strong wind and heavy sea. The privation of food, under which +our voyagers were then labouring, absorbed every other terror; +otherwise the most powerful persuasion could not have induced +them to attempt such a traverse. It was with the utmost difficulty +that the canoes were kept from turning their broadsides to the +waves, though we sometimes steered with all the paddles. One of +them narrowly escaped being overset by this accident, happening +in mid-channel, where the waves were so high that the mast-head +of our canoe was often hid from the other, though it was sailing +within hail. The annexed plate, from Mr. Back's sketch, will convey +to the reader an accurate idea of the peril of our situation. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The traverse, however, was made;we were then near a high +rocky lee shore, on which a heavy surf was beating. The wind +being on the beam, the canoes drifted fast to leeward; and, on +rounding a point, the recoil of the sea from the rocks was so great +that they were with difficulty kept from foundering. We looked in +vain for a sheltered bay to land in ; but, at length, being unable to +weather another point, we were obliged to put ashore on the open +beach, which, fortunately, was sandy at this spot. The debarkation +was effected in the manner represented in the plate; and, fortunately, +without further injury than the splitting of the head of +the second canoe, which was easily repaired. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Our encampment being near to the place where we killed the deer +on the 11th, almost the whole party went out to hunt, but they +returned in the evening without having seen any game. The +berries, however, were ripe and plentiful, and, with the addition +of some country tea, furnished a supper. There were some showers +in the afternoon,and the weather was cold, the thermometer +being 42 deg, but the evening and night were calm and fine. It may be +remarked that the mosquitoes disappeared when the late gales +commenced. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 25. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at three A. M., we stretched across +the eastern entrance of Bathurst's Inlet, and arrived at an island, +which I have named after Colonel Barry, of Newton Barry. Some +deer being seen on the beach, the hunters went in pursuit of +them, and succeeded in killing three females, which enabled us to +save our last remaining meal of pemmican. They saw also some +fresh tracks of musk oxen on the banks of a small stream, which +flowed into a lake in the centre of the island. These animals must +have crossed a channel, at least, three miles wide, to reach the nearest +of these islands. Some specimens of variegated pebbles and jasper +were found here imbedded in the amygdaloidal rock. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Re-embarking at two P.M., and continuing through what was +supposed to be a channel between two islands, we found our passage +barred by a gravelly isthmus of only ten yards in width ; the canoes +and cargoes were carried across it, and we passed into Bathurst's Inlet +through another similar channel, bounded on both sides by steep +rocky hills. The wind then changing from S.E. to N.W. brought +heavy rain, and we encamped at seven P.M., having advanced +eighteen miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Starting this morning with a fresh breeze in our favour, +we soon reached that part of Barry's Island where the canoes were +detained on the 2d and 3rd of this month, and contrary to what we +then experienced, the deer were now plentiful. The hunters killed +two, and we were relieved from all apprehension of an immediate +want of food. One would suppose the deer were about to retire to +the main shore from their assembling at this time in such numbers +on the islands nearest to the coast. Those we saw were generally +females with their young, and all of them very lean. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The wind continued in the same direction until we had rounded +Point Wollaston, and then changed to a quarter, which enabled us +to steer for Hood's River, which we ascended as high as the first +rapid and encamped. Here terminated our voyage on the Arctic +sea, during which we had gone over six hundred and fifty geographical +miles. Our Canadian voyagers could not restrain their expressions +of joy at having turned their backs on the sea, and +they passed the evening talking over their past adventures with +much humour and no little exaggeration. The consideration that +the most painful, and certainly the most hazardous, part of the +journey was yet to come, did not depress their spirits at all. It is +due to their character to mention that they displayed much courage +in encountering the dangers of the sea, magnified to them by their +novelty. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The shores between Cape Barrow and Cape Flinders, including +the extensive branches of Arctic and Melville Sounds, and Bathurst's +Inlet, may be comprehended in one great gulf, which I have distinguished +by the appellation of George IV.'s Coronation Gulf, in +honour of His Most Gracious Majesty, the latter name being added +to mark the time of its discovery. The Archipelago of islands which +fringe the coast from Copper-Mine River to Point Turnagain, I have +named in honour of His Royal Highness the Duke of York. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +It may be deserving of notice that the extremes in temperature +of the sea water during our voyage were 53 deg and 35 deg, but its general +temperature was between 43 deg and 48 deg. Throughout our return from +Point Turnagain we observed that the sea had risen several feet +above marks left at our former encampments. This may, perhaps, +be attributed to the north-west gales. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">August 26. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Previous to our departure this morning, an assortment +of iron materials, beads, looking-glasses, and other articles +were put up in a conspicuous situation for the Esquimaux, and the +English Union was planted on the loftiest sand-hill, where it might +be seen by any ships passing in the offing. Here also, was deposited +in a tin bow a letter containing an outline of our proceedings, the +latitude and longitude of the principal places, and the course we +intended to pursue towards Slave Lake. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Embarking at eight A.M. we proceeded up the river, which is full +of sandy shoals, but sufficiently deep for canoes in the channels. It is +from one hundred to two hundred yards wide, and is bounded by high +and steep banks of clay. We encamped at a cascade of eighteen or +twenty feet high, which is produced by a ridge of rock crossing the +river, and the nets were set. A mile below this cascade Hood's +River is joined by a stream half its own size, which I have called +James' Branch. Bear and deer tracks had been numerous on the +banks of the river when we were here before, but not a single recent +one was to be seen at this time. Credit, however, killed a small +deer at some distance inland, which, with the addition of berries, +furnished a delightful repast this evening. The weather was remarkably +fine, and the temperature so mild, that the mosquitoes again +made their appearance, but not in any great numbers. Our distance +made to-day was not more than six miles. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning the net furnished us with ten white fish +and trout. Having made a further deposit of iron work for the +Esquimaux we pursued our voyage up the river, but the shoals and +rapids in this part were so frequent, that we walked along the banks +the whole day, and the crews laboured hard in carrying the canoes +thus lightened over the shoals or dragging them up the rapids, yet +our journey in a direct line was only about seven miles. In the +evening we encamped at the lower end of a narrow chasm through +which the river flows for upwards of a mile. The walls of this +chasm are upwards of two hundred feet high, quite perpendicular, +and in some places only a few yards apart. The river precipitates +itself into it over a rock, forming two magnificent and picturesque +falls close to each other. The upper fall is about sixty feet high, and +the lower one at least one hundred, but perhaps considerably more, +for the narrowness of the chasm into which it fell prevented us from +seeing its bottom, and we could merely discern the top of the spray +far beneath our feet. The lower fall is divided into two, by an +insulated column of rock which rises about forty feet above it. The +whole descent of the river at this place probably exceeds two +hundred and fifty feet. The rock is very fine felspathose sandstone. +It has a smooth surface and a light red colour. I have named these +magnificent cascades Wilberforce Falls, as a tribute of my respect +for that distinguished philanthropist and Christian. Messrs. Back and +Hood took beautiful sketches of this majestic scene, which are +combined in the annexed plate. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The river being surveyed from the summit of a hill, above these +falls, appeared so rapid and shallow, that it seemed useless to +attempt proceeding any farther in the large canoes. I therefore +determined on constructing out of their materials two smaller ones +of sufficient size to contain three persons, for the purpose of crossing +any river that might obstruct our progress. This operation was +accordingly commenced, and by the 31st both the canoes being +finished, we prepared for our departure on the following day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The leather which had been preserved for making shoes was +equally divided among the men, two pairs of flannel socks were given +to each person, and such articles of warm clothing as remained, were +issued to those who most required them. They were also furnished +with one of the officers' tents. This being done, I communicated to +the men my intention of proceeding in as direct a course as possible +to the part of Point Lake, opposite to our spring encampment +which was only distant one hundred and forty-nine miles in a +straight line. They received the communication cheerfully, considered +the journey to be short, and left me, in high spirits, to +arrange their own packages. The stores, books, &c., which were not +absolutely necessary to be carried, were then put up in boxes to be +left en cache here, in order that the men's burdens might be as light +as possible. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The next morning was warm, and very fine. Every one was on +the alert at an early hour, being anxious to commence the journey. +Our luggage consisted of ammunition, nets, hatchets, ice chisels, +astronomical instruments, clothing, blankets, three kettles, and +the two canoes, which were each carried by one man. The +officers carried such a portion of their own things as their strength +would permit;the weight carried by each man was about ninety +pounds, and with this we advanced at the rate of about a mile an +hour, including rests. In the evening the hunters killed a lean cow, +out of a large drove of musk-oxen; but the men were too much +laden to carry more than a small portion of its flesh. The alluvial +soil, which towards the mouth of the river spreads into plains, +covered with grass and willows, was now giving place to a more +barren and hilly country; so that we could but just collect sufficient +brush wood to cook our suppers. The part of the river we skirted +to-day was shallow, and flowed over a bed of sand ; its width about +one hundred and twenty yards. About midnight our tent was blown +down by a squall, and we were completely drenched with rain before +it could be re-pitched. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the morning of the 1st of September a fall of snow took +place; the canoes became a cause of delay, by the difficulty of +carrying them in a high wind, and they sustained much damage +from the falls of those who had charge of them. The face of the +country was broken by hills of moderate elevation, but the ground +was plentifully strewed with small stones, which, to men bearing +heavy burthens, and whose feet were protected only by soft moose +skin shoes, occasioned great pain. At the end of eleven miles we +encamped, and sent for a musk-ox and a deer, which St. Germain +and Augustus had killed. The day was extremely cold, the ther-mometer +varying between 34 deg and 36 deg. In the afternoon a heavy +fall of snow took place, on the wind changing from north-west to +south-west. We found no wood at the encampment, but made a +fire of moss to cook the supper, and crept under our blankets for +warmth. At sun-rise the thermometer was at 31 deg, and the wind +fresh from north-west; but the weather became mild in the course +of the forenoon, and the snow disappeared from the gravel. The +afternoon was remarkably fine, and the thermometer rose to 50 deg. +One of the hunters killed a musk-ox. The hills in this part are +lower and more round-backed than those we passed yesterday, and +exhibited but little naked rock; they were covered with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having ascertained from the summit of the highest hill near the +tents, that the river continued to preserve a west course; and fear-ing +that by pursuing it further we might lose much time, and un-necessarily +walk over a great deal of ground, I determined on +quitting its banks the next day, and making as directly as we could for +Point Lake. We accordingly followed the river on the 3d, only to +the place where the musk-ox had been killed last evening, and after +the meat was procured, crossed the river in our two canoes lashed +together. We now emerged from the valley of the river, and entered +a level, but very barren, country, varied only by small lakes and +marshes, the ground being covered with small stones. Many old tracks +of rein-deer were seen in the clayey soil, and some more recent +ones of the musk-ox. We encamped on the borders of Wright's +River, which flows to the eastward; the direct distance walked to-day +being ten miles and three-quarters. The next morning was +very fine, and,as the day advanced, the weather became quite +warm. We set out at six A. M., and, having forded the river, +walked over a perfectly level country, interspersed with small lakes, +which communicated with each other, by streams running in various +directions. No berry-bearing plants were found in this part, the +surface of the earth being thinly covered in the moister places with +a few grasses, and on the drier spots with lichens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Having walked twelve miles and a half, we encamped at seven P.M., +and distributed our last piece of pemmican, and a little arrow-root +for supper, which afforded but a scanty meal. This evening was +warm, but dark clouds overspread the sky. Our men now began to +find their burdens very oppressive, and were much fatigued by this +day's march, but did not complain. One of them was lame from an +inflammation in the knee. Heavy rain commenced at midnight, and +continued without intermission until five in the morning, when it +was succeeded by snow on the wind changing to north-west, which +soon increased to a violent gale. As we had nothing to eat, and +were destitute of the means of making a fire, we remained in our +beds all the day ; but the covering of our blankets was insufficient to +prevent us from feeling the severity of the frost, and suffering in-convenience +from the drifting of the snow into our tents. There +was no abatement of the storm next day ; our tents were completely +frozen, and the snow had drifted around them to a depth of three +feet, and even in the inside there was a covering of several inches on +our blankets. Our suffering from cold, in a comfortless canvass tent +in such weather, with the temperature at 20 deg, and without fire, +will easily be imagined;it was, however, less than that which we +felt from hunger. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The morning of the 7th cleared up a little, but the wind was still +strong, and the weather extremely cold. From the unusual con-tinuance +of the storm, we feared the winter had set in with all its +rigour, and that by longer delay we should only be exposed to an +accumulation of difficulties; we therefore prepared for our journey, +although we were in a very unfit condition for starting, being weak +from fasting, and our garments stiffened by the frost. We had no +means of making a fire to thaw them, the moss, at all times difficult +to kindle, being now covered with ice and snow. A considerable +time was consumed in packing up the frozen tents and bed clothes, +the wind blowing so strong that no one could keep his hands long +out of his mittens. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +Just as we were about to commence our march, I was seized with +a fainting fit, in consequence of exhaustion and sudden exposure to +the wind; but after eating a morsel of portable soup, I recovered, so +far as to be able to move on. I was unwilling at first to take this +morsel of soup, which was diminishing the small and only remaining +meal for the party; but several of the men urged me to it, with +much kindness. The ground was covered a foot deep with snow, +the margin of the lakes was incrusted with ice, and the swamps over +which we had to pass were entirely frozen; but the ice not being +sufficiently strong to bear us, we frequently plunged knee-deep in +water. Those who carried the canoes were repeatedly blown down +by the violence of the wind, and they often fell, from making an +insecure step on a slippery stone; on one of these occasions, the +largest canoe was so much broken as to be rendered utterly unser-viceable. +This was felt as a serious disaster, as the remaining canoe +having through mistake been made too small, it was doubtful +whether it would be sufficient to carry us across a river. Indeed +we had found it necessary in crossing Hood's River, to lash the two +canoes together. As there was some suspicion that Benoit, who +carried the canoe, had broken it intentionally, he having on a former +occasion been overheard by some of the men to say, that he would +do so when he got it in charge, we closely examined him on the +point; he roundly denied having used the expressions attributed to +him, and insisted that it was broken by his falling accidentally; and +as he brought men to attest the latter fact, who saw him tumble, we +did not press the matter further. I may here remark that our +people had murmured a good deal at having to carry two canoes, +though they were informed of the necessity of taking both, in case +it should be deemed advisable to divide the party; which it had +been thought probable we should be obliged to do, if animals proved +scarce, in order to give the whole the better chance of procuring +subsistence, and also for the purpose of sending forward some of the +best walkers to search for Indians, and to get them to meet us with +supplies of provision. The power of doing this was now at an end. +As the accident could not be remedied we turned it to the best +account by making a fire of the bark and timbers of the broken +vessel, and cooked the remainder of our portable soup and arrow-root. +This was a scanty meal after three days' fasting, but it served +to allay the pangs of hunger, and enabled us to proceed at a quicker +pace than before. The depth of the snow caused us to march in +Indian file, that is in each other's steps; the voyagers taking it in +turn to lead the party. A distant object was pointed out to this +man in the direction we wished to take, and Mr. Hood followed +immediately behind him, to renew the bearings, and keep him from +deviating more than could be helped from the mark. It may be +here observed, that we proceeded in this manner throughout our +route across the barren grounds. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +In the afternoon we got into a more hilly country, where the +ground was strewed with large stones. The surface of these was +covered with lichens of the genus gyrophora, which the Canadians +term tripe de roche. A considerable quantity was gathered, and +with half a partridge each, (which were shot in the course of the +day,) furnished us with a slender supper, which we cooked with a +few willows, dug up from beneath the snow. We passed a comfortless +night in our damp clothes, but took the precaution of sleeping upon +our socks and shoes to prevent them from freezing. This plan was +afterwards adopted throughout the journey. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +At half past five in the morning we proceeded; and after walking +about two miles, came to Cracroft's River, flowing to the westward, +with a very rapid current over a rocky channel. We had much diffi-culty +in crossing this, the canoe being useless, not only from the bot-tom +of the channel being obstructed by large stones, but also from its +requiring gumming, an operation which, owing to the want of wood +and the frost, we were unable to perform. However, after following +the course of the river some way, we effected a passage by means of a +range of large rocks that crossed a rapid. As the current was strong, +and many of the rocks were covered with water to the depth of two +or three feet, the men were exposed to much danger in carrying their +heavy burthens across, and several of them actually slipped into the +stream, but were immediately rescued by the others. Junius went +farther up the river in search of a better crossing place, and did not +rejoin us to-day. As several of the party were drenched from head to +foot, and we were all wet to the middle, our clothes became stiff with +the frost, and we walked with much pain for the remainder of the day. +The march was continued to a late hour, being anxious to rejoin the +hunters who had gone before, but we were obliged to encamp at the +end of ten miles and a quarter, without seeing them. Our only +meal to-day consisted of a partridge each, (which the hunters shot,) +mixed with tripe de roche. This repast although scanty for men, +with appetites such as our daily fatigue created, proved a cheerful +one, and was received with thankfulness. Most of the men had to +sleep in the open air, in consequence of the absence of Credit, who +carried their tent; but we fortunately found an unusual quantity of +roots to make a fire, which prevented their suffering much from the +cold, though the thermometer was at 17 deg. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We started at six on the 9th, and at the end of two miles re-gained +our hunters, who were halting on the borders of a lake amidst +a clump of stunted willows. This lake stretched to the westward as +far as we could see, and its waters were discharged by a rapid stream +one hundred and fifty yards wide. Being entirely ignorant where +we might be led by pursuing the course of the lake, and dreading +the idea of going a mile unnecessarily out of the way, we deter-mined +on crossing the river if possible; and the canoe was gummed +for the purpose, the willows furnishing us with fire. But we had to +await the return of Junius before we could make the traverse. In +the mean time we gathered a little tripe de roche, and breakfasted +upon it and a few partridges that were killed in the morning. +St. Germain and Adam were sent upon some recent tracks of deer. +Junius arrived in the afternoon, and informed us that he had seen +a large herd of musk-oxen on the banks of Cracroft's River, and had +wounded one of them, but it had escaped. He brought about four +pounds of meat, the remains of a deer that had been devoured by +the wolves. The poor fellow was much fatigued, having walked +throughout the night, but as the weather was particularly favourable +for our crossing the river, we could not allow him to rest. After he +had taken some refreshment we proceeded to the river. The canoe +being put into the water was found extremely ticklish, but it was +managed with much dexterity by St. Germain, Adam, and Peltier, +who ferried over one passenger at a time, causing him to lie flat in its +bottom, by no means a pleasant position, owing to its leakiness, but +there was no alternative. The transport of the whole party was +effected by five o'clock, and we walked about two miles further, and +encamped, having come five miles and three quarters on a south-west +course. Two young alpine hares were shot by St. Germain, which, +with the small piece of meat brought in by Junius, furnished the +supper of the whole party. There was no tripe de roche here. The +country had now become decidedly hilly, and was covered with snow. +The lake preserved its western direction, as far as I could see from +the summit of the highest mountain near the encampment. We +subsequently learned from the Copper Indians, that the part at +which we had crossed the river was the Congecatha-wha-chaga of +Hearne, of which I had little idea at the time, not only from the +difference of latitude, but also from its being so much farther east of +the mouth of the Copper-Mine River, than his track is laid down. +He only making one degree and three quarters difference of lon-gitude, +and we, upwards of four. Had I been aware of the fact, +several days harassing march, and a disastrous accident would have +been prevented by keeping on the western side of the lake, instead +of crossing the river. We were informed also, that this river is +the Anatessy or River of Strangers, and is supposed to fall into +Bathurst's Inlet; but although the Indians have visited its mouth, +their description was not sufficient to identify it with any of the +rivers whose mouths we had seen. It probably falls in that part of +the coast which was hid from our view by Goulburn's or Elliot's +Islands. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 10. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We had a cold north wind, and the atmosphere +was foggy. The thermometer 18 deg at five A.M. In the course of +our march this morning, we passed many small lakes; and the +ground becoming higher and more hilly as we receded from the +river, was covered to a much greater depth with snow. This ren-dered +walking not only extremely laborious, but also hazardous in +the highest degree;for the sides of the hills, as is usual throughout +the barren grounds, abounding in accumulations of large angular +stones, it often happened that the men fell into the interstices +with their loads on their backs, being deceived by the smooth +appearance of the drifted snow. If any one had broken a limb +here, his fate would have been melancholy indeed; we could neither +have remained with him, nor carried him on. We halted at ten to +gather tripe de roche,but it was so frozen, that we were quite +benumbed with cold before a sufficiency could be collected even for +a scanty meal. On proceeding our men were somewhat cheered, by +observing on the sandy summit of a hill, from whence the snow had +been blown, the summer track of a man; and afterwards by seeing +several deer tracks on the snow. About noon the weather cleared +up a little, and, to our great joy, we saw a herd of musk-oxen +grazing in a valley below us. The party instantly halted, and the +best hunters were sent out; they approached the animals with the +utmost caution, no less than two hours being consumed before they +got within gun-shot. In the mean time we beheld their proceed-ings +with extreme anxiety, and many secret prayers were, doubtless, +offered up for their success. At length they opened their fire, and +we had the satisfaction of seeing one of the largest cows fall; another +was wounded, but escaped. This success infused spirit into our +starving party. To skin and cut up the animal was the work of a +few minutes. The contents of its stomach were devoured upon +the spot, and the raw intestines, which were next attacked, were +pronounced by the most delicate amongst us to be excellent. A few +willows, whose tops were seen peeping through the snow in the bottom +of the valley, were quickly grubbed, the tents pitched, and supper +cooked, and devoured with avidity. This was the sixth day since we +had had a good meal. The tripe de roche, even where we got +enough, only serving to allay the pangs of hunger for a short time. +After supper, two of the hunters went in pursuit of the herd, but +could not get near them. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We were detained all the next day by a strong southerly wind, +and were much incommoded in the tents by the drift snow. The +temperature was 20 deg. The average for the last ten days about +24.5 deg. We restricted ourselves to one meal to-day as we were at +rest, and there was only meat remaining sufficient for the next day. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +The gale had not diminished on the 12th, and, as we were +fearful of its continuance for some time, we determined on going +forward; our only doubt regarded the preservation of the canoe, +but the men promised to pay particular attention to it, and the +most careful persons were appointed to take it in charge. The snow +was two feet deep, and the ground much broken, which rendered +the march extremely painful. The whole party complained more of +faintness and weakness than they had ever done before; their +strength seemed to have been impaired by the recent supply of +animal food. In the afternoon the wind abated, and the snow ceased; +cheered with the change we proceeded forward at a quicker pace, +and encamped at six P. M., having come eleven miles. Our supper +consumed the last of our meat. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +We set out on the 13th, in thick hazy weather, and, after an hour's +march, had the extreme mortification to find ourselves on the +borders of a large lake, which we subsequently learned from the +Indians was named Contwoy-to, or Rum Lake; neither of its extre- +mities could be seen, and as the portion which lay to the east +seemed the widest, we coasted along to the westward portion in +search of a crossing-place. This lake being bounded by steep and +lofty hills, our march was very fatiguing. Those sides which were +exposed to the sun, were free from snow, and we found upon them +some excellent berries. We encamped at six P. M., having come +only six miles and a half. Credit was then missing, and he did not +return during the night. We supped off a single partridge and +some tripe de roche;this unpalatable weed was now quite nau-seous +to the whole party, and in several it produced bowel com-plaints. +Mr. Hood was the greatest sufferer from this cause. This +evening we were extremely distressed, at discovering that our im-provident +companions,since we left Hood's River, had thrown +away three of the fishing-nets, and burnt the floats ; they knew we +had brought them to procure subsistence for the party, when the +animals should fail, and we could scarcely believe the fact of their +having wilfully deprived themselves of this resource, especially +when we considered that most of them had passed the greater part of +their servitude in situations where the nets alone had supplied them +with food. Being thus deprived of our principal resource, that of +fishing, and the men evidently getting weaker every day, it became +necessary to lighten their burthens of every thing except ammunition, +clothing, and the instruments that were required to find our +way. I, therefore, issued directions to deposit at this encampment +the dipping needle, azimuth compass, magnet, a large thermometer, +and a few books we had carried, having torn out of these such parts +as we should require to work the observations for latitude and +longitude. I also promised,as an excitement to the efforts in +hunting, my gun to St. Germain, and an ample compensation to +Adam, or any of the other men who should kill any animals. +Mr. Hood, on this occasion, lent his gun to Michel, the Iroquois, +who was very eager in the chase, and often successful. + </fo:block> + + <fo:block font-size="8pt" + font-family="serif" + font-style="italic" + line-height="10pt" + space-before.optimum="3pt" + space-after.optimum="3pt" + text-align="start">September 14. + </fo:block> + + <!-- Normal text --> + <fo:block font-size="11pt" + font-family="serif" + line-height="12pt" + space-after.optimum="0pt" + text-align="start"> +This morning the officers being assembled round +a small fire, Perrault presented each of us with a small piece of meat +which he had saved from his allowance. It was received with great +thankfulness, and such an act of self-denial and kindness, being +totally unexpected in a Canadian voyager, filled our eyes with tears. +In directing our course to a river issuing from the lake, we met +Credit, who communicated the joyful intelligence of his having +killed two deer in the morning. We instantly halted, and having +shared the deer that was nearest to us, prepared breakfast. After +which, the other deer was sent for, and we went down to the river, +which was about three hundred yards wide, and flowed with +great velocity through a broken rocky channel. Having searched +for a part where the current was most smooth, the canoe was +placed in the water at the head of a rapid, and St. Germain, Solomon +Belanger, and I, embarked in order to cross. We went from the +shore very well, but in mid-channel the canoe became difficult to +manage under our burden as the breeze was fresh. The current +drove us to the edge of the rapid, when Belanger unfortunately +applied his paddle to avert the apparent danger of being forced +down it, and lost his balance. The canoe was overset in con-sequence +in the middle of the rapid. We fortunately kept hold of +it, until we touched a rock where the water did not reach higher +than our waists; here we kept our footing, notwithstanding the +strength of the current, until the water was emptied out of the +canoe. Belanger then held the canoe steady whilst St. Germain +placed me in it, and afterwards embarked himself in a very dexterous +manner. It was impossible, however, to embark Belanger, +as the canoe would have been hurried down the rapid, the moment +he should have raised his foot from the rock on which he stood. +We were, therefore, compelled to leave him in his perilous situation. +We had not gone twenty yards before the canoe, striking on a +sunken rock, went down. The place being shallow, we were again +enabled to empty it, and the third attempt brought us to the shore. +In the mean time Belanger was suffering extremely, immersed to +his middle in the centre of a rapid, the temperature of which was +very little above the freezing point, and the upper part of his body +covered with wet clothes, exposed in a temperature not much above +zero, to a strong breeze. He called piteously for relief, and +St. Germain on his return endeavoured to embark him, but in vain. +The canoe was hurried down the rapid, and when he landed he was +rendered by the cold incapable of further exertion, and Adam at-tempted +to embark Belanger, but found it impossible. An attempt +was next made to carry out to him a line, made of the slings of the +men's loads. This also failed, the current acting so strongly upon +it, as to prevent the canoe from steering, and it was finally broken +and carried down the stream. At length, when Belanger's strength +seemed almost exhausted, the canoe reached him with a small cord +belonging to one of the nets, and he was dragged perfectly senseless +through the rapid. By the direction of Dr. Richardson, he was +instantly stripped, and being rolled up in blankets, two men un-dressed +themselves and went to bed with him; but it was some +hours before he recovered his warmth and sensations. As soon as +Belanger was placed in his bed, the officers immediately sent over +my blankets, and a person to make a fire. Augustus brought the +canoe over, and in returning he was obliged to descend both the +rapids, before he could get across the stream; which hazardous +service he performed with the greatest coolness and judgment. It +is impossible to describe my sensations as I witnessed the various +unsuccessful attempts to relieve Belanger. The distance prevented +my seeing distinctly what was going on, and I continued pacing up +and down upon the rock on which I landed, regardless of the +coldness of my drenched and stiffening garments. The canoe, in +every attempt to reach him, was hurried down the rapid, and was +lost to the view amongst the rocky islets, with a rapidity that +seemed to threaten certain destruction; once, indeed, I fancied that +I saw it overwhelmed in the waves. Such an event would have +been fatal to the whole party. Separated as I was from my com-panions, +without gun, ammunition, hatchet, or the means of making +a fire, and in wet clothes, my doom would have been speedily sealed. +My companions too, driven to the necessity of coasting the lake, +must have sunk under the fatigue of rounding its innumerable arms +and bays, which, as we have learned from the Indians, are very +extensive. By the goodness of Providence, however, we were spared +at that time, and some of us have been permitted to offer up our +thanksgivings, in a civilized land, for the signal deliverances we then +and afterwards experienced. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/region_body/simplecol.fo b/examples/fo/region_body/simplecol.fo new file mode 100644 index 000000000..b8e508a33 --- /dev/null +++ b/examples/fo/region_body/simplecol.fo @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="only" + page-height="11in" + page-width="8.5in" + margin-top="1in" + margin-bottom="1in" + margin-left="0.75in" + margin-right="0.75in"> + <fo:region-body + margin-top="1in" margin-bottom="1in" + column-count="2" column-gap="0.25in"/> + <fo:region-before extent="1in"/> + <fo:region-after extent="1in"/> + </fo:simple-page-master> + + </fo:layout-master-set> + + <!-- actual layout --> + <fo:page-sequence master-reference="only"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="normal" + text-align="start" + color="blue">Columns in FOP</fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" + font-family="sans-serif" + line-height="12pt" + space-before.optimum="6pt" + text-align="end" + color="blue">Page #</fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <!-- Block 0 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 0:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 1 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 1:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 2 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 2:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 3 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 3:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 4 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="all"> + <fo:inline color="red">Block 4:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 5 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 5:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 6 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 6:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/region_body/simplecol2.fo b/examples/fo/region_body/simplecol2.fo new file mode 100644 index 000000000..2e0bf0f74 --- /dev/null +++ b/examples/fo/region_body/simplecol2.fo @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" > + + <!-- defines page layout --> + <fo:layout-master-set > + + <!-- layout for the first page --> + <fo:simple-page-master master-name="only" + page-height="11in" + page-width="8.5in" + margin-top="1in" + margin-bottom="1in" + margin-left="0.75in" + margin-right="0.75in"> + <fo:region-body + margin-top="1in" margin-bottom="1in" + column-count="2" column-gap="0.25in"/> + <fo:region-before extent="1in" /> + <fo:region-after extent="1in" /> + </fo:simple-page-master> + + </fo:layout-master-set> + + <!-- actual layout --> + <fo:page-sequence master-reference="only" > + <fo:static-content flow-name="xsl-region-before" > + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="normal" + text-align="start" + color="blue">Columns in FOP</fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after" > + <fo:block font-size="10pt" + font-family="sans-serif" + line-height="12pt" + space-before.optimum="6pt" + text-align="end" + color="blue">Page #</fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body" > + <!-- Block 0 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green" >Block 0:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. XML has associated with it a great number of other standards, most of them under W3C (World-Wide + Web Consortium) auspices. Among these are XML Namespaces, XML Pointer, XPath, XSLT, XHTML, SVG, RELAX, SOAP, and any + number of others. This file has been prepared using formatting objects, an XML vocabulary described in the XSL + specification of October 18, 2000. Formatting objects are used to specify pagination and composition, and are + intended for high-quality, precision layout-driven formatting. + </fo:block> + + <!-- Block 1 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green" >Block 1:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. XML has associated with it a great number of other standards, most of them under W3C (World-Wide + Web Consortium) auspices. Among these are XML Namespaces, XML Pointer, XPath, XSLT, XHTML, SVG, RELAX, SOAP, and any + number of others. This file has been prepared using formatting objects, an XML vocabulary described in the XSL + specification of October 18, 2000. Formatting objects are used to specify pagination and composition, and are + intended for high-quality, precision layout-driven formatting. + </fo:block> + + <!-- Block 2 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green" >Block 2:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 3 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green" >Block 3:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 4 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="all"> + <fo:inline color="red" >Block 4:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 5 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green" >Block 5:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 6 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green" >Block 6:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. XML has associated with it a great number of other standards, most of them under W3C (World-Wide + Web Consortium) auspices. Among these are XML Namespaces, XML Pointer, XPath, XSLT, XHTML, SVG, RELAX, SOAP, and any + number of others. This file has been prepared using formatting objects, an XML vocabulary described in the XSL + specification of October 18, 2000. Formatting objects are used to specify pagination and composition, and are + intended for high-quality, precision layout-driven formatting. + </fo:block> + + <!-- Block 7 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="all"> + <fo:inline color="red" >Block 7:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. XML has associated with it a great number of other standards, most of them under W3C (World-Wide + Web Consortium) auspices. Among these are XML Namespaces, XML Pointer, XPath, XSLT, XHTML, SVG, RELAX, SOAP, and any + number of others. This file has been prepared using formatting objects, an XML vocabulary described in the XSL + specification of October 18, 2000. Formatting objects are used to specify pagination and composition, and are + intended for high-quality, precision layout-driven formatting. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/region_body/simplecol3.fo b/examples/fo/region_body/simplecol3.fo new file mode 100644 index 000000000..995174db7 --- /dev/null +++ b/examples/fo/region_body/simplecol3.fo @@ -0,0 +1,197 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="only" + page-height="11in" + page-width="8.5in" + margin-top="1in" + margin-bottom="1in" + margin-left="0.75in" + margin-right="0.75in"> + <fo:region-body + margin-top="1in" margin-bottom="1in" + column-count="2" column-gap="0.25in"/> + <fo:region-before extent="1in"/> + <fo:region-after extent="1in"/> + </fo:simple-page-master> + + </fo:layout-master-set> + + <!-- actual layout --> + <fo:page-sequence master-reference="only"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="normal" + text-align="start" + color="blue">Columns in FOP</fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" + font-family="sans-serif" + line-height="12pt" + space-before.optimum="6pt" + text-align="end" + color="blue">Page #</fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <!-- Block 0 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 0:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 1 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 1:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 2 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 2:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 3 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 3:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 4 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="all"> + <fo:inline color="red">Block 4:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 5 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 5:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 6 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 6:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 7 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 7:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 8 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 8:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 9 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="all"> + <fo:inline color="red">Block 9:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/region_body/simplecol4.fo b/examples/fo/region_body/simplecol4.fo new file mode 100644 index 000000000..6e73fa4b1 --- /dev/null +++ b/examples/fo/region_body/simplecol4.fo @@ -0,0 +1,197 @@ +<?xml version="1.0" encoding="utf-8"?> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <!-- defines page layout --> + <fo:layout-master-set> + + <!-- layout for the first page --> + <fo:simple-page-master master-name="only" + page-height="11in" + page-width="8.5in" + margin-top="1in" + margin-bottom="1in" + margin-left="0.75in" + margin-right="0.75in"> + <fo:region-body + margin-top="1in" margin-bottom="1in" + column-count="3" column-gap="0.15in"/> + <fo:region-before extent="1in"/> + <fo:region-after extent="1in"/> + </fo:simple-page-master> + + </fo:layout-master-set> + + <!-- actual layout --> + <fo:page-sequence master-reference="only"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block font-size="16pt" + font-family="sans-serif" + line-height="normal" + text-align="start" + color="blue">Columns in FOP</fo:block> + </fo:static-content> + + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="10pt" + font-family="sans-serif" + line-height="12pt" + space-before.optimum="6pt" + text-align="end" + color="blue">Page #</fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + <!-- Block 0 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 0:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 1 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 1:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 2 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 2:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 3 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 3:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 4 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="all"> + <fo:inline color="red">Block 4:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 5 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 5:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 6 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 6:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 7 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 7:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 8 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="none"> + <fo:inline color="green">Block 8:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + <!-- Block 9 --> + <fo:block font-size="12pt" + font-family="sans-serif" + line-height="15pt" + space-after.optimum="3pt" + text-align="start" + background-color="yellow" + span="all"> + <fo:inline color="red">Block 9:</fo:inline> + The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to + enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML + has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information + read normal.pdf. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/runtests.bat b/examples/fo/runtests.bat new file mode 100755 index 000000000..77e3fdc6a --- /dev/null +++ b/examples/fo/runtests.bat @@ -0,0 +1,33 @@ +@echo off + +echo Fop Test +echo ---------------- + +if "%JAVA_HOME%" == "" goto error + + +set LIBDIR=..\..\lib +set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\classes.zip +set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\ant.jar +set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis.jar +set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.2.1.jar +set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.4.1.jar +set ANT_HOME=%LIBDIR% + +echo Starting Tests ... +echo %LOCALCLASSPATH% + +%JAVA_HOME%\bin\java.exe -Dant.home=%ANT_HOME% -classpath "%LOCALCLASSPATH%;%CLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5 + +goto end + +:error + +echo ERROR: JAVA_HOME not found in your environment. +echo Please, set the JAVA_HOME variable in your environment to match the +echo location of the Java Virtual Machine you want to use. + +:end + +rem set LOCALCLASSPATH= + diff --git a/examples/fo/runtests.sh b/examples/fo/runtests.sh new file mode 100644 index 000000000..c3eb8623a --- /dev/null +++ b/examples/fo/runtests.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +echo +echo "Fop Test" +echo "----------------" +echo + +if [ "$JAVA_HOME" = "" ] ; then + echo "ERROR: JAVA_HOME not found in your environment." + echo + echo "Please, set the JAVA_HOME variable in your environment to match the" + echo "location of the Java Virtual Machine you want to use." + exit 1 +fi +LIBDIR=../../lib +LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/classes.zip +LOCALCLASSPATH=$LOCALCLASSPATH:$LIBDIR/ant.jar +LOCALCLASSPATH=$LOCALCLASSPATH:$LIBDIR/xml-apis.jar +LOCALCLASSPATH=$LOCALCLASSPATH:$LIBDIR/xercesImpl-2.2.1.jar +LOCALCLASSPATH=$LOCALCLASSPATH:$LIBDIR/xalan-2.4.1.jar + +ANT_HOME=$LIBDIR + +echo Building with classpath $CLASSPATH:$LOCALCLASSPATH +echo + +echo Starting Tests... +echo + +$JAVA_HOME/bin/java -Dant.home=$ANT_HOME -classpath "$LOCALCLASSPATH:$CLASSPATH" org.apache.tools.ant.Main $* diff --git a/examples/fo/tables/background.fo b/examples/fo/tables/background.fo new file mode 100644 index 000000000..b5b9ef183 --- /dev/null +++ b/examples/fo/tables/background.fo @@ -0,0 +1,789 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="29.7cm" + master-name="first"> + <fo:region-before extent="1cm"/> + <fo:region-body margin-top="1cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">table examples</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">Page <fo:page-number/></fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Table 1: cell background + </fo:block> + + <fo:table> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell background-color="green"> + <fo:block text-align="center"> + green cell + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="red"> + <fo:block text-align="center"> + red cell + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="blue"> + <fo:block text-align="center"> + blue cell + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="yellow"> + <fo:block text-align="center"> + yellow cell + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: row background + </fo:block> + + <fo:table> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row background-color="green"> + <fo:table-cell> + <fo:block text-align="center"> + row with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + green + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row background-color="red"> + <fo:table-cell> + <fo:block text-align="center"> + row with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + red + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row background-color="blue"> + <fo:table-cell> + <fo:block text-align="center"> + row with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + blue + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: column background + </fo:block> + + <fo:table> + <fo:table-column column-width="3cm" background-color="green"/> + <fo:table-column column-width="3cm" background-color="red"/> + <fo:table-column column-width="3cm" background-color="blue"/> + <fo:table-column column-width="3cm" background-color="yellow"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table columns + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + different + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + backgrounds + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + extra + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + table row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="260pt" space-after.optimum="15pt"> + Table 1: column backgrounds over page + </fo:block> + + <fo:table> + <fo:table-column column-width="3cm" background-color="green"/> + <fo:table-column column-width="3cm" background-color="red"/> + <fo:table-column column-width="3cm" background-color="blue"/> + <fo:table-column column-width="3cm" background-color="orange"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table columns + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + different + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + backgrounds + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + extra + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + table row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: body background + </fo:block> + + <fo:table> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body background-color="green" border-left-width="0.5pt"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + green + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body background-color="red"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + red + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body background-color="blue"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + blue + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body background-color="yellow"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + yellow + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: table background + </fo:block> + + <fo:table background-color="green"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + green + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table background-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + red + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + background + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: combinations + </fo:block> + + <fo:table background-color="green"> + <fo:table-column column-width="2.5cm"/> + <fo:table-column column-width="2.5cm" background-color="green"/> + <fo:table-column column-width="2.5cm" background-color="red"/> + <fo:table-column column-width="2.5cm" background-color="blue"/> + <fo:table-column column-width="2.5cm" background-color="yellow"/> + <fo:table-column column-width="2.5cm"/> + + <fo:table-body background-color="aqua"> + <fo:table-row background-color="green"> + <fo:table-cell background-color="green"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="red"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="blue"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="yellow"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row background-color="red"> + <fo:table-cell> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="red"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="blue"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="yellow"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="orange"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row background-color="blue"> + <fo:table-cell background-color="green"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="blue"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="yellow"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="orange"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row background-color="yellow"> + <fo:table-cell background-color="green"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="red"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="yellow"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="orange"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row background-color="orange"> + <fo:table-cell background-color="green"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="red"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="blue"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="yellow"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="orange"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell background-color="green"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="red"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="blue"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="yellow"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell background-color="orange"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body space-before.optimum="10pt" space-after.optimum="10pt"> + <fo:table-row background-color="blue"> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + blue + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/tables/borders.fo b/examples/fo/tables/borders.fo new file mode 100644 index 000000000..d1c119c33 --- /dev/null +++ b/examples/fo/tables/borders.fo @@ -0,0 +1,1023 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="29.7cm" + master-name="first"> + <fo:region-before extent="1cm"/> + <fo:region-body margin-top="1cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">table examples</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">Page <fo:page-number/></fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Table 1: cell borders + </fo:block> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:block text-align="center"> + green left + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:block text-align="center"> + red top + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:block text-align="center"> + blue right + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:block text-align="center"> + yellow bottom + </fo:block> + </fo:table-cell> + <fo:table-cell + border-left-color="green" border-left-width="0.5pt" border-left-style="solid" + border-top-color="red" border-top-width="0.5pt" border-top-style="solid" + border-right-color="blue" border-right-width="0.5pt" border-right-style="solid" + border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:block text-align="center"> + all + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-color="green" border-left-width="2pt" border-style="solid"> + <fo:block text-align="center"> + 2pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="2pt" border-top-style="dashed"> + <fo:block text-align="center"> + 2pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="2pt" border-right-style="dotted"> + <fo:block text-align="center"> + 2pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="2pt" border-bottom-style="double"> + <fo:block text-align="center"> + 2pt + </fo:block> + </fo:table-cell> + <fo:table-cell + border-left-color="green" border-left-width="2pt" border-left-style="solid" + border-top-color="red" border-top-width="2pt" border-top-style="dashed" + border-right-color="blue" border-right-width="2pt" border-right-style="double" + border-bottom-color="yellow" border-bottom-width="2pt" border-bottom-style="dotted"> + <fo:block text-align="center"> + 2pt + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-left-color="green" border-left-width="10pt" border-left-style="solid"> + <fo:block text-align="center"> + 10pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="10pt" border-top-style="solid"> + <fo:block text-align="center"> + 10pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="10pt" border-right-style="solid"> + <fo:block text-align="center"> + 10pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="10pt" border-bottom-style="solid"> + <fo:block text-align="center"> + 10pt + </fo:block> + </fo:table-cell> + <fo:table-cell + border-left-color="green" border-left-width="2pt" border-left-style="solid" + border-top-color="red" border-top-width="4pt" border-top-style="solid" + border-right-color="blue" border-right-width="8pt" border-right-style="solid" + border-bottom-color="yellow" border-bottom-width="10pt" border-bottom-style="solid"> + <fo:block text-align="center"> + 2pt - 10pt + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-color="green" border-width="0.5pt" border-style="solid"> + <fo:block text-align="center"> + 0.5pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="red" border-width="1pt" border-style="solid"> + <fo:block text-align="center"> + 1pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="blue" border-width="2pt" border-style="solid"> + <fo:block text-align="center"> + 2pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="yellow" border-width="10pt" border-style="solid"> + <fo:block text-align="center"> + 10pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="yellow" border-width="20pt" border-style="solid"> + <fo:block text-align="center"> + 20pt + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: row borders + </fo:block> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:table-cell> + <fo:block text-align="center"> + row with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + green left + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:table-cell> + <fo:block text-align="center"> + row with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + red top + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:table-cell> + <fo:block text-align="center"> + row with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + blue right + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:table-cell> + <fo:block text-align="center"> + row with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + yellow bottom + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-color="purple" border-width="0.5pt" border-style="solid"> + <fo:table-cell> + <fo:block text-align="center"> + row with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + all + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: column borders + </fo:block> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm" border-left-color="green" border-left-width="0.5pt" border-left-style="solid"/> + <fo:table-column column-width="3cm" border-top-color="red" border-top-width="0.5pt" border-top-style="solid"/> + <fo:table-column column-width="3cm" border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"/> + <fo:table-column column-width="3cm" border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"/> + <fo:table-column column-width="3cm" border-color="orange" border-width="0.5pt" border-style="solid"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table columns + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + different + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + borders + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + extra + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + table row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: column borders over page + </fo:block> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm" border-left-color="green" border-left-width="0.5pt" border-left-style="solid"/> + <fo:table-column column-width="3cm" border-top-color="red" border-top-width="0.5pt" border-top-style="solid"/> + <fo:table-column column-width="3cm" border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"/> + <fo:table-column column-width="3cm" border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"/> + <fo:table-column column-width="3cm" border-color="orange" border-width="0.5pt" border-style="solid"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table columns + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + different + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + borders + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + extra + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + table row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: body borders + </fo:block> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + left border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + top border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + right border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + bottom border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body border-color="orange" border-width="0.5pt" border-style="solid"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + body with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + all border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: table borders + </fo:block> + + <fo:table border-left-color="green" border-left-width="0.5pt" border-left-style="solid" + border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + left border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-top-color="red" border-top-width="0.5pt" border-top-style="solid" border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + top border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-right-color="blue" border-right-width="0.5pt" border-right-style="solid" border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + right border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid" border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + bottom border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:table border-color="orange" border-width="0.5pt" border-style="solid" border-collapse="separate"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + all border + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15pt" space-after.optimum="15pt"> + Table 1: combinations + </fo:block> + + <fo:table border-left-color="green" border-left-width="0.5pt" border-left-style="solid" border-collapse="separate"> + <fo:table-column column-width="2.5cm"/> + <fo:table-column column-width="2.5cm" border-left-color="green" border-left-width="0.5pt" border-left-style="solid"/> + <fo:table-column column-width="2.5cm" border-top-color="red" border-top-width="0.5pt" border-top-style="solid"/> + <fo:table-column column-width="2.5cm" border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"/> + <fo:table-column column-width="2.5cm" border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"/> + <fo:table-column column-width="2.5cm" border-color="orange" border-width="0.5pt" border-style="solid"/> + + <fo:table-body border-color="aqua" border-width="0.5pt" border-style="solid"> + <fo:table-row border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:table-cell border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="orange" border-width="0.5pt" border-style="solid"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:table-cell border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="orange" border-width="0.5pt" border-style="solid"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:table-cell border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="orange" border-width="0.5pt" border-style="solid"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:table-cell border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="orange" border-width="0.5pt" border-style="solid"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-color="orange" border-width="0.5pt" border-style="solid"> + <fo:table-cell border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="orange" border-width="0.5pt" border-style="solid"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-left-color="green" border-left-width="0.5pt" border-left-style="solid"> + <fo:block text-align="center"> + a + </fo:block> + </fo:table-cell> + <fo:table-cell border-top-color="red" border-top-width="0.5pt" border-top-style="solid"> + <fo:block text-align="center"> + b + </fo:block> + </fo:table-cell> + <fo:table-cell border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"> + <fo:block text-align="center"> + c + </fo:block> + </fo:table-cell> + <fo:table-cell border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid"> + <fo:block text-align="center"> + d + </fo:block> + </fo:table-cell> + <fo:table-cell border-color="orange" border-width="0.5pt" border-style="solid"> + <fo:block text-align="center"> + e + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + text for an extra line in the table row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/tables/break.fo b/examples/fo/tables/break.fo new file mode 100644 index 000000000..13f3160fd --- /dev/null +++ b/examples/fo/tables/break.fo @@ -0,0 +1,322 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="17cm" + master-name="first"> + <fo:region-before extent="1cm"/> + <fo:region-body margin-top="1cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">table examples</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">Page <fo:page-number/></fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Tests for breaks on table rows. + </fo:block> + + <fo:block space-before.optimum="80pt" space-after.optimum="15pt"> + Table 1: basic break after with next + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt" break-after="page"> + <fo:table-cell> + <fo:block text-align="center"> + first row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + new page + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + for next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + second row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="80pt" space-after.optimum="15pt"> + Table 2: basic break before with next + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + first row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + new page + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + for next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" break-before="page"> + <fo:table-cell> + <fo:block text-align="center"> + second row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + break before + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="80pt" space-after.optimum="15pt"> + Table 3: basic break before a keep with next + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + first row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + new page + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + for next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" break-before="page"> + <fo:table-cell> + <fo:block text-align="center"> + second row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + break before + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="80pt" space-after.optimum="15pt"> + Table 4: basic break after a keep with previous + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt" break-after="page"> + <fo:table-cell> + <fo:block text-align="center"> + first row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + new page + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + for next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-previous="always"> + <fo:table-cell> + <fo:block text-align="center"> + second row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + break before + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="80pt" space-after.optimum="15pt"> + Table 5: basic break after a keep with previous + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + with text + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + with text + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + with text + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always" break-after="page"> + <fo:table-cell> + <fo:block text-align="center"> + break after + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + and + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + keep + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/tables/headfoot.fo b/examples/fo/tables/headfoot.fo new file mode 100644 index 000000000..641d33193 --- /dev/null +++ b/examples/fo/tables/headfoot.fo @@ -0,0 +1,1432 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="29.7cm" + master-name="first"> + <fo:region-before extent="7cm"/> + <fo:region-body margin-top="7cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">table examples</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">Page <fo:page-number/></fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block space-before.optimum="15cm"> + Table 1: with header + </fo:block> + + <fo:table> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-header> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-header> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15cm"> + Table 2: with footer + </fo:block> + + <fo:table> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-footer> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-footer> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15cm"> + Table 3: with header and footer and keeps + </fo:block> + + <fo:table> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-header> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-header> + + <fo:table-footer> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-footer> + + <fo:table-body> + <fo:table-row keep-with-next="always"> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + Row 1: + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + keep + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + together + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + row 2: + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + always + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + Row 2: + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + is always + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + kept + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + together + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + row 1 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle" + line-height="16cm"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="2cm"> + Table 4: cells spanning columns + </fo:block> + + <fo:table> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + number-columns-spanned="1" background-color="#FF6AC0"> + <fo:block> 1 to 1</fo:block> + </fo:table-cell> + <fo:table-cell + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + number-columns-spanned="5" background-color="#9BF2E9"> + <fo:block> 2 to 6</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + number-columns-spanned="2" background-color="#FF6AC0"> + <fo:block> 1 to 2</fo:block> + </fo:table-cell> + <fo:table-cell + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + number-columns-spanned="4" background-color="#9BF2E9"> + <fo:block> 3 to 6</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + + <fo:block space-before.optimum="2cm"> + Table 5: cells spanning rows + </fo:block> + + <fo:table> + <fo:table-column column-width="48pt"/> + <fo:table-column column-width="48pt"/> + <fo:table-column column-width="48pt"/> + <fo:table-column column-width="48pt"/> + <fo:table-column column-width="48pt"/> + <fo:table-column column-width="48pt"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block>1</fo:block></fo:table-cell> + <fo:table-cell number-rows-spanned="1" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#FF6AC0"> + <fo:block> 1 - 1</fo:block> + </fo:table-cell> + <fo:table-cell number-rows-spanned="2" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#FF6AC0"> + <fo:block> 1 - 2</fo:block> + </fo:table-cell> + <fo:table-cell number-rows-spanned="3" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#FF6AC0"><fo:block> 1 - 3</fo:block> + </fo:table-cell> + + <fo:table-cell number-rows-spanned="4" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#FF6AC0"><fo:block> 1 - 4</fo:block> + </fo:table-cell> + + <fo:table-cell number-rows-spanned="5" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#FF6AC0"><fo:block> 1 - 5</fo:block> + </fo:table-cell> + </fo:table-row> + + + <fo:table-row> + <fo:table-cell><fo:block>2</fo:block></fo:table-cell> + <fo:table-cell number-rows-spanned="5" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#9BF2E9"><fo:block> 2 - 6</fo:block> + </fo:table-cell> + </fo:table-row> + + <fo:table-row> + <fo:table-cell><fo:block>3</fo:block></fo:table-cell> + <fo:table-cell number-rows-spanned="4" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#9BF2E9"><fo:block> 3 - 6</fo:block> + </fo:table-cell> + </fo:table-row> + + <fo:table-row> + <fo:table-cell><fo:block>4</fo:block></fo:table-cell> + <fo:table-cell number-rows-spanned="3" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#9BF2E9"><fo:block> 4 - 6</fo:block> + </fo:table-cell> + </fo:table-row> + + <fo:table-row> + <fo:table-cell><fo:block>5</fo:block></fo:table-cell> + <fo:table-cell number-rows-spanned="2" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#9BF2E9"><fo:block> 5 - 6</fo:block> + </fo:table-cell> + </fo:table-row> + + <fo:table-row> + <fo:table-cell><fo:block>6</fo:block></fo:table-cell> + <fo:table-cell number-rows-spanned="1" + border-width="0.5pt" + border-style="solid" + border-color="black" + text-align="center" vertical-align="middle" + background-color="#9BF2E9"><fo:block> 6 - 6</fo:block> + </fo:table-cell> + </fo:table-row> + + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="2cm"> + Table 6: table with header and multiple body's + </fo:block> + + <fo:table> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-header> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-header> + + <fo:table-body space-after.optimum="10pt"> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="2cm"> + Table 6: table with footer and multiple body's + </fo:block> + + <fo:table> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-footer> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-footer> + + <fo:table-body space-after.optimum="10pt"> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/tables/keep.fo b/examples/fo/tables/keep.fo new file mode 100644 index 000000000..c28b1f7f9 --- /dev/null +++ b/examples/fo/tables/keep.fo @@ -0,0 +1,590 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="17cm" + master-name="first"> + <fo:region-before extent="1cm"/> + <fo:region-body margin-top="1cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">table examples</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">Page <fo:page-number/></fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Tests for keeps on table rows and the occurance of page breaks. + </fo:block> + + <fo:block space-before.optimum="280pt" space-after.optimum="15pt"> + Table 1: basic keep with next + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + first row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + second row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="280pt" space-after.optimum="15pt"> + Table 1: basic keep with previous + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + first row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-previous="always"> + <fo:table-cell> + <fo:block text-align="center"> + second row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + previous + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="270pt" space-after.optimum="15pt"> + Table 1: basic keep with next and keep with previous + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + first row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + second row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-previous="always"> + <fo:table-cell> + <fo:block text-align="center"> + third row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + previous + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="200pt" space-after.optimum="15pt"> + Table 1: basic multiple keep with next after normal row + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="160pt" space-after.optimum="15pt"> + Table 1: basic multiple keep (next and previous) after normal row + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="6cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always" keep-with-previous="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next and previous + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="160pt" space-after.optimum="15pt"> + Table 1: basic multiple keep with next after normal row with normal row in middle + </fo:block> + + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="6cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt" keep-with-next="always"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + keep with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + next + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + normal + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/tables/omit.fo b/examples/fo/tables/omit.fo new file mode 100644 index 000000000..b93595095 --- /dev/null +++ b/examples/fo/tables/omit.fo @@ -0,0 +1,1265 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="29.7cm" + master-name="first"> + <fo:region-before extent="7cm"/> + <fo:region-body margin-top="7cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">table examples</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">Page <fo:page-number/></fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block space-before.optimum="15cm"> + Table 1: with header + </fo:block> + + <fo:table table-omit-header-at-break="true"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-header> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-header> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15cm"> + Table 2: with footer + </fo:block> + + <fo:table table-omit-footer-at-break="true"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-footer> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-footer> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="15cm"> + Table 3: with header and footer and keeps + </fo:block> + + <fo:table table-omit-header-at-break="true" table-omit-footer-at-break="true"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-header> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-header> + + <fo:table-footer> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-footer> + + <fo:table-body> + <fo:table-row keep-with-next="always"> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + Row 1: + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + keep + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + together + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + row 2: + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + always + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + Row 2: + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + is always + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + kept + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + together + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + with + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + row 1 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle" + line-height="16cm"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle" + line-height="16cm"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block break-before="page" space-before.optimum="490pt"> + Table 6: table with multiple body's + </fo:block> + + <fo:table table-omit-header-at-break="true"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-header> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-header> + + <fo:table-body space-after.optimum="10pt"> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="460pt"> + Table 6: table with multiple body's + </fo:block> + + <fo:table table-omit-footer-at-break="true"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-footer> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" vertical-align="middle" + border-width="1pt" border-color="black" background-color="#F7F24D"> + Col.6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-footer> + + <fo:table-body space-after.optimum="10pt"> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 1 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 2 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 3 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 4 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block border-right-width="0.5pt" text-align="center" vertical-align="middle"> + 5 + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center" vertical-align="middle"> + 6 + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/tables/space.fo b/examples/fo/tables/space.fo new file mode 100644 index 000000000..a0ce77815 --- /dev/null +++ b/examples/fo/tables/space.fo @@ -0,0 +1,532 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="29.7cm" + master-name="first"> + <fo:region-before extent="1cm"/> + <fo:region-body margin-top="1cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">table examples</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">Page <fo:page-number/></fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Table 1: spaces around cells + </fo:block> + + <fo:table border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + first + </fo:block> + </fo:table-cell> + <fo:table-cell border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + table + </fo:block> + </fo:table-cell> + <fo:table-cell border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + <fo:table-cell padding-left="5pt" border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + left 5pt + </fo:block> + </fo:table-cell> + <fo:table-cell border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell space-before.optimum="5pt" border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + before 5pt + </fo:block> + </fo:table-cell> + <fo:table-cell padding-right="5pt" border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + right 5pt + </fo:block> + </fo:table-cell> + <fo:table-cell space-after.optimum="5pt" border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + after 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + last + </fo:block> + </fo:table-cell> + <fo:table-cell border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + table + </fo:block> + </fo:table-cell> + <fo:table-cell border-style="solid" border-width="0.5pt"> + <fo:block text-align="center"> + row + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Table 2: spaces around rows + </fo:block> + + <fo:table border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row border-style="solid" border-width="0.5pt" padding-left="5pt"> + <fo:table-cell> + <fo:block text-align="center"> + padding + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + left + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-style="solid" border-width="0.5pt" space-before.optimum="5pt"> + <fo:table-cell> + <fo:block text-align="center"> + space + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + before + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-style="solid" border-width="0.5pt" space-after.optimum="5pt"> + <fo:table-cell> + <fo:block text-align="center"> + space + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + after + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-style="solid" border-width="0.5pt" padding-right="5pt"> + <fo:table-cell> + <fo:block text-align="center"> + padding + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + right + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Table 3: spaces around body + </fo:block> + + <fo:table border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body border-style="solid" border-width="0.5pt" padding-left="5pt"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + padding + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + left + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body border-style="solid" border-width="0.5pt" space-before.optimum="5pt"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + space + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + before + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body border-style="solid" border-width="0.5pt" space-after.optimum="5pt"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + space + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + after + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body border-style="solid" border-width="0.5pt" padding-right="5pt"> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + padding + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + right + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Table 4: spaces around table + </fo:block> + + <fo:block border-style="solid" border-width="0.5pt"> + <fo:table space-before.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + space before + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block border-style="solid" border-width="0.5pt"> + <fo:table padding-left="5pt" border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + padding left + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block border-style="solid" border-width="0.5pt"> + <fo:table padding-right="5pt" border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + padding right + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block border-style="solid" border-width="0.5pt"> + <fo:table space-after.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + table + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + space after + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Table 5: combinations + </fo:block> + + <fo:block border-style="solid" border-width="0.5pt"> + <fo:table space-after.optimum="20pt" border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body space-after.optimum="15pt" border-style="solid" border-width="0.5pt" border-color="green"> + <fo:table-row space-after.optimum="10pt" border-style="solid" border-width="0.5pt" border-color="blue"> + <fo:table-cell space-after.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="yellow"> + <fo:block text-align="center"> + after 5pt + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + and row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + after 10pt + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + and + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + body + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + after 15pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + and + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + table + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + after 20pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block border-style="solid" border-width="0.5pt"> + <fo:table space-after.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red"> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + <fo:table-column column-width="3cm"/> + + <fo:table-body space-after.optimum="10pt" border-style="solid" border-width="0.5pt" border-color="green"> + <fo:table-row space-after.optimum="15pt" border-style="solid" border-width="0.5pt" border-color="blue"> + <fo:table-cell space-after.optimum="20pt" border-style="solid" border-width="0.5pt" border-color="yellow"> + <fo:block text-align="center"> + after 20pt + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + and row + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + after 15pt + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + and + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + body + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + after 10pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="center"> + and + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + table + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center"> + after 5pt + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/examples/fo/tables/widowsorphans.fo b/examples/fo/tables/widowsorphans.fo new file mode 100644 index 000000000..33fae4451 --- /dev/null +++ b/examples/fo/tables/widowsorphans.fo @@ -0,0 +1,522 @@ +<?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 + margin-right="1.5cm" + margin-left="1.5cm" + margin-bottom="2cm" + margin-top="1cm" + page-width="21cm" + page-height="17cm" + master-name="first"> + <fo:region-before extent="1cm"/> + <fo:region-body column-count="3" margin-top="1cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="first"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">table examples</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block line-height="14pt" font-size="10pt" + text-align="end">Page <fo:page-number/></fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <fo:block space-before.optimum="3pt" space-after.optimum="15pt"> + Tests for widows and orphans on a table. + </fo:block> + + <fo:block space-before.optimum="240pt" space-after.optimum="15pt"> + Table 1: normal table with widows of 1 + </fo:block> + + <fo:block widows="1"> + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block space-before.optimum="225pt" space-after.optimum="15pt"> + Table 2: normal table with widows of 3 + </fo:block> + + <fo:block widows="3"> + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block break-before="page" space-before.optimum="240pt" space-after.optimum="15pt"> + Table 3: normal table with orphans of 1 + </fo:block> + + <fo:block orphans="1"> + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block space-before.optimum="225pt" space-after.optimum="15pt"> + Table 4: normal table with orphans of 3 + </fo:block> + + <fo:block orphans="3"> + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block break-before="page" space-before.optimum="240pt" space-after.optimum="15pt"> + Table 3: normal table with widows 4 orphans of 3 + </fo:block> + + <fo:block widows="4" orphans="3"> + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block space-before.optimum="180pt" space-after.optimum="15pt"> + Table 4: normal table with orphans of 4 (and default widows 2) + </fo:block> + + <fo:block orphans="4"> + <fo:table border-width="0.5pt" border-color="red"> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + <fo:table-column column-width="2cm"/> + + <fo:table-body> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row border-width="0.5pt"> + <fo:table-cell> + <fo:block text-align="center">A</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">B</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="center">C</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> diff --git a/lib/avalon-framework-4.1.4.jar b/lib/avalon-framework-4.1.4.jar Binary files differnew file mode 100644 index 000000000..0abf0b953 --- /dev/null +++ b/lib/avalon-framework-4.1.4.jar diff --git a/lib/commons-io.LICENSE.txt b/lib/commons-io.LICENSE.txt new file mode 100644 index 000000000..0a29a251f --- /dev/null +++ b/lib/commons-io.LICENSE.txt @@ -0,0 +1,56 @@ +/* + * ==================================================================== + * + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + */ diff --git a/src/java/org/apache/fop/apps/CommandLineStarter.java b/src/java/org/apache/fop/apps/CommandLineStarter.java new file mode 100644 index 000000000..cdda837b3 --- /dev/null +++ b/src/java/org/apache/fop/apps/CommandLineStarter.java @@ -0,0 +1,122 @@ +/* + * $Id$ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.apps; + +// SAX +import org.xml.sax.XMLReader; + +// Java +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; + + +/** + * super class for all classes which start Fop from the commandline + * + * Modified to use new streaming API by Mark Lillywhite, mark-fop@inomial.com + */ +public class CommandLineStarter extends Starter { + + /** the command-line options associated with this starter */ + protected CommandLineOptions commandLineOptions; + + /** + * Main constructor + * @param commandLineOptions command-line options to use + * @throws FOPException In case of failure + */ + public CommandLineStarter(CommandLineOptions commandLineOptions) + throws FOPException { + this.commandLineOptions = commandLineOptions; + super.setInputHandler(commandLineOptions.getInputHandler()); + } + + /** + * Run the format. + * @exception FOPException if there is an error during processing + */ + public void run() throws FOPException { + String version = Version.getVersion(); + + getLogger().info(version); + + XMLReader parser = inputHandler.getParser(); + setParserFeatures(parser); + + Driver driver = new Driver(); + setupLogger(driver); + driver.initialize(); + + try { + driver.setRenderer(commandLineOptions.getRenderer()); + BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream( + commandLineOptions.getOutputFile())); + try { + driver.setOutputStream(bos); + if (driver.getRenderer() != null) { + driver.getRenderer().setOptions( + commandLineOptions.getRendererOptions()); + } + driver.render(parser, inputHandler.getInputSource()); + } finally { + bos.close(); + } + System.exit(0); + } catch (Exception e) { + if (e instanceof FOPException) { + throw (FOPException) e; + } + throw new FOPException(e); + } + } + +} + diff --git a/src/java/org/apache/fop/apps/Driver.java b/src/java/org/apache/fop/apps/Driver.java new file mode 100644 index 000000000..86c6d2206 --- /dev/null +++ b/src/java/org/apache/fop/apps/Driver.java @@ -0,0 +1,652 @@ +/* + * $Id$ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.apps; + +// FOP +import org.apache.fop.fo.ElementMapping; +import org.apache.fop.fo.FOTreeBuilder; +import org.apache.fop.fo.FOUserAgent; +import org.apache.fop.fo.StructureHandler; +import org.apache.fop.layoutmgr.LayoutHandler; +import org.apache.fop.mif.MIFHandler; +import org.apache.fop.render.Renderer; +import org.apache.fop.rtf.renderer.RTFHandler; +import org.apache.fop.tools.DocumentInputSource; +import org.apache.fop.tools.DocumentReader; + +// Avalon +import org.apache.avalon.framework.logger.ConsoleLogger; +import org.apache.avalon.framework.logger.LogEnabled; +import org.apache.avalon.framework.logger.Logger; + +// DOM +import org.w3c.dom.Document; + +// SAX +import org.xml.sax.ContentHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; + +// Java +import java.io.IOException; +import java.io.OutputStream; + +/** + * Primary class that drives overall FOP process. + * <P> + * The simplest way to use this is to instantiate it with the + * InputSource and OutputStream, then set the renderer desired, and + * calling run(); + * <P> + * Here is an example use of Driver which outputs PDF: + * + * <PRE> + * Driver driver = new Driver(new InputSource (args[0]), + * new FileOutputStream(args[1])); + * driver.enableLogging(myLogger); //optional + * driver.setRenderer(RENDER_PDF); + * driver.run(); + * </PRE> + * If neccessary, calling classes can call into the lower level + * methods to setup and + * render. Methods can be called to set the + * Renderer to use, the (possibly multiple) ElementMapping(s) to + * use and the OutputStream to use to output the results of the + * rendering (where applicable). In the case of the Renderer and + * ElementMapping(s), the Driver may be supplied either with the + * object itself, or the name of the class, in which case Driver will + * instantiate the class itself. The advantage of the latter is it + * enables runtime determination of Renderer and ElementMapping(s). + * <P> + * Once the Driver is set up, the render method + * is called. Depending on whether DOM or SAX is being used, the + * invocation of the method is either render(Document) or + * buildFOTree(Parser, InputSource) respectively. + * <P> + * A third possibility may be used to build the FO Tree, namely + * calling getContentHandler() and firing the SAX events yourself. + * <P> + * Once the FO Tree is built, the format() and render() methods may be + * called in that order. + * <P> + * Here is an example use of Driver which outputs to AWT: + * + * <PRE> + * Driver driver = new Driver(); + * driver.enableLogging(myLogger); //optional + * driver.setRenderer(new org.apache.fop.render.awt.AWTRenderer(translator)); + * driver.render(parser, fileInputSource(args[0])); + * </PRE> + */ +public class Driver implements LogEnabled { + + /** + * Render to PDF. OutputStream must be set + */ + public static final int RENDER_PDF = 1; + + /** + * Render to a GUI window. No OutputStream neccessary + */ + public static final int RENDER_AWT = 2; + + /** + * Render to MIF. OutputStream must be set + */ + public static final int RENDER_MIF = 3; + + /** + * Render to XML. OutputStream must be set + */ + public static final int RENDER_XML = 4; + + /** + * Render to PRINT. No OutputStream neccessary + */ + public static final int RENDER_PRINT = 5; + + /** + * Render to PCL. OutputStream must be set + */ + public static final int RENDER_PCL = 6; + + /** + * Render to Postscript. OutputStream must be set + */ + public static final int RENDER_PS = 7; + + /** + * Render to Text. OutputStream must be set + */ + public static final int RENDER_TXT = 8; + + /** + * Render to SVG. OutputStream must be set + */ + public static final int RENDER_SVG = 9; + + /** + * Render to RTF. OutputStream must be set + */ + public static final int RENDER_RTF = 10; + + /** + * the FO tree builder + */ + private FOTreeBuilder treeBuilder; + + /** + * the renderer type code given by setRenderer + */ + private int rendererType; + + /** + * the renderer to use to output the area tree + */ + private Renderer renderer; + + /** + * the structure handler + */ + private StructureHandler structHandler; + + /** + * the source of the FO file + */ + private InputSource source; + + /** + * the stream to use to output the results of the renderer + */ + private OutputStream stream; + + /** + * The XML parser to use when building the FO tree + */ + private XMLReader reader; + + /** + * the system resources that FOP will use + */ + private Logger log = null; + private FOUserAgent userAgent = null; + + /** + * Returns the fully qualified classname of the standard XML parser for FOP + * to use. + * @return the XML parser classname + */ + public static final String getParserClassName() { + try { + return javax.xml.parsers.SAXParserFactory.newInstance() + .newSAXParser().getXMLReader().getClass().getName(); + } catch (javax.xml.parsers.ParserConfigurationException e) { + return null; + } catch (org.xml.sax.SAXException e) { + return null; + } + } + + /** + * Main constructor for the Driver class. + */ + public Driver() { + stream = null; + } + + /** + * Convenience constructor for directly setting input and output. + * @param source InputSource to take the XSL-FO input from + * @param stream Target output stream + */ + public Driver(InputSource source, OutputStream stream) { + this(); + this.source = source; + this.stream = stream; + } + + private boolean isInitialized() { + return (treeBuilder != null); + } + + /** + * Initializes the Driver object. + */ + public void initialize() { + if (isInitialized()) { + throw new IllegalStateException("Driver already initialized"); + } + treeBuilder = new FOTreeBuilder(); + treeBuilder.setUserAgent(getUserAgent()); + } + + /** + * Optionally sets the FOUserAgent instance for FOP to use. The Driver + * class sets up its own FOUserAgent if none is set through this method. + * @param agent FOUserAgent to use + */ + public void setUserAgent(FOUserAgent agent) { + userAgent = agent; + } + + private FOUserAgent getUserAgent() { + if (userAgent == null) { + userAgent = new FOUserAgent(); + userAgent.enableLogging(getLogger()); + userAgent.setBaseURL(""); + } + return userAgent; + } + + /** + * Provide the Driver instance with a logger. More information on Avalon + * logging can be found at the + * <a href="http://avalon.apache.org">Avalon site</a>. + * + * @param log the logger. Must not be <code>null</code>. + * @see org.apache.avalon.framework.logger.LogEnabled#enableLogging(Logger) + */ + public void enableLogging(Logger log) { + if (this.log == null) { + this.log = log; + } else { + getLogger().warn("Logger is already set! Won't use the new logger."); + } + } + + /** + * Provide the Driver instance with a logger. + * @param log the logger. Must not be <code>null</code>. + * @deprecated Use #enableLogging(Logger) instead. + */ + public void setLogger(Logger log) { + enableLogging(log); + } + + + /** + * Returns the logger for use by FOP. + * @return the logger + * @see #enableLogging(Logger) + */ + protected Logger getLogger() { + if (this.log == null) { + this.log = new ConsoleLogger(ConsoleLogger.LEVEL_INFO); + this.log.error("Logger not set. Using ConsoleLogger as default."); + } + + return this.log; + } + + /** + * Resets the Driver so it can be reused. Property and element + * mappings are reset to defaults. + * The output stream is cleared. The renderer is cleared. + */ + public synchronized void reset() { + source = null; + stream = null; + reader = null; + treeBuilder.reset(); + } + + /** + * Indicates whether FOP has already received input data. + * @return true, if input data was received + */ + public boolean hasData() { + return (treeBuilder.hasData()); + } + + /** + * Set the OutputStream to use to output the result of the Renderer + * (if applicable) + * @param stream the stream to output the result of rendering to + */ + public void setOutputStream(OutputStream stream) { + this.stream = stream; + } + + private void validateOutputStream() { + if (this.stream == null) { + throw new IllegalStateException("OutputStream has not been set"); + } + } + + /** + * Set the source for the FO document. This can be a normal SAX + * InputSource, or an DocumentInputSource containing a DOM document. + * @see DocumentInputSource + */ + public void setInputSource(InputSource source) { + this.source = source; + } + + /** + * Sets the reader used when reading in the source. If not set, + * this defaults to a basic SAX parser. + * @param reader the reader to use. + */ + public void setXMLReader(XMLReader reader) { + this.reader = reader; + } + + /** + * Shortcut to set the rendering type to use. Must be one of + * <ul> + * <li>RENDER_PDF</li> + * <li>RENDER_AWT</li> + * <li>RENDER_MIF</li> + * <li>RENDER_XML</li> + * <li>RENDER_PCL</li> + * <li>RENDER_PS</li> + * <li>RENDER_TXT</li> + * <li>RENDER_SVG</li> + * <li>RENDER_RTF</li> + * </ul> + * @param renderer the type of renderer to use + * @throws IllegalArgumentException if an unsupported renderer type was required. + */ + public void setRenderer(int renderer) throws IllegalArgumentException { + rendererType = renderer; + switch (renderer) { + case RENDER_PDF: + setRenderer("org.apache.fop.render.pdf.PDFRenderer"); + break; + case RENDER_AWT: + throw new IllegalArgumentException("Use renderer form of setRenderer() for AWT"); + case RENDER_PRINT: + throw new IllegalArgumentException("Use renderer form of setRenderer() for PRINT"); + case RENDER_PCL: + setRenderer("org.apache.fop.render.pcl.PCLRenderer"); + break; + case RENDER_PS: + setRenderer("org.apache.fop.render.ps.PSRenderer"); + break; + case RENDER_TXT: + setRenderer("org.apache.fop.render.txt.TXTRenderer()"); + break; + case RENDER_MIF: + //structHandler will be set later + break; + case RENDER_XML: + setRenderer("org.apache.fop.render.xml.XMLRenderer"); + break; + case RENDER_SVG: + setRenderer("org.apache.fop.render.svg.SVGRenderer"); + break; + case RENDER_RTF: + //structHandler will be set later + break; + default: + throw new IllegalArgumentException("Unknown renderer type"); + } + } + + /** + * Set the Renderer to use. + * @param renderer the renderer instance to use (Note: Logger must be set at this point) + */ + public void setRenderer(Renderer renderer) { + renderer.setUserAgent(getUserAgent()); + this.renderer = renderer; + } + + /** + * Returns the currently active renderer. + * @return the renderer + */ + public Renderer getRenderer() { + return renderer; + } + + /** + * Sets the renderer. + * @param rendererClassName the fully qualified classname of the renderer + * class to use. + * @param version version number + * @deprecated use renderer.setProducer(version) + setRenderer(renderer) or + * just setRenderer(rendererType) which will use the default producer string. + * @see #setRenderer(int) + * @see #setRenderer(Renderer) + */ + public void setRenderer(String rendererClassName, String version) { + setRenderer(rendererClassName); + } + + /** + * Set the class name of the Renderer to use as well as the + * producer string for those renderers that can make use of it. + * @param rendererClassName classname of the renderer to use such as + * "org.apache.fop.render.pdf.PDFRenderer" + * @exception IllegalArgumentException if the classname was invalid. + * @see #setRenderer(int) + */ + public void setRenderer(String rendererClassName) + throws IllegalArgumentException { + try { + renderer = + (Renderer)Class.forName(rendererClassName).newInstance(); + if (renderer instanceof LogEnabled) { + ((LogEnabled)renderer).enableLogging(getLogger()); + } + renderer.setProducer(Version.getVersion()); + renderer.setUserAgent(getUserAgent()); + } catch (ClassNotFoundException e) { + throw new IllegalArgumentException("Could not find " + + rendererClassName); + } catch (InstantiationException e) { + throw new IllegalArgumentException("Could not instantiate " + + rendererClassName); + } catch (IllegalAccessException e) { + throw new IllegalArgumentException("Could not access " + + rendererClassName); + } catch (ClassCastException e) { + throw new IllegalArgumentException(rendererClassName + + " is not a renderer"); + } + } + + /** + * Add the given element mapping. + * An element mapping maps element names to Java classes. + * + * @param mapping the element mappingto add + */ + public void addElementMapping(ElementMapping mapping) { + treeBuilder.addElementMapping(mapping); + } + + /** + * Add the element mapping with the given class name. + * @param mappingClassName the class name representing the element mapping. + */ + public void addElementMapping(String mappingClassName) { + treeBuilder.addElementMapping(mappingClassName); + } + + /** + * Returns the tree builder (a SAX ContentHandler). + * + * Used in situations where SAX is used but not via a FOP-invoked + * SAX parser. A good example is an XSLT engine that fires SAX + * events but isn't a SAX Parser itself. + * @return a content handler for handling the SAX events. + */ + public ContentHandler getContentHandler() { + if (!isInitialized()) { + initialize(); + } + validateOutputStream(); + + // TODO: - do this stuff in a better way + // PIJ: I guess the structure handler should be created by the renderer. + if (rendererType == RENDER_MIF) { + structHandler = new MIFHandler(stream); + } else if (rendererType == RENDER_RTF) { + structHandler = new RTFHandler(stream); + } else { + if (renderer == null) { + throw new IllegalStateException( + "Renderer not set when using standard structHandler"); + } + structHandler = new LayoutHandler(stream, renderer, true); + } + + structHandler.enableLogging(getLogger()); + + treeBuilder.setUserAgent(getUserAgent()); + treeBuilder.setStructHandler(structHandler); + + return treeBuilder; + } + + /** + * Render the FO document read by a SAX Parser from an InputSource. + * @param parser the SAX parser. + * @param source the input source the parser reads from. + * @throws FOPException if anything goes wrong. + */ + public synchronized void render(XMLReader parser, InputSource source) + throws FOPException { + if (!isInitialized()) { + initialize(); + } + parser.setContentHandler(getContentHandler()); + try { + parser.parse(source); + } catch (SAXException e) { + if (e.getException() instanceof FOPException) { + // Undo exception tunneling. + throw (FOPException)e.getException(); + } else { + throw new FOPException(e); + } + } catch (IOException e) { + throw new FOPException(e); + } + } + + /** + * Render the FO ducument represented by a DOM Document. + * @param document the DOM document to read from + * @throws FOPException if anything goes wrong. + */ + public synchronized void render(Document document) + throws FOPException { + if (!isInitialized()) { + initialize(); + } + try { + DocumentInputSource source = new DocumentInputSource(document); + DocumentReader reader = new DocumentReader(); + reader.setContentHandler(getContentHandler()); + reader.parse(source); + } catch (SAXException e) { + if (e.getException() instanceof FOPException) { + // Undo exception tunneling. + throw (FOPException)e.getException(); + } else { + throw new FOPException(e); + } + } catch (IOException e) { + throw new FOPException(e); + } + + } + + /** + * Runs the formatting and renderering process using the previously set + * parser, input source, renderer and output stream. + * If the renderer was not set, default to PDF. + * If no parser was set, and the input source is not a dom document, + * get a default SAX parser. + * @throws IOException in case of IO errors. + * @throws FOPException if anything else goes wrong. + */ + public synchronized void run() throws IOException, FOPException { + if (!isInitialized()) { + initialize(); + } + if (renderer == null) { + setRenderer(RENDER_PDF); + } + + if (source == null) { + throw new FOPException("InputSource is not set."); + } + + if (reader == null) { + if (!(source instanceof DocumentInputSource)) { + try { + SAXParserFactory spf = javax.xml.parsers.SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + reader = spf.newSAXParser().getXMLReader(); + } catch (SAXException e) { + throw new FOPException(e); + } catch (ParserConfigurationException e) { + throw new FOPException(e); + } + } + } + + if (source instanceof DocumentInputSource) { + render(((DocumentInputSource)source).getDocument()); + } else { + render(reader, source); + } + } + +} + diff --git a/src/java/org/apache/fop/apps/FOInputHandler.java b/src/java/org/apache/fop/apps/FOInputHandler.java new file mode 100644 index 000000000..9f23c7dd5 --- /dev/null +++ b/src/java/org/apache/fop/apps/FOInputHandler.java @@ -0,0 +1,112 @@ +/* + * $Id$ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.apps; + +// Imported SAX classes +import org.xml.sax.InputSource; +import org.xml.sax.XMLReader; + +// java +import java.io.File; +import java.net.URL; + +/** + * Manages input if it is an XSL-FO file. + */ +public class FOInputHandler extends InputHandler { + + private File fofile = null; + private URL foURL = null; + + /** + * Create a FOInputHandler for a file. + * @param fofile the file to read the FO document. + */ + public FOInputHandler(File fofile) { + this.fofile = fofile; + } + + /** + * Create a FOInputHandler for an URL. + * @param url the URL to read the FO document. + */ + public FOInputHandler(URL url) { + this.foURL = url; + } + + + /** + * @see org.apache.fop.apps.InputHandler#getInputSource() + */ + public InputSource getInputSource () { + if (fofile != null) { + return super.fileInputSource(fofile); + } + return super.urlInputSource(foURL); + } + + /** + * @see org.apache.fop.apps.InputHandler#getParser() + */ + public XMLReader getParser() throws FOPException { + return super.createParser(); + } + + /** + * @see org.apache.fop.apps.InputHandler#run(Driver) + */ + public void run(Driver driver) throws FOPException { + throw new FOPException("not implemented: FOInputHandler.run(Driver)"); + } + + +} + diff --git a/src/java/org/apache/fop/apps/FOPException.java b/src/java/org/apache/fop/apps/FOPException.java new file mode 100644 index 000000000..f90a75272 --- /dev/null +++ b/src/java/org/apache/fop/apps/FOPException.java @@ -0,0 +1,177 @@ +/* + * $Id$ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.apps; + +import org.xml.sax.SAXException; + +/** + * Exception thrown when FOP has a problem. + */ +public class FOPException extends Exception { + + private static final String EXCEPTION_SEPARATOR = "\n---------\n"; + + private Throwable exception; + + /** + * create a new FOP Exception + * + * @param message descriptive message + */ + public FOPException(String message) { + super(message); + } + + /** + * + * @param e Throwable object + */ + public FOPException(Throwable e) { + super(e.getMessage()); + setException(e); + } + + /** + * + * @param message descriptive message + * @param e Throwable object + */ + public FOPException(String message, Throwable e) { + super(message); + setException(e); + } + + /** + * Sets exception + * @param t Throwable object + */ + protected void setException(Throwable t) { + exception = t; + } + + /** + * Accessor for exception + * @return exception + */ + public Throwable getException() { + return exception; + } + + protected Throwable getRootException() { + Throwable result = exception; + + if (result instanceof SAXException) { + result = ((SAXException)result).getException(); + } + if (result instanceof java.lang.reflect.InvocationTargetException) { + result = + ((java.lang.reflect.InvocationTargetException)result).getTargetException(); + } + if (result != exception) { + return result; + } + return null; + } + + /** + * Write stack trace to stderr + */ + public void printStackTrace() { + synchronized (System.err) { + super.printStackTrace(); + if (exception != null) { + System.err.println(EXCEPTION_SEPARATOR); + exception.printStackTrace(); + } + if (getRootException() != null) { + System.err.println(EXCEPTION_SEPARATOR); + getRootException().printStackTrace(); + } + } + } + + /** + * write stack trace on a PrintStream + * @param stream PrintStream on which to write stack trace + */ + public void printStackTrace(java.io.PrintStream stream) { + synchronized (stream) { + super.printStackTrace(stream); + if (exception != null) { + stream.println(EXCEPTION_SEPARATOR); + exception.printStackTrace(stream); + } + if (getRootException() != null) { + stream.println(EXCEPTION_SEPARATOR); + getRootException().printStackTrace(stream); + } + } + } + + /** + * Write stack trace on a PrintWriter + * @param writer PrintWriter on which to write stack trace + */ + public void printStackTrace(java.io.PrintWriter writer) { + synchronized (writer) { + super.printStackTrace(writer); + if (exception != null) { + writer.println(EXCEPTION_SEPARATOR); + exception.printStackTrace(writer); + } + if (getRootException() != null) { + writer.println(EXCEPTION_SEPARATOR); + getRootException().printStackTrace(writer); + } + } + } + +} diff --git a/src/java/org/apache/fop/apps/Fop.java b/src/java/org/apache/fop/apps/Fop.java new file mode 100644 index 000000000..a09ef5957 --- /dev/null +++ b/src/java/org/apache/fop/apps/Fop.java @@ -0,0 +1,91 @@ +/* + * $Id$ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.apps; + +/** + * The main application class for the FOP command line interface (CLI). + */ +public class Fop { + + /** + * The main routine for the command line interface + * @param args the command line parameters + */ + public static void main(String[] args) { + CommandLineOptions options = null; + + try { + options = new CommandLineOptions(args); + Starter starter = options.getStarter(); + starter.run(); + } catch (FOPException e) { + if (e.getMessage() == null) { + System.err.println("Exception occured with a null error message"); + } else { + System.err.println("" + e.getMessage()); + } + if (options != null && options.getLogger().isDebugEnabled()) { + e.printStackTrace(); + } else { + System.err.println("Turn on debugging for more information"); + } + } catch (java.io.FileNotFoundException e) { + System.err.println("" + e.getMessage()); + if (options != null && options.getLogger().isDebugEnabled()) { + e.printStackTrace(); + } else { + System.err.println("Turn on debugging for more information"); + } + } + } + +} + diff --git a/src/java/org/apache/fop/apps/InputHandler.java b/src/java/org/apache/fop/apps/InputHandler.java new file mode 100644 index 000000000..7f7fe40a0 --- /dev/null +++ b/src/java/org/apache/fop/apps/InputHandler.java @@ -0,0 +1,141 @@ +/* + * $Id$ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.apps; + +// SAX +import org.xml.sax.InputSource; +import org.xml.sax.XMLReader; +import org.xml.sax.SAXException; + +// Java +import javax.xml.parsers.SAXParserFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.net.URL; +import java.io.File; + +/** + * Abstract super class for input handlers. + * Should be used to abstract the various possibilities on how input + * can be provided to FOP (but actually isn't). + */ +public abstract class InputHandler { + + /** + * Get the input source associated with this input handler. + * @return the input source + */ + public abstract InputSource getInputSource(); + + /** + * Get the SAX parser associated with this input handler. + * @return the SAX parser + * @throws FOPException in case of an error determining the SAX parser + */ + public abstract XMLReader getParser() throws FOPException; + + /** + * Creates an InputSource from a URL. + * @param url URL to use + * @return the newly created InputSource + */ + public static InputSource urlInputSource(URL url) { + return new InputSource(url.toString()); + } + + /** + * Creates an <code>InputSource</code> from a <code>File</code> + * @param file the <code>File</code> + * @return the <code>InputSource</code> created + */ + public static InputSource fileInputSource(File file) { + /* this code adapted from James Clark's in XT */ + String path = file.getAbsolutePath(); + String fSep = System.getProperty("file.separator"); + if (fSep != null && fSep.length() == 1) { + path = path.replace(fSep.charAt(0), '/'); + } + if (path.length() > 0 && path.charAt(0) != '/') { + path = '/' + path; + } + try { + return new InputSource(new URL("file", null, path).toString()); + } catch (java.net.MalformedURLException e) { + throw new Error("unexpected MalformedURLException"); + } + } + + /** + * Creates <code>XMLReader</code> object using default + * <code>SAXParserFactory</code> + * @return the created <code>XMLReader</code> + * @throws FOPException if the parser couldn't be created or configured for proper operation. + */ + protected static XMLReader createParser() throws FOPException { + try { + SAXParserFactory factory = SAXParserFactory.newInstance(); + factory.setNamespaceAware(true); + return factory.newSAXParser().getXMLReader(); + } catch (SAXException se) { + throw new FOPException("Coudn't create XMLReader", se); + } catch (ParserConfigurationException pce) { + throw new FOPException("Coudn't create XMLReader", pce); + } + } + + /** + * Runs this InputHandler through the Driver. + * @param driver Driver instance to use + * @throws FOPException if processing this InputHandler fails + */ + public abstract void run(Driver driver) throws FOPException; + +} + diff --git a/src/java/org/apache/fop/apps/package.html b/src/java/org/apache/fop/apps/package.html new file mode 100644 index 000000000..c8a9798d5 --- /dev/null +++ b/src/java/org/apache/fop/apps/package.html @@ -0,0 +1,7 @@ +<HTML> +<TITLE>org.apache.fop.apps Package</TITLE> +<BODY> +<P>Application classes used for running FOP both on the command line and +embedded in other applications.</P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/src/java/org/apache/fop/area/Area.java b/src/java/org/apache/fop/area/Area.java new file mode 100644 index 000000000..fec8cbb79 --- /dev/null +++ b/src/java/org/apache/fop/area/Area.java @@ -0,0 +1,265 @@ +/* + * $Id: Area.java,v 1.16 2003/03/05 15:19:31 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.area; + +import java.io.Serializable; + +import java.util.Map; +import java.util.HashMap; + +// If the area appears more than once in the output +// or if the area has external data it is cached +// to keep track of it and to minimize rendered output +// renderers can render the output once and display it +// for every occurence +// this should also extend to all outputs (including PDFGraphics2D) +// and all types of renderers + +/** + * Base object for all areas. + */ +public class Area implements Serializable { + // stacking directions + /** + * Stacking left to right + */ + public static final int LR = 0; + + /** + * Stacking right to left + */ + public static final int RL = 1; + + /** + * Stacking top to bottom + */ + public static final int TB = 2; + + /** + * Stacking bottom to top + */ + public static final int BT = 3; + + // orientations for reference areas + /** + * Normal orientation + */ + public static final int ORIENT_0 = 0; + + /** + * Rotated 90 degrees clockwise + */ + public static final int ORIENT_90 = 1; + + /** + * Rotate 180 degrees + */ + public static final int ORIENT_180 = 2; + + /** + * Rotated 270 degrees clockwise + */ + public static final int ORIENT_270 = 3; + + // area class values + + /** + * Normal class + */ + public static final int CLASS_NORMAL = 0; + + /** + * Fixed position class + */ + public static final int CLASS_FIXED = 1; + + /** + * Absolute position class + */ + public static final int CLASS_ABSOLUTE = 2; + + /** + * Before float class + */ + public static final int CLASS_BEFORE_FLOAT = 3; + + /** + * Footnote class + */ + public static final int CLASS_FOOTNOTE = 4; + + /** + * Side float class + */ + public static final int CLASS_SIDE_FLOAT = 5; + + // IMPORTANT: make sure this is the maximum + 1 + /** + * Maximum class count + */ + public static final int CLASS_MAX = CLASS_SIDE_FLOAT + 1; + + private int areaClass = CLASS_NORMAL; + private int ipd; + + /** + * Traits for this area stored in a HashMap + */ + protected HashMap props = null; + + /** + * Get the area class of this area. + * + * @return the area class + */ + public int getAreaClass() { + return areaClass; + } + + /** + * Set the area class of this area. + * + * @param areaClass the area class + */ + public void setAreaClass(int areaClass) { + this.areaClass = areaClass; + } + + /** + * Set the inline progression dimension of this area. + * + * @param i the new inline progression dimension + */ + public void setIPD(int i) { + ipd = i; + } + + /** + * Get the inline progression dimension of this area. + * + * @return the inline progression dimension + */ + public int getIPD() { + return ipd; + } + + /** + * Add a child to this area. + * The default is to do nothing. Subclasses must override + * to do something if they can have child areas. + * + * @param child the child area to add + */ + public void addChild(Area child) { + } + + /** + * Add a trait property to this area. + * + * @param prop the Trait to add + */ + public void addTrait(Trait prop) { + if (props == null) { + props = new java.util.HashMap(20); + } + props.put(prop.getPropType(), prop.getData()); + } + + /** + * Add a trait to this area. + * + * @param traitCode the trait key + * @param prop the value of the trait + */ + public void addTrait(Object traitCode, Object prop) { + if (props == null) { + props = new java.util.HashMap(20); + } + props.put(traitCode, prop); + } + + /** + * Get the map of all traits on this area. + * + * @return the map of traits + */ + public Map getTraits() { + return this.props; + } + + /** + * Get a trait from this area. + * + * @param oTraitCode the trait key + * @return the trait value + */ + public Object getTrait(Object oTraitCode) { + return (props != null ? props.get(oTraitCode) : null); + } + + /** + * Get a trait from this area as an integer. + * + * @param oTraitCode the trait key + * @return the trait value + */ + public int getTraitAsInteger(Object oTraitCode) { + final Object obj = getTrait(oTraitCode); + if (obj instanceof Integer) { + return ((Integer)obj).intValue(); + } else { + throw new IllegalArgumentException("Trait " + + oTraitCode.getClass().getName() + + " could not be converted to an integer"); + } + } +} + diff --git a/src/java/org/apache/fop/area/Resolveable.java b/src/java/org/apache/fop/area/Resolveable.java new file mode 100644 index 000000000..7687a2bf3 --- /dev/null +++ b/src/java/org/apache/fop/area/Resolveable.java @@ -0,0 +1,87 @@ +/* + * $Id: Resolveable.java,v 1.5 2003/03/05 15:19:31 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.area; + +import java.util.List; + +/** + * Resolveable Interface. + * Classes that implement this can be resolved when + * an id is added to the area tree. + */ +public interface Resolveable { + + /** + * Check if this area has been resolved. + * + * @return true once this area is resolved + */ + boolean isResolved(); + + /** + * Get the array of id references of this resolveable object. + * If this object contains child resolveables that are + * resolved through this then it should return the id's of + * the child also. + * + * @return the id references for resolving this object + */ + String[] getIDs(); + + /** + * This resolves reference with a list of pages. + * The pages (PageViewport) contain the rectangle of the area. + * @param id the id to resolve + * @param pages the list of pages with the id area + * may be null if not found + */ + void resolve(String id, List pages); +} diff --git a/src/java/org/apache/fop/area/Span.java b/src/java/org/apache/fop/area/Span.java new file mode 100644 index 000000000..04258bfb0 --- /dev/null +++ b/src/java/org/apache/fop/area/Span.java @@ -0,0 +1,112 @@ +/* + * $Id: Span.java,v 1.8 2003/03/05 15:19:31 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.area; + +import java.util.List; + +/** + * The span reference area. + * This is a reference area block area with 0 border and padding + * The span reference areas are stacked inside the main reference area. + */ +public class Span extends Area { + // the list of flow reference areas in this span area + private List flowAreas; + private int height; + + /** + * Create a span area with the number of columns for this span area. + * + * @param cols the number of columns in the span + */ + public Span(int cols) { + flowAreas = new java.util.ArrayList(cols); + } + + /** + * Add the flow area to this span area. + * + * @param flow the flow area to add + */ + public void addFlow(Flow flow) { + flowAreas.add(flow); + } + + /** + * Get the column count for this span area. + * + * @return the number of columns in this span area + */ + public int getColumnCount() { + return flowAreas.size(); + } + + /** + * Get the height of this span area. + * + * @return the height of this span area + */ + public int getHeight() { + return height; + } + + /** + * Get the flow area for a particular column. + * + * @param count the column number for the flow + * @return the flow area for the requested column + */ + public Flow getFlow(int count) { + return (Flow) flowAreas.get(count); + } + +} + diff --git a/src/java/org/apache/fop/datatypes/ColorType.java b/src/java/org/apache/fop/datatypes/ColorType.java new file mode 100644 index 000000000..b0d04945b --- /dev/null +++ b/src/java/org/apache/fop/datatypes/ColorType.java @@ -0,0 +1,755 @@ +/* + * $Id: ColorType.java,v 1.21 2003/03/05 20:38:23 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.datatypes; + +import java.io.Serializable; +import java.util.StringTokenizer; + +/** + * A colour quantity in XSL. + */ +public class ColorType implements Serializable { + + /** + * the red component + */ + protected float red; + + /** + * the green component + */ + protected float green; + + /** + * the blue component + */ + protected float blue; + + /** + * the alpha component + */ + protected float alpha = 0; + + /** + * Main constructor + * @param red red component + * @param green green component + * @param blue blue component + */ + public ColorType(float red, float green, float blue) { + this.red = red; + this.green = green; + this.blue = blue; + } + + /** + * Set the colour given a particular String specifying either a + * colour name or #RGB or #RRGGBB + * @param value RGB value as String to be parsed + */ + public ColorType(String value) { + if (value.startsWith("#")) { + try { + if (value.length() == 4) { + // note: divide by 15 so F = FF = 1 and so on + this.red = Integer.parseInt(value.substring(1, 2), 16) + / 15f; + this.green = Integer.parseInt(value.substring(2, 3), 16) + / 15f; + this.blue = Integer.parseInt(value.substring(3), 16) + / 15f; + } else if (value.length() == 7) { + // note: divide by 255 so FF = 1 + this.red = Integer.parseInt(value.substring(1, 3), 16) + / 255f; + this.green = Integer.parseInt(value.substring(3, 5), 16) + / 255f; + this.blue = Integer.parseInt(value.substring(5), 16) + / 255f; + } else { + this.red = 0; + this.green = 0; + this.blue = 0; + //log.error("unknown colour format. Must be #RGB or #RRGGBB"); + } + } catch (Exception e) { + this.red = 0; + this.green = 0; + this.blue = 0; + //log.error("unknown colour format. Must be #RGB or #RRGGBB"); + } + } else if (value.startsWith("rgb(")) { + int poss = value.indexOf("("); + int pose = value.indexOf(")"); + if (poss != -1 && pose != -1) { + value = value.substring(poss + 1, pose); + StringTokenizer st = new StringTokenizer(value, ","); + try { + if (st.hasMoreTokens()) { + String str = st.nextToken().trim(); + if (str.endsWith("%")) { + this.red = + Integer.parseInt(str.substring(0, str.length() - 1)) + * 2.55f; + } else { + this.red = Integer.parseInt(str) / 255f; + } + } + if (st.hasMoreTokens()) { + String str = st.nextToken().trim(); + if (str.endsWith("%")) { + this.green = + Integer.parseInt(str.substring(0, str.length() - 1)) + * 2.55f; + } else { + this.green = Integer.parseInt(str) / 255f; + } + } + if (st.hasMoreTokens()) { + String str = st.nextToken().trim(); + if (str.endsWith("%")) { + this.blue = + Integer.parseInt(str.substring(0, str.length() - 1)) + * 2.55f; + } else { + this.blue = Integer.parseInt(str) / 255f; + } + } + } catch (Exception e) { + this.red = 0; + this.green = 0; + this.blue = 0; + //log.error("unknown colour format. Must be #RGB or #RRGGBB"); + } + } + } else if (value.startsWith("url(")) { + // refers to a gradient + } else { + if (value.toLowerCase().equals("transparent")) { + this.red = 0; + this.green = 0; + this.blue = 0; + this.alpha = 1; + } else { + boolean found = false; + for (int count = 0; count < NAMES.length; count++) { + if (value.toLowerCase().equals(NAMES[count])) { + this.red = VALUES[count][0] / 255f; + this.green = VALUES[count][1] / 255f; + this.blue = VALUES[count][2] / 255f; + found = true; + break; + } + } + if (!found) { + this.red = 0; + this.green = 0; + this.blue = 0; + //log.error("unknown colour name: " + // + value); + } + } + } + } + + /** + * Returns the blue component of the color. + * @return float a value between 0.0 and 1.0 + */ + public float getBlue() { + return this.blue; + } + + /** + * Returns the green component of the color. + * @return float a value between 0.0 and 1.0 + */ + public float getGreen() { + return this.green; + } + + /** + * Returns the red component of the color. + * @return float a value between 0.0 and 1.0 + */ + public float getRed() { + return this.red; + } + + /** + * Returns the alpha (transparency) component of the color. + * @return float a value between 0.0 and 1.0 + */ + public float alpha() { + return this.alpha; + } + + /** + * @param floatValue value (between 0.0 and 1.0) of color channel + * @return integer equivalent (between 0 and 255) + */ + public static int convertChannelToInteger (float floatValue) { + if (floatValue > 1.0) { + floatValue = 1.0f; + } + if (floatValue < 0) { + floatValue = 0; + } + return (int) floatValue * 255; + } + + /** + * @see java.lang.Object#toString() + */ + public String toString() { + StringBuffer sbuf = new StringBuffer(8); + sbuf.append('#'); + String s = Integer.toHexString((int)(red * 255.0)); + if (s.length() == 1) { + sbuf.append('0'); + } + sbuf.append(s); + s = Integer.toHexString((int)(green * 255.0)); + if (s.length() == 1) { + sbuf.append('0'); + } + sbuf.append(s); + s = Integer.toHexString((int)(blue * 255.0)); + if (s.length() == 1) { + sbuf.append('0'); + } + sbuf.append(s); + return sbuf.toString(); + } + + /** The names of the predefined colors */ + protected static final String[] NAMES = { + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", + "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", + "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", + "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", + "darkorchid", "darkred", "darksalmon", "darkseagreen", + "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", + "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", + "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", + "gainsboro", "lightpink", "lightsalmon", "lightseagreen", + "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", + "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", + "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", + "mediumseagreen", "mediumslateblue", "mediumspringgreen", + "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", + "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", + "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", + "palegreen", "paleturquoise", "palevioletred", "papayawhip", + "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "red", + "rosybrown", "royalblue", "saddlebrown", "salmon", "ghostwhite", + "gold", "goldenrod", "gray", "grey", "green", "greenyellow", + "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", + "lavender", "lavenderblush", "lawngreen", "lemonchiffon", + "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", + "lightgray", "lightgreen", "lightgrey", "sandybrown", "seagreen", + "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", + "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", + "thistle", "tomato", "turquoise", "violet", "wheat", "white", + "whitesmoke", "yellow", "yellowgreen" + }; + + /** The color values for the predefined colors */ + protected static final int[][] VALUES = { + { + 240, 248, 255 + }, { + 250, 235, 215 + }, { + 0, 255, 255 + }, { + 127, 255, 212 + }, { + 240, 255, 255 + }, { + 245, 245, 220 + }, { + 255, 228, 196 + }, { + 0, 0, 0 + }, { + 255, 235, 205 + }, { + 0, 0, 255 + }, { + 138, 43, 226 + }, { + 165, 42, 42 + }, { + 222, 184, 135 + }, { + 95, 158, 160 + }, { + 127, 255, 0 + }, { + 210, 105, 30 + }, { + 255, 127, 80 + }, { + 100, 149, 237 + }, { + 255, 248, 220 + }, { + 220, 20, 60 + }, { + 0, 255, 255 + }, { + 0, 0, 139 + }, { + 0, 139, 139 + }, { + 184, 134, 11 + }, { + 169, 169, 169 + }, { + 0, 100, 0 + }, { + 169, 169, 169 + }, { + 189, 183, 107 + }, { + 139, 0, 139 + }, { + 85, 107, 47 + }, { + 255, 140, 0 + }, { + 153, 50, 204 + }, { + 139, 0, 0 + }, { + 233, 150, 122 + }, { + 143, 188, 143 + }, { + 72, 61, 139 + }, { + 47, 79, 79 + }, { + 47, 79, 79 + }, { + 0, 206, 209 + }, { + 148, 0, 211 + }, { + 255, 20, 147 + }, { + 0, 191, 255 + }, { + 105, 105, 105 + }, { + 105, 105, 105 + }, { + 30, 144, 255 + }, { + 178, 34, 34 + }, { + 255, 250, 240 + }, { + 34, 139, 34 + }, { + 255, 0, 255 + }, { + 220, 220, 220 + }, { + 255, 182, 193 + }, { + 255, 160, 122 + }, { + 32, 178, 170 + }, { + 135, 206, 250 + }, { + 119, 136, 153 + }, { + 119, 136, 153 + }, { + 176, 196, 222 + }, { + 255, 255, 224 + }, { + 0, 255, 0 + }, { + 50, 205, 50 + }, { + 250, 240, 230 + }, { + 255, 0, 255 + }, { + 128, 0, 0 + }, { + 102, 205, 170 + }, { + 0, 0, 205 + }, { + 186, 85, 211 + }, { + 147, 112, 219 + }, { + 60, 179, 113 + }, { + 123, 104, 238 + }, { + 0, 250, 154 + }, { + 72, 209, 204 + }, { + 199, 21, 133 + }, { + 25, 25, 112 + }, { + 245, 255, 250 + }, { + 255, 228, 225 + }, { + 255, 228, 181 + }, { + 255, 222, 173 + }, { + 0, 0, 128 + }, { + 253, 245, 230 + }, { + 128, 128, 0 + }, { + 107, 142, 35 + }, { + 255, 165, 0 + }, { + 255, 69, 0 + }, { + 218, 112, 214 + }, { + 238, 232, 170 + }, { + 152, 251, 152 + }, { + 175, 238, 238 + }, { + 219, 112, 147 + }, { + 255, 239, 213 + }, { + 255, 218, 185 + }, { + 205, 133, 63 + }, { + 255, 192, 203 + }, { + 221, 160, 221 + }, { + 176, 224, 230 + }, { + 128, 0, 128 + }, { + 255, 0, 0 + }, { + 188, 143, 143 + }, { + 65, 105, 225 + }, { + 139, 69, 19 + }, { + 250, 128, 114 + }, { + 248, 248, 255 + }, { + 255, 215, 0 + }, { + 218, 165, 32 + }, { + 128, 128, 128 + }, { + 128, 128, 128 + }, { + 0, 128, 0 + }, { + 173, 255, 47 + }, { + 240, 255, 240 + }, { + 255, 105, 180 + }, { + 205, 92, 92 + }, { + 75, 0, 130 + }, { + 255, 255, 240 + }, { + 240, 230, 140 + }, { + 230, 230, 250 + }, { + 255, 240, 245 + }, { + 124, 252, 0 + }, { + 255, 250, 205 + }, { + 173, 216, 230 + }, { + 240, 128, 128 + }, { + 224, 255, 255 + }, { + 250, 250, 210 + }, { + 211, 211, 211 + }, { + 144, 238, 144 + }, { + 211, 211, 211 + }, { + 244, 164, 96 + }, { + 46, 139, 87 + }, { + 255, 245, 238 + }, { + 160, 82, 45 + }, { + 192, 192, 192 + }, { + 135, 206, 235 + }, { + 106, 90, 205 + }, { + 112, 128, 144 + }, { + 112, 128, 144 + }, { + 255, 250, 250 + }, { + 0, 255, 127 + }, { + 70, 130, 180 + }, { + 210, 180, 140 + }, { + 0, 128, 128 + }, { + 216, 191, 216 + }, { + 255, 99, 71 + }, { + 64, 224, 208 + }, { + 238, 130, 238 + }, { + 245, 222, 179 + }, { + 255, 255, 255 + }, { + 245, 245, 245 + }, { + 255, 255, 0 + }, { + 154, 205, 50 + } + }; +} + +/* + * aliceblue rgb(240, 248, 255) + * antiquewhite rgb(250, 235, 215) + * aqua rgb( 0, 255, 255) + * aquamarine rgb(127, 255, 212) + * azure rgb(240, 255, 255) + * beige rgb(245, 245, 220) + * bisque rgb(255, 228, 196) + * black rgb( 0, 0, 0) + * blanchedalmond rgb(255, 235, 205) + * blue rgb( 0, 0, 255) + * blueviolet rgb(138, 43, 226) + * brown rgb(165, 42, 42) + * burlywood rgb(222, 184, 135) + * cadetblue rgb( 95, 158, 160) + * chartreuse rgb(127, 255, 0) + * chocolate rgb(210, 105, 30) + * coral rgb(255, 127, 80) + * cornflowerblue rgb(100, 149, 237) + * cornsilk rgb(255, 248, 220) + * crimson rgb(220, 20, 60) + * cyan rgb( 0, 255, 255) + * darkblue rgb( 0, 0, 139) + * darkcyan rgb( 0, 139, 139) + * darkgoldenrod rgb(184, 134, 11) + * darkgray rgb(169, 169, 169) + * darkgreen rgb( 0, 100, 0) + * darkgrey rgb(169, 169, 169) + * darkkhaki rgb(189, 183, 107) + * darkmagenta rgb(139, 0, 139) + * darkolivegreen rgb( 85, 107, 47) + * darkorange rgb(255, 140, 0) + * darkorchid rgb(153, 50, 204) + * darkred rgb(139, 0, 0) + * darksalmon rgb(233, 150, 122) + * darkseagreen rgb(143, 188, 143) + * darkslateblue rgb( 72, 61, 139) + * darkslategray rgb( 47, 79, 79) + * darkslategrey rgb( 47, 79, 79) + * darkturquoise rgb( 0, 206, 209) + * darkviolet rgb(148, 0, 211) + * deeppink rgb(255, 20, 147) + * deepskyblue rgb( 0, 191, 255) + * dimgray rgb(105, 105, 105) + * dimgrey rgb(105, 105, 105) + * dodgerblue rgb( 30, 144, 255) + * firebrick rgb(178, 34, 34) + * floralwhite rgb(255, 250, 240) + * forestgreen rgb( 34, 139, 34) + * fuchsia rgb(255, 0, 255) + * gainsboro rgb(220, 220, 220) + * lightpink rgb(255, 182, 193) + * lightsalmon rgb(255, 160, 122) + * lightseagreen rgb( 32, 178, 170) + * lightskyblue rgb(135, 206, 250) + * lightslategray rgb(119, 136, 153) + * lightslategrey rgb(119, 136, 153) + * lightsteelblue rgb(176, 196, 222) + * lightyellow rgb(255, 255, 224) + * lime rgb( 0, 255, 0) + * limegreen rgb( 50, 205, 50) + * linen rgb(250, 240, 230) + * magenta rgb(255, 0, 255) + * maroon rgb(128, 0, 0) + * mediumaquamarine rgb(102, 205, 170) + * mediumblue rgb( 0, 0, 205) + * mediumorchid rgb(186, 85, 211) + * mediumpurple rgb(147, 112, 219) + * mediumseagreen rgb( 60, 179, 113) + * mediumslateblue rgb(123, 104, 238) + * mediumspringgreen rgb( 0, 250, 154) + * mediumturquoise rgb( 72, 209, 204) + * mediumvioletred rgb(199, 21, 133) + * midnightblue rgb( 25, 25, 112) + * mintcream rgb(245, 255, 250) + * mistyrose rgb(255, 228, 225) + * moccasin rgb(255, 228, 181) + * navajowhite rgb(255, 222, 173) + * navy rgb( 0, 0, 128) + * oldlace rgb(253, 245, 230) + * olive rgb(128, 128, 0) + * olivedrab rgb(107, 142, 35) + * orange rgb(255, 165, 0) + * orangered rgb(255, 69, 0) + * orchid rgb(218, 112, 214) + * palegoldenrod rgb(238, 232, 170) + * palegreen rgb(152, 251, 152) + * paleturquoise rgb(175, 238, 238) + * palevioletred rgb(219, 112, 147) + * papayawhip rgb(255, 239, 213) + * peachpuff rgb(255, 218, 185) + * peru rgb(205, 133, 63) + * pink rgb(255, 192, 203) + * plum rgb(221, 160, 221) + * powderblue rgb(176, 224, 230) + * purple rgb(128, 0, 128) + * red rgb(255, 0, 0) + * rosybrown rgb(188, 143, 143) + * royalblue rgb( 65, 105, 225) + * saddlebrown rgb(139, 69, 19) + * salmon rgb(250, 128, 114) + * ghostwhite rgb(248, 248, 255) + * gold rgb(255, 215, 0) + * goldenrod rgb(218, 165, 32) + * gray rgb(128, 128, 128) + * grey rgb(128, 128, 128) + * green rgb( 0, 128, 0) + * greenyellow rgb(173, 255, 47) + * honeydew rgb(240, 255, 240) + * hotpink rgb(255, 105, 180) + * indianred rgb(205, 92, 92) + * indigo rgb( 75, 0, 130) + * ivory rgb(255, 255, 240) + * khaki rgb(240, 230, 140) + * lavender rgb(230, 230, 250) + * lavenderblush rgb(255, 240, 245) + * lawngreen rgb(124, 252, 0) + * lemonchiffon rgb(255, 250, 205) + * lightblue rgb(173, 216, 230) + * lightcoral rgb(240, 128, 128) + * lightcyan rgb(224, 255, 255) + * lightgoldenrodyellow rgb(250, 250, 210) + * lightgray rgb(211, 211, 211) + * lightgreen rgb(144, 238, 144) + * lightgrey rgb(211, 211, 211) + * sandybrown rgb(244, 164, 96) + * seagreen rgb( 46, 139, 87) + * seashell rgb(255, 245, 238) + * sienna rgb(160, 82, 45) + * silver rgb(192, 192, 192) + * skyblue rgb(135, 206, 235) + * slateblue rgb(106, 90, 205) + * slategray rgb(112, 128, 144) + * slategrey rgb(112, 128, 144) + * snow rgb(255, 250, 250) + * springgreen rgb( 0, 255, 127) + * steelblue rgb( 70, 130, 180) + * tan rgb(210, 180, 140) + * teal rgb( 0, 128, 128) + * thistle rgb(216, 191, 216) + * tomato rgb(255, 99, 71) + * turquoise rgb( 64, 224, 208) + * violet rgb(238, 130, 238) + * wheat rgb(245, 222, 179) + * white rgb(255, 255, 255) + * whitesmoke rgb(245, 245, 245) + * yellow rgb(255, 255, 0) + * yellowgreen rgb(154, 205, 50) + */ diff --git a/src/java/org/apache/fop/datatypes/Length.java b/src/java/org/apache/fop/datatypes/Length.java new file mode 100644 index 000000000..72ec29e59 --- /dev/null +++ b/src/java/org/apache/fop/datatypes/Length.java @@ -0,0 +1,148 @@ +/* + * $Id: Length.java,v 1.17 2003/03/05 20:38:23 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.datatypes; + +import org.apache.fop.fo.expr.Numeric; + +/** + * A length quantity in XSL + */ +public class Length { + + /** Holds the length in millipoints. */ + protected int millipoints = 0; + /** Indicates if the value has been computed, or not. */ + protected boolean bIsComputed = false; + + /** + * Returns the length in 1/1000ths of a point (millipoints) + * @return the length in millipoints + */ + public int getValue() { + if (!bIsComputed) { + computeValue(); + } + return millipoints; + } + + /** + * Computes the value. + */ + protected void computeValue() { + } + + + /** + * Sets the computed value. + * @param millipoints the length in millipoints + */ + protected void setComputedValue(int millipoints) { + setComputedValue(millipoints, true); + } + + /** + * Sets the computed value. + * @param millipoints the length in millipoints + * @param bSetComputed True if the isComputed flag should be set. + */ + protected void setComputedValue(int millipoints, boolean bSetComputed) { + this.millipoints = millipoints; + this.bIsComputed = bSetComputed; + } + + /** + * Indicates if the length has the "auto" value. + * @return True if the length is set to "auto" + */ + public boolean isAuto() { + return false; + } + + /** + * Indicates if the length has been computed. + * @return True if the length has been computed + */ + public boolean isComputed() { + return this.bIsComputed; + } + + /** + * Return the number of table units which are included in this + * length specification. + * This will always be 0 unless the property specification used + * the proportional-column-width() function (only only table + * column FOs). + * <p>If this value is not 0, the actual value of the Length cannot + * be known without looking at all of the columns in the table to + * determine the value of a "table-unit". + * @return The number of table units which are included in this + * length specification. + */ + public double getTableUnits() { + return 0.0; + } + + public void resolveTableUnit(double dTableUnit) { + } + + public Numeric asNumeric() { + return null; + } + + /** + * @see java.lang.Object#toString() + */ + public String toString() { + String s = millipoints + "mpt"; + return s; + } + +} diff --git a/src/java/org/apache/fop/datatypes/package.html b/src/java/org/apache/fop/datatypes/package.html new file mode 100644 index 000000000..344344a5a --- /dev/null +++ b/src/java/org/apache/fop/datatypes/package.html @@ -0,0 +1,6 @@ +<HTML> +<TITLE>org.apache.fop.datatypes Package</TITLE> +<BODY> +<P>XSL Datatypes.</P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/src/java/org/apache/fop/fo/FONode.java b/src/java/org/apache/fop/fo/FONode.java new file mode 100644 index 000000000..aac600ba6 --- /dev/null +++ b/src/java/org/apache/fop/fo/FONode.java @@ -0,0 +1,202 @@ +/* + * $Id: FONode.java,v 1.34 2003/03/05 21:48:02 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fo; + +// Java +import java.util.ListIterator; + +// XML +import org.xml.sax.Attributes; + +// Avalon +import org.apache.avalon.framework.logger.Logger; + +// FOP +import org.apache.fop.apps.FOPException; +import org.apache.fop.util.CharUtilities; + +/** + * base class for nodes in the XML tree + * + */ +public abstract class FONode { + + /** FO User Agent for this node (for logger etc.)*/ + protected FOUserAgent userAgent; + /** Parent FO node */ + protected FONode parent; + /** Name of the node */ + protected String name; + + /** + * Main constructor. + * @param parent parent of this node + */ + protected FONode(FONode parent) { + this.parent = parent; + } + + /** + * Sets the name of the node. + * @param str the name + */ + public void setName(String str) { + name = str; + } + + /** + * Returns the logger for the node. + * @return the logger + */ + protected Logger getLogger() { + return userAgent.getLogger(); + } + + /** + * Sets the user agent for the node. + * @param ua the user agent + */ + public void setUserAgent(FOUserAgent ua) { + userAgent = ua; + } + + /** + * Returns the user agent for the node. + * @return FOUserAgent + */ + protected FOUserAgent getUserAgent() { + return userAgent; + } + + /** + * Sets the structure handler to send events to. + * @param st StructureHandler instance + */ + public void setStructHandler(StructureHandler st) { + } + + public void handleAttrs(Attributes attlist) throws FOPException { + } + + /** + * Returns the name of the object + * @return the name of this object + */ + public String getName() { + return this.name; + } + + /** + * Adds characters (does nothing here) + * @param data text + * @param start start position + * @param length length of the text + */ + protected void addCharacters(char data[], int start, int length) { + // ignore + } + + /** + * + */ + protected void start() { + // do nothing by default + } + + /** + * + */ + protected void end() { + // do nothing by default + } + + protected void addChild(FONode child) { + } + + public FONode getParent() { + return this.parent; + } + + /** + * Return an iterator over all the children of this FObj. + * @return A ListIterator. + */ + public ListIterator getChildren() { + return null; + } + + /** + * Return an iterator over the object's children starting + * at the pased node. + * @param childNode First node in the iterator + * @return A ListIterator or null if childNode isn't a child of + * this FObj. + */ + public ListIterator getChildren(FONode childNode) { + return null; + } + + public CharIterator charIterator() { + return new OneCharIterator(CharUtilities.CODE_EOT); + } + + /** + * This is a quick check to see if it is a marker. + * This is needed since there is no other quick way of checking + * for a marker and not adding to the child list. + * + * @return true if this is a marker + */ + protected boolean isMarker() { + return false; + } +} + diff --git a/src/java/org/apache/fop/fo/expr/PropertyException.java b/src/java/org/apache/fop/fo/expr/PropertyException.java new file mode 100644 index 000000000..3c9d5a795 --- /dev/null +++ b/src/java/org/apache/fop/fo/expr/PropertyException.java @@ -0,0 +1,58 @@ +/* + * $Id: PropertyException.java,v 1.4 2003/03/05 21:59:47 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fo.expr; + +public class PropertyException extends Exception { + public PropertyException(String detail) { + super(detail); + } + +} diff --git a/src/java/org/apache/fop/fo/expr/PropertyParser.java b/src/java/org/apache/fop/fo/expr/PropertyParser.java new file mode 100644 index 000000000..8fea26bc6 --- /dev/null +++ b/src/java/org/apache/fop/fo/expr/PropertyParser.java @@ -0,0 +1,499 @@ +/* + * $Id: PropertyParser.java,v 1.9 2003/03/05 21:59:47 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fo.expr; + +import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.FixedLength; +import org.apache.fop.datatypes.Length; +import org.apache.fop.datatypes.PercentBase; +import org.apache.fop.datatypes.PercentLength; +import org.apache.fop.fo.Property; +import org.apache.fop.fo.ListProperty; +import org.apache.fop.fo.LengthProperty; +import org.apache.fop.fo.NumberProperty; +import org.apache.fop.fo.StringProperty; +import org.apache.fop.fo.ColorTypeProperty; + +import java.util.HashMap; + +/** + * Class to parse XSL FO property expression. + * This class is heavily based on the epxression parser in James Clark's + * XT, an XSLT processor. + */ +public class PropertyParser extends PropertyTokenizer { + private PropertyInfo propInfo; // Maker and propertyList related info + + private static final String RELUNIT = "em"; + private static final Numeric NEGATIVE_ONE = new Numeric(new Double(-1.0)); + private static final HashMap FUNCTION_TABLE = new HashMap(); + + static { + // Initialize the HashMap of XSL-defined functions + FUNCTION_TABLE.put("ceiling", new CeilingFunction()); + FUNCTION_TABLE.put("floor", new FloorFunction()); + FUNCTION_TABLE.put("round", new RoundFunction()); + FUNCTION_TABLE.put("min", new MinFunction()); + FUNCTION_TABLE.put("max", new MaxFunction()); + FUNCTION_TABLE.put("abs", new AbsFunction()); + FUNCTION_TABLE.put("rgb", new RGBColorFunction()); + FUNCTION_TABLE.put("from-table-column", new FromTableColumnFunction()); + FUNCTION_TABLE.put("inherited-property-value", + new InheritedPropFunction()); + FUNCTION_TABLE.put("from-parent", new FromParentFunction()); + FUNCTION_TABLE.put("from-nearest-specified-value", + new NearestSpecPropFunction()); + FUNCTION_TABLE.put("proportional-column-width", + new PPColWidthFunction()); + FUNCTION_TABLE.put("label-end", new LabelEndFunction()); + FUNCTION_TABLE.put("body-start", new BodyStartFunction()); + // NOTE: used from code generated for corresponding properties + FUNCTION_TABLE.put("_fop-property-value", new FopPropValFunction()); + + /** + * * NOT YET IMPLEMENTED!!! + * FUNCTION_TABLE.put("icc-color", new ICCcolorFunction()); + * FUNCTION_TABLE.put("system-color", new SystemColorFunction()); + * FUNCTION_TABLE.put("system-font", new SystemFontFunction()); + * + * FUNCTION_TABLE.put("merge-property-values", new MergePropsFunction()); + */ + } + + + /** + * Public entrypoint to the Property expression parser. + * @param expr The specified value (attribute on the xml element). + * @param propInfo A PropertyInfo object representing the context in + * which the property expression is to be evaluated. + * @return A Property object holding the parsed result. + * @throws PropertyException If the "expr" cannot be parsed as a Property. + */ + public static Property parse(String expr, PropertyInfo propInfo) + throws PropertyException { + return new PropertyParser(expr, propInfo).parseProperty(); + } + + + /** + * Private constructor. Called by the static parse() method. + * @param propExpr The specified value (attribute on the xml element). + * @param propInfo A PropertyInfo object representing the context in + * which the property expression is to be evaluated. + */ + private PropertyParser(String propExpr, PropertyInfo pInfo) { + super(propExpr); + this.propInfo = pInfo; + } + + /** + * Parse the property expression described in the instance variables. + * Note: If the property expression String is empty, a StringProperty + * object holding an empty String is returned. + * @return A Property object holding the parsed result. + * @throws PropertyException If the "expr" cannot be parsed as a Property. + */ + private Property parseProperty() throws PropertyException { + next(); + if (currentToken == TOK_EOF) { + // if prop value is empty string, force to StringProperty + return new StringProperty(""); + } + ListProperty propList = null; + while (true) { + Property prop = parseAdditiveExpr(); + if (currentToken == TOK_EOF) { + if (propList != null) { + propList.addProperty(prop); + return propList; + } else { + return prop; + } + } else { + if (propList == null) { + propList = new ListProperty(prop); + } else { + propList.addProperty(prop); + } + } + // throw new PropertyException("unexpected token"); + } + // return prop; + } + + /** + * Try to parse an addition or subtraction expression and return the + * resulting Property. + */ + private Property parseAdditiveExpr() throws PropertyException { + // Evaluate and put result on the operand stack + Property prop = parseMultiplicativeExpr(); + loop: + while (true) { + switch (currentToken) { + case TOK_PLUS: + next(); + prop = evalAddition(prop.getNumeric(), + parseMultiplicativeExpr().getNumeric()); + break; + case TOK_MINUS: + next(); + prop = + evalSubtraction(prop.getNumeric(), + parseMultiplicativeExpr().getNumeric()); + break; + default: + break loop; + } + } + return prop; + } + + /** + * Try to parse a multiply, divide or modulo expression and return + * the resulting Property. + */ + private Property parseMultiplicativeExpr() throws PropertyException { + Property prop = parseUnaryExpr(); + loop: + while (true) { + switch (currentToken) { + case TOK_DIV: + next(); + prop = evalDivide(prop.getNumeric(), + parseUnaryExpr().getNumeric()); + break; + case TOK_MOD: + next(); + prop = evalModulo(prop.getNumber(), + parseUnaryExpr().getNumber()); + break; + case TOK_MULTIPLY: + next(); + prop = evalMultiply(prop.getNumeric(), + parseUnaryExpr().getNumeric()); + break; + default: + break loop; + } + } + return prop; + } + + /** + * Try to parse a unary minus expression and return the + * resulting Property. + */ + private Property parseUnaryExpr() throws PropertyException { + if (currentToken == TOK_MINUS) { + next(); + return evalNegate(parseUnaryExpr().getNumeric()); + } + return parsePrimaryExpr(); + } + + + /** + * Checks that the current token is a right parenthesis + * and throws an exception if this isn't the case. + */ + private final void expectRpar() throws PropertyException { + if (currentToken != TOK_RPAR) { + throw new PropertyException("expected )"); + } + next(); + } + + /** + * Try to parse a primary expression and return the + * resulting Property. + * A primary expression is either a parenthesized expression or an + * expression representing a primitive Property datatype, such as a + * string literal, an NCname, a number or a unit expression, or a + * function call expression. + */ + private Property parsePrimaryExpr() throws PropertyException { + Property prop; + switch (currentToken) { + case TOK_LPAR: + next(); + prop = parseAdditiveExpr(); + expectRpar(); + return prop; + + case TOK_LITERAL: + prop = new StringProperty(currentTokenValue); + break; + + case TOK_NCNAME: + // Interpret this in context of the property or do it later? + prop = new NCnameProperty(currentTokenValue); + break; + + case TOK_FLOAT: + prop = new NumberProperty(new Double(currentTokenValue)); + break; + + case TOK_INTEGER: + prop = new NumberProperty(new Integer(currentTokenValue)); + break; + + case TOK_PERCENT: + /* + * Get the length base value object from the Maker. If null, then + * this property can't have % values. Treat it as a real number. + */ + double pcval = new Double(currentTokenValue.substring(0, + currentTokenValue.length() - 1)).doubleValue() / 100.0; + // LengthBase lbase = this.propInfo.getPercentLengthBase(); + PercentBase pcBase = this.propInfo.getPercentBase(); + if (pcBase != null) { + if (pcBase.getDimension() == 0) { + prop = new NumberProperty(pcval * pcBase.getBaseValue()); + } else if (pcBase.getDimension() == 1) { + prop = new LengthProperty(new PercentLength(pcval, + pcBase)); + } else { + throw new PropertyException("Illegal percent dimension value"); + } + } else { + // WARNING? Interpret as a decimal fraction, eg. 50% = .5 + prop = new NumberProperty(pcval); + } + break; + + case TOK_NUMERIC: + // A number plus a valid unit name. + int numLen = currentTokenValue.length() - currentUnitLength; + String unitPart = currentTokenValue.substring(numLen); + Double numPart = new Double(currentTokenValue.substring(0, + numLen)); + Length length = null; + if (unitPart.equals(RELUNIT)) { + length = new FixedLength(numPart.doubleValue(), + propInfo.currentFontSize()); + } else { + length = new FixedLength(numPart.doubleValue(), unitPart); + } + if (length == null) { + throw new PropertyException("unrecognized unit name: " + + currentTokenValue); + } else { + prop = new LengthProperty(length); + } + break; + + case TOK_COLORSPEC: + prop = new ColorTypeProperty(new ColorType(currentTokenValue)); + break; + + case TOK_FUNCTION_LPAR: { + Function function = + (Function)FUNCTION_TABLE.get(currentTokenValue); + if (function == null) { + throw new PropertyException("no such function: " + + currentTokenValue); + } + next(); + // Push new function (for function context: getPercentBase()) + propInfo.pushFunction(function); + prop = function.eval(parseArgs(function.nbArgs()), propInfo); + propInfo.popFunction(); + return prop; + } + default: + throw new PropertyException("syntax error"); + } + next(); + return prop; + } + + /** + * Parse a comma separated list of function arguments. Each argument + * may itself be an expression. This method consumes the closing right + * parenthesis of the argument list. + * @param nbArgs The number of arguments expected by the function. + * @return An array of Property objects representing the arguments + * found. + * @throws PropertyException If the number of arguments found isn't equal + * to the number expected. + */ + Property[] parseArgs(int nbArgs) throws PropertyException { + Property[] args = new Property[nbArgs]; + Property prop; + int i = 0; + if (currentToken == TOK_RPAR) { + // No args: func() + next(); + } else { + while (true) { + + prop = parseAdditiveExpr(); + if (i < nbArgs) { + args[i++] = prop; + } + // ignore extra args + if (currentToken != TOK_COMMA) { + break; + } + next(); + } + expectRpar(); + } + if (nbArgs != i) { + throw new PropertyException("Wrong number of args for function"); + } + return args; + } + + + /** + * Evaluate an addition operation. If either of the arguments is null, + * this means that it wasn't convertible to a Numeric value. + * @param op1 A Numeric object (Number or Length-type object) + * @param op2 A Numeric object (Number or Length-type object) + * @return A new NumericProperty object holding an object which represents + * the sum of the two operands. + * @throws PropertyException If either operand is null. + */ + private Property evalAddition(Numeric op1, + Numeric op2) throws PropertyException { + if (op1 == null || op2 == null) { + throw new PropertyException("Non numeric operand in addition"); + } + return new NumericProperty(op1.add(op2)); + } + + /** + * Evaluate a subtraction operation. If either of the arguments is null, + * this means that it wasn't convertible to a Numeric value. + * @param op1 A Numeric object (Number or Length-type object) + * @param op2 A Numeric object (Number or Length-type object) + * @return A new NumericProperty object holding an object which represents + * the difference of the two operands. + * @throws PropertyException If either operand is null. + */ + private Property evalSubtraction(Numeric op1, + Numeric op2) throws PropertyException { + if (op1 == null || op2 == null) { + throw new PropertyException("Non numeric operand in subtraction"); + } + return new NumericProperty(op1.subtract(op2)); + } + + /** + * Evaluate a unary minus operation. If the argument is null, + * this means that it wasn't convertible to a Numeric value. + * @param op A Numeric object (Number or Length-type object) + * @return A new NumericProperty object holding an object which represents + * the negative of the operand (multiplication by *1). + * @throws PropertyException If the operand is null. + */ + private Property evalNegate(Numeric op) throws PropertyException { + if (op == null) { + throw new PropertyException("Non numeric operand to unary minus"); + } + return new NumericProperty(op.multiply(NEGATIVE_ONE)); + } + + /** + * Evaluate a multiplication operation. If either of the arguments is null, + * this means that it wasn't convertible to a Numeric value. + * @param op1 A Numeric object (Number or Length-type object) + * @param op2 A Numeric object (Number or Length-type object) + * @return A new NumericProperty object holding an object which represents + * the product of the two operands. + * @throws PropertyException If either operand is null. + */ + private Property evalMultiply(Numeric op1, + Numeric op2) throws PropertyException { + if (op1 == null || op2 == null) { + throw new PropertyException("Non numeric operand in multiplication"); + } + return new NumericProperty(op1.multiply(op2)); + } + + + /** + * Evaluate a division operation. If either of the arguments is null, + * this means that it wasn't convertible to a Numeric value. + * @param op1 A Numeric object (Number or Length-type object) + * @param op2 A Numeric object (Number or Length-type object) + * @return A new NumericProperty object holding an object which represents + * op1 divided by op2. + * @throws PropertyException If either operand is null. + */ + private Property evalDivide(Numeric op1, + Numeric op2) throws PropertyException { + if (op1 == null || op2 == null) { + throw new PropertyException("Non numeric operand in division"); + } + return new NumericProperty(op1.divide(op2)); + } + + /** + * Evaluate a modulo operation. If either of the arguments is null, + * this means that it wasn't convertible to a Number value. + * @param op1 A Number object + * @param op2 A Number object + * @return A new NumberProperty object holding an object which represents + * op1 mod op2. + * @throws PropertyException If either operand is null. + */ + private Property evalModulo(Number op1, + Number op2) throws PropertyException { + if (op1 == null || op2 == null) { + throw new PropertyException("Non number operand to modulo"); + } + return new NumberProperty(op1.doubleValue() % op2.doubleValue()); + } + +} diff --git a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java new file mode 100644 index 000000000..4a29973c3 --- /dev/null +++ b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java @@ -0,0 +1,394 @@ +/* + * $Id: PropertyTokenizer.java,v 1.6 2003/03/05 21:59:47 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fo.expr; + + + +/** + * Class to tokenize XSL FO property expression. + * This class is heavily based on the epxression tokenizer in James Clark's + * XT, an XSLT processor. + */ +class PropertyTokenizer { + + static final int TOK_EOF = 0; + static final int TOK_NCNAME = TOK_EOF + 1; + static final int TOK_MULTIPLY = TOK_NCNAME + 1; + static final int TOK_LPAR = TOK_MULTIPLY + 1; + static final int TOK_RPAR = TOK_LPAR + 1; + static final int TOK_LITERAL = TOK_RPAR + 1; + static final int TOK_NUMBER = TOK_LITERAL + 1; + static final int TOK_FUNCTION_LPAR = TOK_NUMBER + 1; + static final int TOK_PLUS = TOK_FUNCTION_LPAR + 1; + static final int TOK_MINUS = TOK_PLUS + 1; + static final int TOK_MOD = TOK_MINUS + 1; + static final int TOK_DIV = TOK_MOD + 1; + static final int TOK_NUMERIC = TOK_DIV + 1; + static final int TOK_COMMA = TOK_NUMERIC + 1; + static final int TOK_PERCENT = TOK_COMMA + 1; + static final int TOK_COLORSPEC = TOK_PERCENT + 1; + static final int TOK_FLOAT = TOK_COLORSPEC + 1; + static final int TOK_INTEGER = TOK_FLOAT + 1; + + protected int currentToken = TOK_EOF; + protected String currentTokenValue = null; + protected int currentUnitLength = 0; + + private int currentTokenStartIndex = 0; + private /* final */ String expr; + private int exprIndex = 0; + private int exprLength; + private boolean recognizeOperator = false; + + + /** + * Construct a new PropertyTokenizer object to tokenize the passed + * String. + * @param s The Property expressio to tokenize. + */ + PropertyTokenizer(String s) { + this.expr = s; + this.exprLength = s.length(); + } + + /** + * Return the next token in the expression string. + * This sets the following package visible variables: + * currentToken An enumerated value identifying the recognized token + * currentTokenValue A String containing the token contents + * currentUnitLength If currentToken = TOK_NUMERIC, the number of + * characters in the unit name. + * @throws PropertyException If un unrecognized token is encountered. + */ + void next() throws PropertyException { + currentTokenValue = null; + currentTokenStartIndex = exprIndex; + boolean currentMaybeOperator = recognizeOperator; + boolean bSawDecimal; + recognizeOperator = true; + for (; ;) { + if (exprIndex >= exprLength) { + currentToken = TOK_EOF; + return; + } + char c = expr.charAt(exprIndex++); + switch (c) { + case ' ': + case '\t': + case '\r': + case '\n': + currentTokenStartIndex = exprIndex; + break; + case ',': + recognizeOperator = false; + currentToken = TOK_COMMA; + return; + case '+': + recognizeOperator = false; + currentToken = TOK_PLUS; + return; + case '-': + recognizeOperator = false; + currentToken = TOK_MINUS; + return; + case '(': + currentToken = TOK_LPAR; + recognizeOperator = false; + return; + case ')': + currentToken = TOK_RPAR; + return; + case '"': + case '\'': + exprIndex = expr.indexOf(c, exprIndex); + if (exprIndex < 0) { + exprIndex = currentTokenStartIndex + 1; + throw new PropertyException("missing quote"); + } + currentTokenValue = expr.substring(currentTokenStartIndex + + 1, exprIndex++); + currentToken = TOK_LITERAL; + return; + case '*': + /* + * if (currentMaybeOperator) { + * recognizeOperator = false; + */ + currentToken = TOK_MULTIPLY; + /* + * } + * else + * throw new PropertyException("illegal operator *"); + */ + return; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + scanDigits(); + if (exprIndex < exprLength && expr.charAt(exprIndex) == '.') { + exprIndex++; + bSawDecimal = true; + if (exprIndex < exprLength + && isDigit(expr.charAt(exprIndex))) { + exprIndex++; + scanDigits(); + } + } else { + bSawDecimal = false; + } + if (exprIndex < exprLength && expr.charAt(exprIndex) == '%') { + exprIndex++; + currentToken = TOK_PERCENT; + } else { + // Check for possible unit name following number + currentUnitLength = exprIndex; + scanName(); + currentUnitLength = exprIndex - currentUnitLength; + currentToken = (currentUnitLength > 0) ? TOK_NUMERIC + : (bSawDecimal ? TOK_FLOAT : TOK_INTEGER); + } + currentTokenValue = expr.substring(currentTokenStartIndex, + exprIndex); + return; + + case '.': + if (exprIndex < exprLength + && isDigit(expr.charAt(exprIndex))) { + ++exprIndex; + scanDigits(); + if (exprIndex < exprLength + && expr.charAt(exprIndex) == '%') { + exprIndex++; + currentToken = TOK_PERCENT; + } else { + // Check for possible unit name following number + currentUnitLength = exprIndex; + scanName(); + currentUnitLength = exprIndex - currentUnitLength; + currentToken = (currentUnitLength > 0) ? TOK_NUMERIC + : TOK_FLOAT; + } + currentTokenValue = expr.substring(currentTokenStartIndex, + exprIndex); + return; + } + throw new PropertyException("illegal character '.'"); + + case '#': // Start of color value + if (exprIndex < exprLength + && isHexDigit(expr.charAt(exprIndex))) { + ++exprIndex; + scanHexDigits(); + currentToken = TOK_COLORSPEC; + currentTokenValue = expr.substring(currentTokenStartIndex, + exprIndex); + // Probably should have some multiple of 3 for length! + return; + } else { + throw new PropertyException("illegal character '#'"); + } + + default: + --exprIndex; + scanName(); + if (exprIndex == currentTokenStartIndex) { + throw new PropertyException("illegal character"); + } + currentTokenValue = expr.substring(currentTokenStartIndex, + exprIndex); + // if (currentMaybeOperator) { + if (currentTokenValue.equals("mod")) { + currentToken = TOK_MOD; + return; + } else if (currentTokenValue.equals("div")) { + currentToken = TOK_DIV; + return; + } + /* + * else + * throw new PropertyException("unrecognized operator name"); + * recognizeOperator = false; + * return; + * } + */ + if (followingParen()) { + currentToken = TOK_FUNCTION_LPAR; + recognizeOperator = false; + } else { + currentToken = TOK_NCNAME; + recognizeOperator = false; + } + return; + } + } + } + + /** + * Attempt to recognize a valid NAME token in the input expression. + */ + private void scanName() { + if (exprIndex < exprLength && isNameStartChar(expr.charAt(exprIndex))) { + while (++exprIndex < exprLength + && isNameChar(expr.charAt(exprIndex))) { } + } + } + + /** + * Attempt to recognize a valid sequence of decimal DIGITS in the + * input expression. + */ + private void scanDigits() { + while (exprIndex < exprLength && isDigit(expr.charAt(exprIndex))) { + exprIndex++; + } + } + + /** + * Attempt to recognize a valid sequence of hexadecimal DIGITS in the + * input expression. + */ + private void scanHexDigits() { + while (exprIndex < exprLength && isHexDigit(expr.charAt(exprIndex))) { + exprIndex++; + } + } + + /** + * Return a boolean value indicating whether the following non-whitespace + * character is an opening parenthesis. + */ + private boolean followingParen() { + for (int i = exprIndex; i < exprLength; i++) { + switch (expr.charAt(i)) { + case '(': + exprIndex = i + 1; + return true; + case ' ': + case '\r': + case '\n': + case '\t': + break; + default: + return false; + } + } + return false; + } + + + private static final String NAME_START_CHARS = + "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + private static final String NAME_CHARS = ".-0123456789"; + private static final String DIGITS = "0123456789"; + private static final String HEX_CHARS = DIGITS + "abcdefABCDEF"; + + /** + * Return a boolean value indicating whether the argument is a + * decimal digit (0-9). + * @param c The character to check + */ + private static final boolean isDigit(char c) { + return DIGITS.indexOf(c) >= 0; + } + + /** + * Return a boolean value indicating whether the argument is a + * hexadecimal digit (0-9, A-F, a-f). + * @param c The character to check + */ + private static final boolean isHexDigit(char c) { + return HEX_CHARS.indexOf(c) >= 0; + } + + /** + * Return a boolean value indicating whether the argument is whitespace + * as defined by XSL (space, newline, CR, tab). + * @param c The character to check + */ + private static final boolean isSpace(char c) { + switch (c) { + case ' ': + case '\r': + case '\n': + case '\t': + return true; + } + return false; + } + + /** + * Return a boolean value indicating whether the argument is a valid name + * start character, ie. can start a NAME as defined by XSL. + * @param c The character to check + */ + private static final boolean isNameStartChar(char c) { + return NAME_START_CHARS.indexOf(c) >= 0 || c >= 0x80; + } + + /** + * Return a boolean value indicating whether the argument is a valid name + * character, ie. can occur in a NAME as defined by XSL. + * @param c The character to check + */ + private static final boolean isNameChar(char c) { + return NAME_START_CHARS.indexOf(c) >= 0 || NAME_CHARS.indexOf(c) >= 0 + || c >= 0x80; + } + +} + diff --git a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java new file mode 100644 index 000000000..55706f2b1 --- /dev/null +++ b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java @@ -0,0 +1,208 @@ +/* + * $Id: PageNumberGenerator.java,v 1.8 2003/03/06 13:42:42 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fo.pagination; + +// Avalon +import org.apache.avalon.framework.logger.AbstractLogEnabled; + +/** + * This class uses the 'format', 'groupingSeparator', 'groupingSize', + * and 'letterValue' properties on fo:page-sequence to return a String + * corresponding to the supplied integer page number. + */ +public class PageNumberGenerator extends AbstractLogEnabled { + + private String format; + private char groupingSeparator; + private int groupingSize; + private int letterValue; + + // constants + private static final int DECIMAL = 1; // '0*1' + private static final int LOWERALPHA = 2; // 'a' + private static final int UPPERALPHA = 3; // 'A' + private static final int LOWERROMAN = 4; // 'i' + private static final int UPPERROMAN = 5; // 'I' + + // flags + private int formatType = DECIMAL; + private int minPadding = 0; // for decimal formats + + // preloaded strings of zeros + private String zeros[] = { + "", "0", "00", "000", "0000", "00000" + }; + + /** + * Main constructor. For further information on the parameters see the XSLT + * specs (Number to String Conversion Attributes). + * @param format format for the page number + * @param groupingSeparator grouping separator + * @param groupingSize grouping size + * @param letterValue letter value + */ + public PageNumberGenerator(String format, char groupingSeparator, + int groupingSize, int letterValue) { + this.format = format; + this.groupingSeparator = groupingSeparator; + this.groupingSize = groupingSize; + this.letterValue = letterValue; + + // the only accepted format strings are currently '0*1' 'a', 'A', 'i' + // and 'I' + int fmtLen = format.length(); + if (fmtLen == 1) { + if (format.equals("1")) { + formatType = DECIMAL; + minPadding = 0; + } else if (format.equals("a")) { + formatType = LOWERALPHA; + } else if (format.equals("A")) { + formatType = UPPERALPHA; + } else if (format.equals("i")) { + formatType = LOWERROMAN; + } else if (format.equals("I")) { + formatType = UPPERROMAN; + } else { + // token not handled + //getLogger().debug("'format' token not recognized; using '1'"); + formatType = DECIMAL; + minPadding = 0; + } + } else { + // only accepted token is '0+1'at this stage. Because of the + // wonderful regular expression support in Java, we will resort to a + // loop + for (int i = 0; i < fmtLen - 1; i++) { + if (format.charAt(i) != '0') { + //getLogger().debug("'format' token not recognized; using '1'"); + formatType = DECIMAL; + minPadding = 0; + } else { + minPadding = fmtLen - 1; + } + } + } + } + + /** + * Formats a page number. + * @param number page number to format + * @return the formatted page number as a String + */ + public String makeFormattedPageNumber(int number) { + String pn = null; + if (formatType == DECIMAL) { + pn = Integer.toString(number); + if (minPadding >= pn.length()) { + int nz = minPadding - pn.length() + 1; + pn = zeros[nz] + pn; + } + } else if ((formatType == LOWERROMAN) || (formatType == UPPERROMAN)) { + pn = makeRoman(number); + if (formatType == UPPERROMAN) { + pn = pn.toUpperCase(); + } + } else { + // alphabetic + pn = makeAlpha(number); + if (formatType == UPPERALPHA) { + pn = pn.toUpperCase(); + } + } + return pn; + } + + private String makeRoman(int num) { + int arabic[] = { + 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 + }; + String roman[] = { + "m", "cm", "d", "cd", "c", "xc", "l", "xl", "x", "ix", "v", "iv", + "i" + }; + + int i = 0; + StringBuffer romanNumber = new StringBuffer(); + + while (num > 0) { + while (num >= arabic[i]) { + num = num - arabic[i]; + romanNumber.append(roman[i]); + } + i = i + 1; + } + return romanNumber.toString(); + } + + private String makeAlpha(int num) { + String letters = "abcdefghijklmnopqrstuvwxyz"; + StringBuffer alphaNumber = new StringBuffer(); + + int base = 26; + int rem = 0; + + num--; + if (num < base) { + alphaNumber.append(letters.charAt(num)); + } else { + while (num >= base) { + rem = num % base; + alphaNumber.append(letters.charAt(rem)); + num = num / base; + } + alphaNumber.append(letters.charAt(num - 1)); + } + return alphaNumber.reverse().toString(); + } + +} + diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java new file mode 100644 index 000000000..86624ef1f --- /dev/null +++ b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java @@ -0,0 +1,200 @@ +/* + * $Id: PageSequenceMaster.java,v 1.13 2003/03/06 13:42:42 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fo.pagination; + +// Java +import java.util.List; + +// SAX +import org.xml.sax.Attributes; + +// FOP +import org.apache.fop.fo.FONode; +import org.apache.fop.fo.FObj; +import org.apache.fop.apps.FOPException; + +/** + * The page-sequence-master formatting object. + * This class handles a list of subsequence specifiers + * which are simple or complex references to page-masters. + */ +public class PageSequenceMaster extends FObj { + + private LayoutMasterSet layoutMasterSet; + private List subSequenceSpecifiers; + private SubSequenceSpecifier currentSubSequence; + private int currentSubSequenceNumber; + private String masterName; + + // The terminology may be confusing. A 'page-sequence-master' consists + // of a sequence of what the XSL spec refers to as + // 'sub-sequence-specifiers'. These are, in fact, simple or complex + // references to page-masters. So the methods use the former + // terminology ('sub-sequence-specifiers', or SSS), + // but the actual FO's are MasterReferences. + + /** + * @see org.apache.fop.fo.FONode#FONode(FONode) + */ + public PageSequenceMaster(FONode parent) { + super(parent); + } + + /** + * @see org.apache.fop.fo.FONode#handleAttrs(Attributes) + */ + public void handleAttrs(Attributes attlist) throws FOPException { + super.handleAttrs(attlist); + + subSequenceSpecifiers = new java.util.ArrayList(); + + if (parent.getName().equals("fo:layout-master-set")) { + this.layoutMasterSet = (LayoutMasterSet)parent; + String pm = this.properties.get("master-name").getString(); + if (pm == null) { + getLogger().warn("page-sequence-master does not have " + + "a master-name and so is being ignored"); + } else { + this.layoutMasterSet.addPageSequenceMaster(pm, this); + } + } else { + throw new FOPException("fo:page-sequence-master must be child " + + "of fo:layout-master-set, not " + + parent.getName()); + } + } + + /** + * Adds a new suqsequence specifier to the page sequence master. + * @param pageMasterReference the subsequence to add + */ + protected void addSubsequenceSpecifier(SubSequenceSpecifier pageMasterReference) { + subSequenceSpecifiers.add(pageMasterReference); + } + + /** + * Returns the next subsequence specifier + * @return a subsequence specifier + */ + private SubSequenceSpecifier getNextSubSequence() { + currentSubSequenceNumber++; + if (currentSubSequenceNumber >= 0 + && currentSubSequenceNumber < subSequenceSpecifiers.size()) { + return (SubSequenceSpecifier)subSequenceSpecifiers + .get(currentSubSequenceNumber); + } + return null; + } + + /** + * Resets the subsequence specifiers subsystem. + */ + public void reset() { + currentSubSequenceNumber = -1; + currentSubSequence = null; + for (int i = 0; i < subSequenceSpecifiers.size(); i++) { + ((SubSequenceSpecifier)subSequenceSpecifiers.get(i)).reset(); + } + } + + /** + * Returns the next simple-page-master. + * @param isOddPage True if the next page number is odd + * @param isFirstPage True if the next page is the first + * @param isBlankPage True if the next page is blank + * @return the requested page master + * @throws FOPException if there's a problem determining the next page master + */ + public SimplePageMaster getNextSimplePageMaster(boolean isOddPage, + boolean isFirstPage, + boolean isBlankPage) + throws FOPException { + if (currentSubSequence == null) { + currentSubSequence = getNextSubSequence(); + if (currentSubSequence == null) { + throw new FOPException("no subsequences in page-sequence-master '" + + masterName + "'"); + } + } + String pageMasterName = currentSubSequence + .getNextPageMasterName(isOddPage, isFirstPage, isBlankPage); + boolean canRecover = true; + while (pageMasterName == null) { + SubSequenceSpecifier nextSubSequence = getNextSubSequence(); + if (nextSubSequence == null) { + if (!canRecover) { + throw new FOPException("subsequences exhausted in page-sequence-master '" + + masterName + + "', cannot recover"); + } + getLogger().warn("subsequences exhausted in page-sequence-master '" + + masterName + + "', use previous subsequence"); + currentSubSequence.reset(); + canRecover = false; + } else { + currentSubSequence = nextSubSequence; + } + pageMasterName = currentSubSequence + .getNextPageMasterName(isOddPage, isFirstPage, isBlankPage); + } + SimplePageMaster pageMaster = this.layoutMasterSet + .getSimplePageMaster(pageMasterName); + if (pageMaster == null) { + throw new FOPException("No simple-page-master matching '" + + pageMasterName + "' in page-sequence-master '" + + masterName + "'"); + } + return pageMaster; + } + +} + diff --git a/src/java/org/apache/fop/fonts/Font.java b/src/java/org/apache/fop/fonts/Font.java new file mode 100644 index 000000000..3d0b2ed0f --- /dev/null +++ b/src/java/org/apache/fop/fonts/Font.java @@ -0,0 +1,83 @@ +/* + * $Id: Font.java,v 1.2 2003/03/06 17:43:05 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fonts; + +// FOP + + +/** + * Base class for PDF font classes + */ +public abstract class Font implements FontMetrics { + + /** + * Get the encoding of the font. + * @return the encoding + */ + public abstract String getEncoding(); + + /** + * Map a Unicode character to a code point in the font. + * @param c character to map + * @return the mapped character + */ + public abstract char mapChar(char c); + + /** + * Determines whether the font is a multibyte font. + * @return True if it is multibyte + */ + public boolean isMultiByte() { + return false; + } + +} + diff --git a/src/java/org/apache/fop/fonts/FontDescriptor.java b/src/java/org/apache/fop/fonts/FontDescriptor.java new file mode 100644 index 000000000..6bee29648 --- /dev/null +++ b/src/java/org/apache/fop/fonts/FontDescriptor.java @@ -0,0 +1,116 @@ +/* + * $Id: FontDescriptor.java,v 1.2 2003/03/06 17:43:05 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fonts; + +/** + * This interface enhances the font metrics interface with access methods to + * value needed to register fonts in various target formats like PDF or + * PostScript. + */ +public interface FontDescriptor extends FontMetrics { + + /** + * Returns the ascender value of the font. (Ascent in pdf spec) + * @return the ascender + */ + int getAscender(); + + + /** + * Returns the capital height of the font. + * @return the capiptal height + */ + int getCapHeight(); + + + /** + * Returns the descender value of the font. (Descent in pdf spec) + * @return the descender value + */ + int getDescender(); + + + /** + * Returns the flags for the font. (See pdf spec) + * @return the flags + */ + int getFlags(); + + + /** + * Returns the font's bounding box. + * @return the bounding box + */ + int[] getFontBBox(); + + + /** + * Returns the italic angle for the font. + * @return the italic angle + */ + int getItalicAngle(); + + + /** + * Returns the vertical stem width for the font. + * @return the vertical stem width + */ + int getStemV(); + + + /** + * Indicates if this font may be embedded. + * @return True, if embedding is possible/permitted + */ + boolean isEmbeddable(); + + +} diff --git a/src/java/org/apache/fop/fonts/FontMetrics.java b/src/java/org/apache/fop/fonts/FontMetrics.java new file mode 100644 index 000000000..7fa3d2135 --- /dev/null +++ b/src/java/org/apache/fop/fonts/FontMetrics.java @@ -0,0 +1,138 @@ +/* + * $Id: FontMetrics.java,v 1.2 2003/03/06 17:43:05 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fonts; + +import java.util.Map; + + +/** + * Main interface for access to font metrics. + */ +public interface FontMetrics { + + /** + * Returns the font name. + * @return the font name + */ + String getFontName(); + + + /** + * Returns the type of the font. + * @return the font type + */ + FontType getFontType(); + + + /** + * Returns the ascent of the font described by this + * FontMetrics object. + * @param size font size + * @return ascent in milliponts + */ + int getAscender(int size); + + /** + * Returns the size of a capital letter measured from the font's baseline. + * @param size font size + * @return height of capital characters + */ + int getCapHeight(int size); + + + /** + * Returns the descent of the font described by this + * FontMetrics object. + * @param size font size + * @return descent in milliponts + */ + int getDescender(int size); + + + /** + * Determines the typical font height of this + * FontMetrics object + * @param size font size + * @return font height in millipoints + */ + int getXHeight(int size); + + /** + * Return the width (in 1/1000ths of point size) of the character at + * code point i. + * @param i code point index + * @param size font size + * @return the width of the character + */ + int getWidth(int i, int size); + + /** + * Return the array of widths. + * <p> + * This is used to get an array for inserting in an output format. + * It should not be used for lookup. + * @return an array of widths + */ + int[] getWidths(); + + /** + * Indicates if the font has kering information. + * @return True, if kerning is available. + */ + boolean hasKerningInfo(); + + /** + * Returns the kerning map for the font. + * @return the kerning map + */ + Map getKerningInfo(); + +} diff --git a/src/java/org/apache/fop/fonts/FontType.java b/src/java/org/apache/fop/fonts/FontType.java new file mode 100644 index 000000000..99334cf08 --- /dev/null +++ b/src/java/org/apache/fop/fonts/FontType.java @@ -0,0 +1,141 @@ +/* + * $Id: FontType.java,v 1.2 2003/03/06 17:43:05 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fonts; + +import org.apache.avalon.framework.ValuedEnum; + +/** + * This class enumerates all supported font types. + */ +public class FontType extends ValuedEnum { + + /** + * Collective identifier for "other" font types + */ + public static final FontType OTHER = new FontType("Other", 0); + /** + * Adobe Type 0 fonts + */ + public static final FontType TYPE0 = new FontType("Type0", 1); + /** + * Adobe Type 1 fonts + */ + public static final FontType TYPE1 = new FontType("Type1", 2); + /** + * Adobe Multiple Master Type 1 fonts + */ + public static final FontType MMTYPE1 = new FontType("MMType1", 3); + /** + * Adobe Type 3 fonts ("user-defined" fonts) + */ + public static final FontType TYPE3 = new FontType("Type3", 4); + /** + * TrueType fonts + */ + public static final FontType TRUETYPE = new FontType("TrueType", 5); + + + /** + * @see org.apache.avalon.framework.Enum#Enum(String) + */ + protected FontType(String name, int value) { + super(name, value); + } + + + /** + * Returns the FontType by name. + * @param name Name of the font type to look up + * @return the font type + */ + public static FontType byName(String name) { + if (name.equalsIgnoreCase(FontType.OTHER.getName())) { + return FontType.OTHER; + } else if (name.equalsIgnoreCase(FontType.TYPE0.getName())) { + return FontType.TYPE0; + } else if (name.equalsIgnoreCase(FontType.TYPE1.getName())) { + return FontType.TYPE1; + } else if (name.equalsIgnoreCase(FontType.MMTYPE1.getName())) { + return FontType.MMTYPE1; + } else if (name.equalsIgnoreCase(FontType.TYPE3.getName())) { + return FontType.TYPE3; + } else if (name.equalsIgnoreCase(FontType.TRUETYPE.getName())) { + return FontType.TRUETYPE; + } else { + throw new IllegalArgumentException("Invalid font type: " + name); + } + } + + + /** + * Returns the FontType by value. + * @param value Value of the font type to look up + * @return the font type + */ + public static FontType byValue(int value) { + if (value == FontType.OTHER.getValue()) { + return FontType.OTHER; + } else if (value == FontType.TYPE0.getValue()) { + return FontType.TYPE0; + } else if (value == FontType.TYPE1.getValue()) { + return FontType.TYPE1; + } else if (value == FontType.MMTYPE1.getValue()) { + return FontType.MMTYPE1; + } else if (value == FontType.TYPE3.getValue()) { + return FontType.TYPE3; + } else if (value == FontType.TRUETYPE.getValue()) { + return FontType.TRUETYPE; + } else { + throw new IllegalArgumentException("Invalid font type: " + value); + } + } + +} diff --git a/src/java/org/apache/fop/fonts/Glyphs.java b/src/java/org/apache/fop/fonts/Glyphs.java new file mode 100644 index 000000000..f7ff6f80f --- /dev/null +++ b/src/java/org/apache/fop/fonts/Glyphs.java @@ -0,0 +1,1345 @@ +/* + * $Id: Glyphs.java,v 1.10 2003/03/06 17:43:05 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.fonts; + +/** + * This class provides a number of constants for glyph management. + */ +public class Glyphs { + + /** + * Glyph name for the "notdef" glyph + */ + public static final String NOTDEF = ".notdef"; + + /** + * Glyph names for Mac encoding + */ + public static final String MAC_GLYPH_NAMES[] = { + /* 0x00 */ + NOTDEF, ".null", "CR", "space", "exclam", "quotedbl", "numbersign", + "dollar", "percent", "ampersand", "quotesingle", "parenleft", + "parenright", "asterisk", "plus", "comma", /* 0x10 */ + "hyphen", "period", "slash", "zero", "one", "two", "three", "four", + "five", "six", "seven", "eight", "nine", "colon", + "semicolon", "less", /* 0x20 */ + "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", + "G", "H", "I", "J", "K", "L", /* 0x30 */ + "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", + "bracketleft", "backslash", /* 0x40 */ + "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", + "d", "e", "f", "g", "h", "i", "j", "k", "l", + /* 0x50 */ + "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "braceleft", "bar", /* 0x60 */ + "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", + "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", + "agrave", "acircumflex", "adieresis", "atilde", + "aring", "ccedilla", /* 0x70 */ + "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", + "icircumflex", "idieresis", "ntilde", "oacute", "ograve", + "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", + /* 0x80 */ + "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", + "section", "bullet", "paragraph", "germandbls", + "registered", "copyright", "trademark", "acute", + "dieresis", "notequal", /* 0x90 */ + "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", + "yen", "mu", "partialdiff", "Sigma", "Pi", "pi", "integral", + "ordfeminine", "ordmasculine", "Omega", /* 0xa0 */ + "ae", "oslash", "questiondown", "exclamdown", "logicalnot", + "radical", "florin", "approxequal", "Delta", "guillemotleft", + "guillemotright", "ellipsis", "nbspace", "Agrave", "Atilde", + "Otilde", /* 0xb0 */ + "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", + "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", + "Ydieresis", "fraction", "currency", "guilsinglleft", + "guilsinglright", /* 0xc0 */ + "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", + "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", + "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", + "Idieresis", "Igrave", /* 0xd0 */ + "Oacute", "Ocircumflex", "applelogo", "Ograve", "Uacute", + "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", + "macron", "breve", "dotaccent", "ring", "cedilla", + "hungarumlaut", /* 0xe0 */ + "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", + "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", + "Thorn", "thorn", "minus", /* 0xf0 */ + "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", + "onequarter", "threequarters", "franc", "Gbreve", + "gbreve", "Idot", "Scedilla", "scedilla", "Cacute", + "cacute", "Ccaron", /* 0x100 */ + "ccaron", "dmacron" + }; + + /** + * Glyph names for tex8r encoding + */ + public static final String[] TEX8R_GLYPH_NAMES = { + // 0x00 + NOTDEF, "dotaccent", "fi", "fl", "fraction", "hungarumlaut", + "Lslash", "lslash", "ogonek", "ring", ".notdef", "breve", + "minus", ".notdef", "Zcaron", "zcaron", // 0x10 + "caron", "dotlessi", "dotlessj", "ff", "ffi", "ffl", ".notdef", + ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", + ".notdef", ".notdef", "grave", "quotesingle", // 0x20 + "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", + "ampersand", "quoteright", "parenleft", "parenright", + "asterisk", "plus", "comma", "hyphen", "period", "slash", + // 0x30 + "zero", "one", "two", "three", "four", "five", "six", "seven", + "eight", "nine", "colon", "semicolon", "less", "equal", + "greater", "question", // 0x40 + "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", + "M", "N", "O", // 0x50 + "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", + "backslash", "bracketright", "asciicircum", "underscore", // 0x60 + "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", + "l", "m", "n", "o", // 0x70 + "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", + "bar", "braceright", "asciitilde", ".notdef", // 0x80 + "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", + "ellipsis", "dagger", "daggerdbl", "circumflex", + "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", + ".notdef", ".notdef", // 0x90 + ".notdef", ".notdef", ".notdef", "quotedblleft", "quotedblright", + "bullet", "endash", "emdash", "tilde", "trademark", + "scaron", "guilsinglright", "oe", ".notdef", ".notdef", + "Ydieresis", // 0xA0 + ".notdef", "exclamdown", "cent", "sterling", "currency", "yen", + "brokenbar", "section", "dieresis", "copyright", + "ordfeminine", "guillemotleft", "logicalnot", "hyphen", + "registered", "macron", // 0xB0 + "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", + "paragraph", "periodcentered", "cedilla", "onesuperior", + "ordmasculine", "guillemotright", "onequarter", "onehalf", + "threequarters", "questiondown", // 0xC0 + "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", + "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", + "Edieresis", "Igrave", "Iacute", "Icircumflex", + "Idieresis", // 0xD0 + "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", + "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", + "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", + // 0xE0 + "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", + "ae", "ccedilla", "egrave", "eacute", "ecircumflex", + "edieresis", "igrave", "iacute", "icircumflex", + "idieresis", // 0xF0 + "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", + "odieresis", "divide", "oslash", "ugrave", "uacute", + "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis" + }; + + /** + * The characters in WinAnsiEncoding + */ + public static final char[] WINANSI_ENCODING = { + // not used until char 32 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x20 + ' ', '\u0021', '\"', '\u0023', '$', '%', '&', '\'', '(', ')', '*', '+', ',', + '\u002d', '\u002e', '/', // 0x30 + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', + '>', '?', '@', // 0x40 + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', // 0x50 + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u005b', '\\', + '\u005d', '^', '_', // 0x60 + '\u2018', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', // 0x70 + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\u007b', '\u007c', '\u007d', + '\u007e', '\u2022', // 0x80 + '\u20ac', '\u2022', '\u201a', '\u0192', '\u201e', '\u2026', '\u2020', + '\u2021', '\u02c6', '\u2030', '\u0160', '\u2039', '\u0152', '\u2022', + '\u017d', '\u2022', // 0x90 + '\u2022', '\u2018', // quoteleft + '\u2019', // quoteright + '\u201c', // quotedblleft + '\u201d', // quotedblright + '\u2022', // bullet + '\u2013', // endash + '\u2014', // emdash + '~', + '\u2122', // trademark + '\u0161', '\u203a', '\u0153', '\u2022', '\u017e', '\u0178', // 0xA0 + ' ', '\u00a1', '\u00a2', '\u00a3', '\u00a4', '\u00a5', + '\u00a6', '\u00a7', '\u00a8', '\u00a9', '\u00aa', '\u00ab', + '\u00ac', '\u00ad', '\u00ae', '\u00af', // 0xb0 + '\u00b0', '\u00b1', '\u00b2', '\u00b3', '\u00b4', + '\u00b5', // This is hand-coded, the rest is assumption + '\u00b6', // and *might* not be correct... + '\u00b7', '\u00b8', '\u00b9', '\u00ba', '\u00bb', '\u00bc', '\u00bd', + '\u00be', '\u00bf', // 0xc0 + '\u00c0', '\u00c1', '\u00c2', '\u00c3', '\u00c4', '\u00c5', // Aring + '\u00c6', // AE + '\u00c7', '\u00c8', '\u00c9', '\u00ca', '\u00cb', '\u00cc', + '\u00cd', '\u00ce', '\u00cf', // 0xd0 + '\u00d0', '\u00d1', '\u00d2', '\u00d3', '\u00d4', '\u00d5', + '\u00d6', '\u00d7', '\u00d8', // Oslash + '\u00d9', '\u00da', '\u00db', '\u00dc', '\u00dd', '\u00de', + '\u00df', // 0xe0 + '\u00e0', '\u00e1', '\u00e2', '\u00e3', '\u00e4', '\u00e5', // aring + '\u00e6', // ae + '\u00e7', '\u00e8', '\u00e9', '\u00ea', '\u00eb', '\u00ec', + '\u00ed', '\u00ee', '\u00ef', // 0xf0 + '\u00f0', '\u00f1', '\u00f2', '\u00f3', '\u00f4', '\u00f5', + '\u00f6', '\u00f7', '\u00f8', '\u00f9', '\u00fa', '\u00fb', + '\u00fc', '\u00fd', '\u00fe', '\u00ff' + }; + + /** + * List of unicode glyphs + */ + public static final String[] UNICODE_GLYPHS = { + "\u0041", "A", + "\u00C6", "AE", + "\u01FC", "AEacute", + "\uF7E6", "AEsmall", + "\u00C1", "Aacute", + "\uF7E1", "Aacutesmall", + "\u0102", "Abreve", + "\u00C2", "Acircumflex", + "\uF7E2", "Acircumflexsmall", + "\uF6C9", "Acute", + "\uF7B4", "Acutesmall", + "\u00C4", "Adieresis", + "\uF7E4", "Adieresissmall", + "\u00C0", "Agrave", + "\uF7E0", "Agravesmall", + "\u0391", "Alpha", + "\u0386", "Alphatonos", + "\u0100", "Amacron", + "\u0104", "Aogonek", + "\u00C5", "Aring", + "\u01FA", "Aringacute", + "\uF7E5", "Aringsmall", + "\uF761", "Asmall", + "\u00C3", "Atilde", + "\uF7E3", "Atildesmall", + "\u0042", "B", + "\u0392", "Beta", + "\uF6F4", "Brevesmall", + "\uF762", "Bsmall", + "\u0043", "C", + "\u0106", "Cacute", + "\uF6CA", "Caron", + "\uF6F5", "Caronsmall", + "\u010C", "Ccaron", + "\u00C7", "Ccedilla", + "\uF7E7", "Ccedillasmall", + "\u0108", "Ccircumflex", + "\u010A", "Cdotaccent", + "\uF7B8", "Cedillasmall", + "\u03A7", "Chi", + "\uF6F6", "Circumflexsmall", + "\uF763", "Csmall", + "\u0044", "D", + "\u010E", "Dcaron", + "\u0110", "Dcroat", + "\u2206", "Delta", + "\u0394", "Delta", + "\uF6CB", "Dieresis", + "\uF6CC", "DieresisAcute", + "\uF6CD", "DieresisGrave", + "\uF7A8", "Dieresissmall", + "\uF6F7", "Dotaccentsmall", + "\uF764", "Dsmall", + "\u0045", "E", + "\u00C9", "Eacute", + "\uF7E9", "Eacutesmall", + "\u0114", "Ebreve", + "\u011A", "Ecaron", + "\u00CA", "Ecircumflex", + "\uF7EA", "Ecircumflexsmall", + "\u00CB", "Edieresis", + "\uF7EB", "Edieresissmall", + "\u0116", "Edotaccent", + "\u00C8", "Egrave", + "\uF7E8", "Egravesmall", + "\u0112", "Emacron", + "\u014A", "Eng", + "\u0118", "Eogonek", + "\u0395", "Epsilon", + "\u0388", "Epsilontonos", + "\uF765", "Esmall", + "\u0397", "Eta", + "\u0389", "Etatonos", + "\u00D0", "Eth", + "\uF7F0", "Ethsmall", + "\u20AC", "Euro", + "\u0046", "F", + "\uF766", "Fsmall", + "\u0047", "G", + "\u0393", "Gamma", + "\u011E", "Gbreve", + "\u01E6", "Gcaron", + "\u011C", "Gcircumflex", + "\u0122", "Gcommaaccent", + "\u0120", "Gdotaccent", + "\uF6CE", "Grave", + "\uF760", "Gravesmall", + "\uF767", "Gsmall", + "\u0048", "H", + "\u25CF", "H18533", + "\u25AA", "H18543", + "\u25AB", "H18551", + "\u25A1", "H22073", + "\u0126", "Hbar", + "\u0124", "Hcircumflex", + "\uF768", "Hsmall", + "\uF6CF", "Hungarumlaut", + "\uF6F8", "Hungarumlautsmall", + "\u0049", "I", + "\u0132", "IJ", + "\u00CD", "Iacute", + "\uF7ED", "Iacutesmall", + "\u012C", "Ibreve", + "\u00CE", "Icircumflex", + "\uF7EE", "Icircumflexsmall", + "\u00CF", "Idieresis", + "\uF7EF", "Idieresissmall", + "\u0130", "Idotaccent", + "\u2111", "Ifraktur", + "\u00CC", "Igrave", + "\uF7EC", "Igravesmall", + "\u012A", "Imacron", + "\u012E", "Iogonek", + "\u0399", "Iota", + "\u03AA", "Iotadieresis", + "\u038A", "Iotatonos", + "\uF769", "Ismall", + "\u0128", "Itilde", + "\u004A", "J", + "\u0134", "Jcircumflex", + "\uF76A", "Jsmall", + "\u004B", "K", + "\u039A", "Kappa", + "\u0136", "Kcommaaccent", + "\uF76B", "Ksmall", + "\u004C", "L", + "\uF6BF", "LL", + "\u0139", "Lacute", + "\u039B", "Lambda", + "\u013D", "Lcaron", + "\u013B", "Lcommaaccent", + "\u013F", "Ldot", + "\u0141", "Lslash", + "\uF6F9", "Lslashsmall", + "\uF76C", "Lsmall", + "\u004D", "M", + "\uF6D0", "Macron", + "\uF7AF", "Macronsmall", + "\uF76D", "Msmall", + "\u039C", "Mu", + "\u004E", "N", + "\u0143", "Nacute", + "\u0147", "Ncaron", + "\u0145", "Ncommaaccent", + "\uF76E", "Nsmall", + "\u00D1", "Ntilde", + "\uF7F1", "Ntildesmall", + "\u039D", "Nu", + "\u004F", "O", + "\u0152", "OE", + "\uF6FA", "OEsmall", + "\u00D3", "Oacute", + "\uF7F3", "Oacutesmall", + "\u014E", "Obreve", + "\u00D4", "Ocircumflex", + "\uF7F4", "Ocircumflexsmall", + "\u00D6", "Odieresis", + "\uF7F6", "Odieresissmall", + "\uF6FB", "Ogoneksmall", + "\u00D2", "Ograve", + "\uF7F2", "Ogravesmall", + "\u01A0", "Ohorn", + "\u0150", "Ohungarumlaut", + "\u014C", "Omacron", + "\u2126", "Omega", + "\u03A9", "Omega", + "\u038F", "Omegatonos", + "\u039F", "Omicron", + "\u038C", "Omicrontonos", + "\u00D8", "Oslash", + "\u01FE", "Oslashacute", + "\uF7F8", "Oslashsmall", + "\uF76F", "Osmall", + "\u00D5", "Otilde", + "\uF7F5", "Otildesmall", + "\u0050", "P", + "\u03A6", "Phi", + "\u03A0", "Pi", + "\u03A8", "Psi", + "\uF770", "Psmall", + "\u0051", "Q", + "\uF771", "Qsmall", + "\u0052", "R", + "\u0154", "Racute", + "\u0158", "Rcaron", + "\u0156", "Rcommaaccent", + "\u211C", "Rfraktur", + "\u03A1", "Rho", + "\uF6FC", "Ringsmall", + "\uF772", "Rsmall", + "\u0053", "S", + "\u250C", "SF010000", + "\u2514", "SF020000", + "\u2510", "SF030000", + "\u2518", "SF040000", + "\u253C", "SF050000", + "\u252C", "SF060000", + "\u2534", "SF070000", + "\u251C", "SF080000", + "\u2524", "SF090000", + "\u2500", "SF100000", + "\u2502", "SF110000", + "\u2561", "SF190000", + "\u2562", "SF200000", + "\u2556", "SF210000", + "\u2555", "SF220000", + "\u2563", "SF230000", + "\u2551", "SF240000", + "\u2557", "SF250000", + "\u255D", "SF260000", + "\u255C", "SF270000", + "\u255B", "SF280000", + "\u255E", "SF360000", + "\u255F", "SF370000", + "\u255A", "SF380000", + "\u2554", "SF390000", + "\u2569", "SF400000", + "\u2566", "SF410000", + "\u2560", "SF420000", + "\u2550", "SF430000", + "\u256C", "SF440000", + "\u2567", "SF450000", + "\u2568", "SF460000", + "\u2564", "SF470000", + "\u2565", "SF480000", + "\u2559", "SF490000", + "\u2558", "SF500000", + "\u2552", "SF510000", + "\u2553", "SF520000", + "\u256B", "SF530000", + "\u256A", "SF540000", + "\u015A", "Sacute", + "\u0160", "Scaron", + "\uF6FD", "Scaronsmall", + "\u015E", "Scedilla", + "\uF6C1", "Scedilla", + "\u015C", "Scircumflex", + "\u0218", "Scommaaccent", + "\u03A3", "Sigma", + "\uF773", "Ssmall", + "\u0054", "T", + "\u03A4", "Tau", + "\u0166", "Tbar", + "\u0164", "Tcaron", + "\u0162", "Tcommaaccent", + "\u021A", "Tcommaaccent", + "\u0398", "Theta", + "\u00DE", "Thorn", + "\uF7FE", "Thornsmall", + "\uF6FE", "Tildesmall", + "\uF774", "Tsmall", + "\u0055", "U", + "\u00DA", "Uacute", + "\uF7FA", "Uacutesmall", + "\u016C", "Ubreve", + "\u00DB", "Ucircumflex", + "\uF7FB", "Ucircumflexsmall", + "\u00DC", "Udieresis", + "\uF7FC", "Udieresissmall", + "\u00D9", "Ugrave", + "\uF7F9", "Ugravesmall", + "\u01AF", "Uhorn", + "\u0170", "Uhungarumlaut", + "\u016A", "Umacron", + "\u0172", "Uogonek", + "\u03A5", "Upsilon", + "\u03D2", "Upsilon1", + "\u03AB", "Upsilondieresis", + "\u038E", "Upsilontonos", + "\u016E", "Uring", + "\uF775", "Usmall", + "\u0168", "Utilde", + "\u0056", "V", + "\uF776", "Vsmall", + "\u0057", "W", + "\u1E82", "Wacute", + "\u0174", "Wcircumflex", + "\u1E84", "Wdieresis", + "\u1E80", "Wgrave", + "\uF777", "Wsmall", + "\u0058", "X", + "\u039E", "Xi", + "\uF778", "Xsmall", + "\u0059", "Y", + "\u00DD", "Yacute", + "\uF7FD", "Yacutesmall", + "\u0176", "Ycircumflex", + "\u0178", "Ydieresis", + "\uF7FF", "Ydieresissmall", + "\u1EF2", "Ygrave", + "\uF779", "Ysmall", + "\u005A", "Z", + "\u0179", "Zacute", + "\u017D", "Zcaron", + "\uF6FF", "Zcaronsmall", + "\u017B", "Zdotaccent", + "\u0396", "Zeta", + "\uF77A", "Zsmall", + "\u0061", "a", + "\u00E1", "aacute", + "\u0103", "abreve", + "\u00E2", "acircumflex", + "\u00B4", "acute", + "\u0301", "acutecomb", + "\u00E4", "adieresis", + "\u00E6", "ae", + "\u01FD", "aeacute", + "\u2015", "afii00208", + "\u0410", "afii10017", + "\u0411", "afii10018", + "\u0412", "afii10019", + "\u0413", "afii10020", + "\u0414", "afii10021", + "\u0415", "afii10022", + "\u0401", "afii10023", + "\u0416", "afii10024", + "\u0417", "afii10025", + "\u0418", "afii10026", + "\u0419", "afii10027", + "\u041A", "afii10028", + "\u041B", "afii10029", + "\u041C", "afii10030", + "\u041D", "afii10031", + "\u041E", "afii10032", + "\u041F", "afii10033", + "\u0420", "afii10034", + "\u0421", "afii10035", + "\u0422", "afii10036", + "\u0423", "afii10037", + "\u0424", "afii10038", + "\u0425", "afii10039", + "\u0426", "afii10040", + "\u0427", "afii10041", + "\u0428", "afii10042", + "\u0429", "afii10043", + "\u042A", "afii10044", + "\u042B", "afii10045", + "\u042C", "afii10046", + "\u042D", "afii10047", + "\u042E", "afii10048", + "\u042F", "afii10049", + "\u0490", "afii10050", + "\u0402", "afii10051", + "\u0403", "afii10052", + "\u0404", "afii10053", + "\u0405", "afii10054", + "\u0406", "afii10055", + "\u0407", "afii10056", + "\u0408", "afii10057", + "\u0409", "afii10058", + "\u040A", "afii10059", + "\u040B", "afii10060", + "\u040C", "afii10061", + "\u040E", "afii10062", + "\uF6C4", "afii10063", + "\uF6C5", "afii10064", + "\u0430", "afii10065", + "\u0431", "afii10066", + "\u0432", "afii10067", + "\u0433", "afii10068", + "\u0434", "afii10069", + "\u0435", "afii10070", + "\u0451", "afii10071", + "\u0436", "afii10072", + "\u0437", "afii10073", + "\u0438", "afii10074", + "\u0439", "afii10075", + "\u043A", "afii10076", + "\u043B", "afii10077", + "\u043C", "afii10078", + "\u043D", "afii10079", + "\u043E", "afii10080", + "\u043F", "afii10081", + "\u0440", "afii10082", + "\u0441", "afii10083", + "\u0442", "afii10084", + "\u0443", "afii10085", + "\u0444", "afii10086", + "\u0445", "afii10087", + "\u0446", "afii10088", + "\u0447", "afii10089", + "\u0448", "afii10090", + "\u0449", "afii10091", + "\u044A", "afii10092", + "\u044B", "afii10093", + "\u044C", "afii10094", + "\u044D", "afii10095", + "\u044E", "afii10096", + "\u044F", "afii10097", + "\u0491", "afii10098", + "\u0452", "afii10099", + "\u0453", "afii10100", + "\u0454", "afii10101", + "\u0455", "afii10102", + "\u0456", "afii10103", + "\u0457", "afii10104", + "\u0458", "afii10105", + "\u0459", "afii10106", + "\u045A", "afii10107", + "\u045B", "afii10108", + "\u045C", "afii10109", + "\u045E", "afii10110", + "\u040F", "afii10145", + "\u0462", "afii10146", + "\u0472", "afii10147", + "\u0474", "afii10148", + "\uF6C6", "afii10192", + "\u045F", "afii10193", + "\u0463", "afii10194", + "\u0473", "afii10195", + "\u0475", "afii10196", + "\uF6C7", "afii10831", + "\uF6C8", "afii10832", + "\u04D9", "afii10846", + "\u200E", "afii299", + "\u200F", "afii300", + "\u200D", "afii301", + "\u066A", "afii57381", + "\u060C", "afii57388", + "\u0660", "afii57392", + "\u0661", "afii57393", + "\u0662", "afii57394", + "\u0663", "afii57395", + "\u0664", "afii57396", + "\u0665", "afii57397", + "\u0666", "afii57398", + "\u0667", "afii57399", + "\u0668", "afii57400", + "\u0669", "afii57401", + "\u061B", "afii57403", + "\u061F", "afii57407", + "\u0621", "afii57409", + "\u0622", "afii57410", + "\u0623", "afii57411", + "\u0624", "afii57412", + "\u0625", "afii57413", + "\u0626", "afii57414", + "\u0627", "afii57415", + "\u0628", "afii57416", + "\u0629", "afii57417", + "\u062A", "afii57418", + "\u062B", "afii57419", + "\u062C", "afii57420", + "\u062D", "afii57421", + "\u062E", "afii57422", + "\u062F", "afii57423", + "\u0630", "afii57424", + "\u0631", "afii57425", + "\u0632", "afii57426", + "\u0633", "afii57427", + "\u0634", "afii57428", + "\u0635", "afii57429", + "\u0636", "afii57430", + "\u0637", "afii57431", + "\u0638", "afii57432", + "\u0639", "afii57433", + "\u063A", "afii57434", + "\u0640", "afii57440", + "\u0641", "afii57441", + "\u0642", "afii57442", + "\u0643", "afii57443", + "\u0644", "afii57444", + "\u0645", "afii57445", + "\u0646", "afii57446", + "\u0648", "afii57448", + "\u0649", "afii57449", + "\u064A", "afii57450", + "\u064B", "afii57451", + "\u064C", "afii57452", + "\u064D", "afii57453", + "\u064E", "afii57454", + "\u064F", "afii57455", + "\u0650", "afii57456", + "\u0651", "afii57457", + "\u0652", "afii57458", + "\u0647", "afii57470", + "\u06A4", "afii57505", + "\u067E", "afii57506", + "\u0686", "afii57507", + "\u0698", "afii57508", + "\u06AF", "afii57509", + "\u0679", "afii57511", + "\u0688", "afii57512", + "\u0691", "afii57513", + "\u06BA", "afii57514", + "\u06D2", "afii57519", + "\u06D5", "afii57534", + "\u20AA", "afii57636", + "\u05BE", "afii57645", + "\u05C3", "afii57658", + "\u05D0", "afii57664", + "\u05D1", "afii57665", + "\u05D2", "afii57666", + "\u05D3", "afii57667", + "\u05D4", "afii57668", + "\u05D5", "afii57669", + "\u05D6", "afii57670", + "\u05D7", "afii57671", + "\u05D8", "afii57672", + "\u05D9", "afii57673", + "\u05DA", "afii57674", + "\u05DB", "afii57675", + "\u05DC", "afii57676", + "\u05DD", "afii57677", + "\u05DE", "afii57678", + "\u05DF", "afii57679", + "\u05E0", "afii57680", + "\u05E1", "afii57681", + "\u05E2", "afii57682", + "\u05E3", "afii57683", + "\u05E4", "afii57684", + "\u05E5", "afii57685", + "\u05E6", "afii57686", + "\u05E7", "afii57687", + "\u05E8", "afii57688", + "\u05E9", "afii57689", + "\u05EA", "afii57690", + "\uFB2A", "afii57694", + "\uFB2B", "afii57695", + "\uFB4B", "afii57700", + "\uFB1F", "afii57705", + "\u05F0", "afii57716", + "\u05F1", "afii57717", + "\u05F2", "afii57718", + "\uFB35", "afii57723", + "\u05B4", "afii57793", + "\u05B5", "afii57794", + "\u05B6", "afii57795", + "\u05BB", "afii57796", + "\u05B8", "afii57797", + "\u05B7", "afii57798", + "\u05B0", "afii57799", + "\u05B2", "afii57800", + "\u05B1", "afii57801", + "\u05B3", "afii57802", + "\u05C2", "afii57803", + "\u05C1", "afii57804", + "\u05B9", "afii57806", + "\u05BC", "afii57807", + "\u05BD", "afii57839", + "\u05BF", "afii57841", + "\u05C0", "afii57842", + "\u02BC", "afii57929", + "\u2105", "afii61248", + "\u2113", "afii61289", + "\u2116", "afii61352", + "\u202C", "afii61573", + "\u202D", "afii61574", + "\u202E", "afii61575", + "\u200C", "afii61664", + "\u066D", "afii63167", + "\u02BD", "afii64937", + "\u00E0", "agrave", + "\u2135", "aleph", + "\u03B1", "alpha", + "\u03AC", "alphatonos", + "\u0101", "amacron", + "\u0026", "ampersand", + "\uF726", "ampersandsmall", + "\u2220", "angle", + "\u2329", "angleleft", + "\u232A", "angleright", + "\u0387", "anoteleia", + "\u0105", "aogonek", + "\u2248", "approxequal", + "\u00E5", "aring", + "\u01FB", "aringacute", + "\u2194", "arrowboth", + "\u21D4", "arrowdblboth", + "\u21D3", "arrowdbldown", + "\u21D0", "arrowdblleft", + "\u21D2", "arrowdblright", + "\u21D1", "arrowdblup", + "\u2193", "arrowdown", + "\uF8E7", "arrowhorizex", + "\u2190", "arrowleft", + "\u2192", "arrowright", + "\u2191", "arrowup", + "\u2195", "arrowupdn", + "\u21A8", "arrowupdnbse", + "\uF8E6", "arrowvertex", + "\u005E", "asciicircum", + "\u007E", "asciitilde", + "\u002A", "asterisk", + "\u2217", "asteriskmath", + "\uF6E9", "asuperior", + "\u0040", "at", + "\u00E3", "atilde", + "\u0062", "b", + //"\u005C", "backslash", + "\\", "backslash", + "\u007C", "bar", + "\u03B2", "beta", + "\u2588", "block", + "\uF8F4", "braceex", + "\u007B", "braceleft", + "\uF8F3", "braceleftbt", + "\uF8F2", "braceleftmid", + "\uF8F1", "bracelefttp", + "\u007D", "braceright", + "\uF8FE", "bracerightbt", + "\uF8FD", "bracerightmid", + "\uF8FC", "bracerighttp", + "\u005B", "bracketleft", + "\uF8F0", "bracketleftbt", + "\uF8EF", "bracketleftex", + "\uF8EE", "bracketlefttp", + "\u005D", "bracketright", + "\uF8FB", "bracketrightbt", + "\uF8FA", "bracketrightex", + "\uF8F9", "bracketrighttp", + "\u02D8", "breve", + "\u00A6", "brokenbar", + "\uF6EA", "bsuperior", + "\u2022", "bullet", + "\u0063", "c", + "\u0107", "cacute", + "\u02C7", "caron", + "\u21B5", "carriagereturn", + "\u010D", "ccaron", + "\u00E7", "ccedilla", + "\u0109", "ccircumflex", + "\u010B", "cdotaccent", + "\u00B8", "cedilla", + "\u00A2", "cent", + "\uF6DF", "centinferior", + "\uF7A2", "centoldstyle", + "\uF6E0", "centsuperior", + "\u03C7", "chi", + "\u25CB", "circle", + "\u2297", "circlemultiply", + "\u2295", "circleplus", + "\u02C6", "circumflex", + "\u2663", "club", + "\u003A", "colon", + "\u20A1", "colonmonetary", + "\u002C", "comma", + "\uF6C3", "commaaccent", + "\uF6E1", "commainferior", + "\uF6E2", "commasuperior", + "\u2245", "congruent", + "\u00A9", "copyright", + "\uF8E9", "copyrightsans", + "\uF6D9", "copyrightserif", + "\u00A4", "currency", + "\uF6D1", "cyrBreve", + "\uF6D2", "cyrFlex", + "\uF6D4", "cyrbreve", + "\uF6D5", "cyrflex", + "\u0064", "d", + "\u2020", "dagger", + "\u2021", "daggerdbl", + "\uF6D3", "dblGrave", + "\uF6D6", "dblgrave", + "\u010F", "dcaron", + "\u0111", "dcroat", + "\u00B0", "degree", + "\u03B4", "delta", + "\u2666", "diamond", + "\u00A8", "dieresis", + "\uF6D7", "dieresisacute", + "\uF6D8", "dieresisgrave", + "\u0385", "dieresistonos", + "\u00F7", "divide", + "\u2593", "dkshade", + "\u2584", "dnblock", + "\u0024", "dollar", + "\uF6E3", "dollarinferior", + "\uF724", "dollaroldstyle", + "\uF6E4", "dollarsuperior", + "\u20AB", "dong", + "\u02D9", "dotaccent", + "\u0323", "dotbelowcomb", + "\u0131", "dotlessi", + "\uF6BE", "dotlessj", + "\u22C5", "dotmath", + "\uF6EB", "dsuperior", + "\u0065", "e", + "\u00E9", "eacute", + "\u0115", "ebreve", + "\u011B", "ecaron", + "\u00EA", "ecircumflex", + "\u00EB", "edieresis", + "\u0117", "edotaccent", + "\u00E8", "egrave", + "\u0038", "eight", + "\u2088", "eightinferior", + "\uF738", "eightoldstyle", + "\u2078", "eightsuperior", + "\u2208", "element", + "\u2026", "ellipsis", + "\u0113", "emacron", + "\u2014", "emdash", + "\u2205", "emptyset", + "\u2013", "endash", + "\u014B", "eng", + "\u0119", "eogonek", + "\u03B5", "epsilon", + "\u03AD", "epsilontonos", + "\u003D", "equal", + "\u2261", "equivalence", + "\u212E", "estimated", + "\uF6EC", "esuperior", + "\u03B7", "eta", + "\u03AE", "etatonos", + "\u00F0", "eth", + "\u0021", "exclam", + "\u203C", "exclamdbl", + "\u00A1", "exclamdown", + "\uF7A1", "exclamdownsmall", + "\uF721", "exclamsmall", + "\u2203", "existential", + "\u0066", "f", + "\u2640", "female", + "\uFB00", "ff", + "\uFB03", "ffi", + "\uFB04", "ffl", + "\uFB01", "fi", + "\u2012", "figuredash", + "\u25A0", "filledbox", + "\u25AC", "filledrect", + "\u0035", "five", + "\u215D", "fiveeighths", + "\u2085", "fiveinferior", + "\uF735", "fiveoldstyle", + "\u2075", "fivesuperior", + "\uFB02", "fl", + "\u0192", "florin", + "\u0034", "four", + "\u2084", "fourinferior", + "\uF734", "fouroldstyle", + "\u2074", "foursuperior", + "\u2044", "fraction", + "\u2215", "fraction", + "\u20A3", "franc", + "\u0067", "g", + "\u03B3", "gamma", + "\u011F", "gbreve", + "\u01E7", "gcaron", + "\u011D", "gcircumflex", + "\u0123", "gcommaaccent", + "\u0121", "gdotaccent", + "\u00DF", "germandbls", + "\u2207", "gradient", + "\u0060", "grave", + "\u0300", "gravecomb", + "\u003E", "greater", + "\u2265", "greaterequal", + "\u00AB", "guillemotleft", + "\u00BB", "guillemotright", + "\u2039", "guilsinglleft", + "\u203A", "guilsinglright", + "\u0068", "h", + "\u0127", "hbar", + "\u0125", "hcircumflex", + "\u2665", "heart", + "\u0309", "hookabovecomb", + "\u2302", "house", + "\u02DD", "hungarumlaut", + "\u002D", "hyphen", + "\u00AD", "hyphen", + "\uF6E5", "hypheninferior", + "\uF6E6", "hyphensuperior", + "\u0069", "i", + "\u00ED", "iacute", + "\u012D", "ibreve", + "\u00EE", "icircumflex", + "\u00EF", "idieresis", + "\u00EC", "igrave", + "\u0133", "ij", + "\u012B", "imacron", + "\u221E", "infinity", + "\u222B", "integral", + "\u2321", "integralbt", + "\uF8F5", "integralex", + "\u2320", "integraltp", + "\u2229", "intersection", + "\u25D8", "invbullet", + "\u25D9", "invcircle", + "\u263B", "invsmileface", + "\u012F", "iogonek", + "\u03B9", "iota", + "\u03CA", "iotadieresis", + "\u0390", "iotadieresistonos", + "\u03AF", "iotatonos", + "\uF6ED", "isuperior", + "\u0129", "itilde", + "\u006A", "j", + "\u0135", "jcircumflex", + "\u006B", "k", + "\u03BA", "kappa", + "\u0137", "kcommaaccent", + "\u0138", "kgreenlandic", + "\u006C", "l", + "\u013A", "lacute", + "\u03BB", "lambda", + "\u013E", "lcaron", + "\u013C", "lcommaaccent", + "\u0140", "ldot", + "\u003C", "less", + "\u2264", "lessequal", + "\u258C", "lfblock", + "\u20A4", "lira", + "\uF6C0", "ll", + "\u2227", "logicaland", + "\u00AC", "logicalnot", + "\u2228", "logicalor", + "\u017F", "longs", + "\u25CA", "lozenge", + "\u0142", "lslash", + "\uF6EE", "lsuperior", + "\u2591", "ltshade", + "\u006D", "m", + "\u00AF", "macron", + "\u02C9", "macron", + "\u2642", "male", + "\u2212", "minus", + "\u2032", "minute", + "\uF6EF", "msuperior", + "\u00B5", "mu", + "\u03BC", "mu", + "\u00D7", "multiply", + "\u266A", "musicalnote", + "\u266B", "musicalnotedbl", + "\u006E", "n", + "\u0144", "nacute", + "\u0149", "napostrophe", + "\u0148", "ncaron", + "\u0146", "ncommaaccent", + "\u0039", "nine", + "\u2089", "nineinferior", + "\uF739", "nineoldstyle", + "\u2079", "ninesuperior", + "\u2209", "notelement", + "\u2260", "notequal", + "\u2284", "notsubset", + "\u207F", "nsuperior", + "\u00F1", "ntilde", + "\u03BD", "nu", + "\u0023", "numbersign", + "\u006F", "o", + "\u00F3", "oacute", + "\u014F", "obreve", + "\u00F4", "ocircumflex", + "\u00F6", "odieresis", + "\u0153", "oe", + "\u02DB", "ogonek", + "\u00F2", "ograve", + "\u01A1", "ohorn", + "\u0151", "ohungarumlaut", + "\u014D", "omacron", + "\u03C9", "omega", + "\u03D6", "omega1", + "\u03CE", "omegatonos", + "\u03BF", "omicron", + "\u03CC", "omicrontonos", + "\u0031", "one", + "\u2024", "onedotenleader", + "\u215B", "oneeighth", + "\uF6DC", "onefitted", + "\u00BD", "onehalf", + "\u2081", "oneinferior", + "\uF731", "oneoldstyle", + "\u00BC", "onequarter", + "\u00B9", "onesuperior", + "\u2153", "onethird", + "\u25E6", "openbullet", + "\u00AA", "ordfeminine", + "\u00BA", "ordmasculine", + "\u221F", "orthogonal", + "\u00F8", "oslash", + "\u01FF", "oslashacute", + "\uF6F0", "osuperior", + "\u00F5", "otilde", + "\u0070", "p", + "\u00B6", "paragraph", + "\u0028", "parenleft", + "\uF8ED", "parenleftbt", + "\uF8EC", "parenleftex", + "\u208D", "parenleftinferior", + "\u207D", "parenleftsuperior", + "\uF8EB", "parenlefttp", + "\u0029", "parenright", + "\uF8F8", "parenrightbt", + "\uF8F7", "parenrightex", + "\u208E", "parenrightinferior", + "\u207E", "parenrightsuperior", + "\uF8F6", "parenrighttp", + "\u2202", "partialdiff", + "\u0025", "percent", + "\u002E", "period", + "\u00B7", "periodcentered", + "\u2219", "periodcentered", + "\uF6E7", "periodinferior", + "\uF6E8", "periodsuperior", + "\u22A5", "perpendicular", + "\u2030", "perthousand", + "\u20A7", "peseta", + "\u03C6", "phi", + "\u03D5", "phi1", + "\u03C0", "pi", + "\u002B", "plus", + "\u00B1", "plusminus", + "\u211E", "prescription", + "\u220F", "product", + "\u2282", "propersubset", + "\u2283", "propersuperset", + "\u221D", "proportional", + "\u03C8", "psi", + "\u0071", "q", + "\u003F", "question", + "\u00BF", "questiondown", + "\uF7BF", "questiondownsmall", + "\uF73F", "questionsmall", + "\"", "quotedbl", +// "\u0022", "quotedbl", + "\u201E", "quotedblbase", + "\u201C", "quotedblleft", + "\u201D", "quotedblright", + "\u2018", "quoteleft", + "\u201B", "quotereversed", + "\u2019", "quoteright", + "\u201A", "quotesinglbase", + "\u0027", "quotesingle", + "\u0072", "r", + "\u0155", "racute", + "\u221A", "radical", + "\uF8E5", "radicalex", + "\u0159", "rcaron", + "\u0157", "rcommaaccent", + "\u2286", "reflexsubset", + "\u2287", "reflexsuperset", + "\u00AE", "registered", + "\uF8E8", "registersans", + "\uF6DA", "registerserif", + "\u2310", "revlogicalnot", + "\u03C1", "rho", + "\u02DA", "ring", + "\uF6F1", "rsuperior", + "\u2590", "rtblock", + "\uF6DD", "rupiah", + "\u0073", "s", + "\u015B", "sacute", + "\u0161", "scaron", + "\u015F", "scedilla", + "\uF6C2", "scedilla", + "\u015D", "scircumflex", + "\u0219", "scommaaccent", + "\u2033", "second", + "\u00A7", "section", + "\u003B", "semicolon", + "\u0037", "seven", + "\u215E", "seveneighths", + "\u2087", "seveninferior", + "\uF737", "sevenoldstyle", + "\u2077", "sevensuperior", + "\u2592", "shade", + "\u03C3", "sigma", + "\u03C2", "sigma1", + "\u223C", "similar", + "\u0036", "six", + "\u2086", "sixinferior", + "\uF736", "sixoldstyle", + "\u2076", "sixsuperior", + "\u002F", "slash", + "\u263A", "smileface", + "\u0020", "space", + "\u00A0", "space", + "\u2660", "spade", + "\uF6F2", "ssuperior", + "\u00A3", "sterling", + "\u220B", "suchthat", + "\u2211", "summation", + "\u263C", "sun", + "\u0074", "t", + "\u03C4", "tau", + "\u0167", "tbar", + "\u0165", "tcaron", + "\u0163", "tcommaaccent", + "\u021B", "tcommaaccent", + "\u2234", "therefore", + "\u03B8", "theta", + "\u03D1", "theta1", + "\u00FE", "thorn", + "\u0033", "three", + "\u215C", "threeeighths", + "\u2083", "threeinferior", + "\uF733", "threeoldstyle", + "\u00BE", "threequarters", + "\uF6DE", "threequartersemdash", + "\u00B3", "threesuperior", + "\u02DC", "tilde", + "\u0303", "tildecomb", + "\u0384", "tonos", + "\u2122", "trademark", + "\uF8EA", "trademarksans", + "\uF6DB", "trademarkserif", + "\u25BC", "triagdn", + "\u25C4", "triaglf", + "\u25BA", "triagrt", + "\u25B2", "triagup", + "\uF6F3", "tsuperior", + "\u0032", "two", + "\u2025", "twodotenleader", + "\u2082", "twoinferior", + "\uF732", "twooldstyle", + "\u00B2", "twosuperior", + "\u2154", "twothirds", + "\u0075", "u", + "\u00FA", "uacute", + "\u016D", "ubreve", + "\u00FB", "ucircumflex", + "\u00FC", "udieresis", + "\u00F9", "ugrave", + "\u01B0", "uhorn", + "\u0171", "uhungarumlaut", + "\u016B", "umacron", + "\u005F", "underscore", + "\u2017", "underscoredbl", + "\u222A", "union", + "\u2200", "universal", + "\u0173", "uogonek", + "\u2580", "upblock", + "\u03C5", "upsilon", + "\u03CB", "upsilondieresis", + "\u03B0", "upsilondieresistonos", + "\u03CD", "upsilontonos", + "\u016F", "uring", + "\u0169", "utilde", + "\u0076", "v", + "\u0077", "w", + "\u1E83", "wacute", + "\u0175", "wcircumflex", + "\u1E85", "wdieresis", + "\u2118", "weierstrass", + "\u1E81", "wgrave", + "\u0078", "x", + "\u03BE", "xi", + "\u0079", "y", + "\u00FD", "yacute", + "\u0177", "ycircumflex", + "\u00FF", "ydieresis", + "\u00A5", "yen", + "\u1EF3", "ygrave", + "\u007A", "z", + "\u017A", "zacute", + "\u017E", "zcaron", + "\u017C", "zdotaccent", + "\u0030", "zero", + "\u2080", "zeroinferior", + "\uF730", "zerooldstyle", + "\u2070", "zerosuperior", + "\u03B6", "zeta" + }; + + /** + * Return the glyphname from a character, + * eg, charToGlyphName('\\') returns "backslash" + * + * @param ch glyph to evaluate + * @return the name of the glyph + */ + public static final String charToGlyphName(char ch) { + return stringToGlyph(new Character(ch).toString()); + } + + /** + * Return the glyphname from a string, + * eg, glyphToString("\\") returns "backslash" + * + * @param name glyph to evaluate + * @return the name of the glyph + * TODO: javadocs for glyphToString and stringToGlyph are confused + * TODO: Improve method names + */ + public static final String glyphToString(String name) { + for (int i = 0; i < UNICODE_GLYPHS.length; i += 2) { + if (UNICODE_GLYPHS[i + 1].equals(name)) { + return UNICODE_GLYPHS[i]; + } + } + return ""; + } + + /** + * Return the string representation of a glyphname, + * eg stringToGlyph("backslash") returns "\\" + * + * @param name name of the glyph + * @return the string representation + */ + public static String stringToGlyph(String name) { + for (int i = 0; i < UNICODE_GLYPHS.length; i += 2) { + if (UNICODE_GLYPHS[i].equals(name)) { + return UNICODE_GLYPHS[i + 1]; + } + } + return ""; + } + +} + diff --git a/src/java/org/apache/fop/fonts/base14/package.html b/src/java/org/apache/fop/fonts/base14/package.html new file mode 100644 index 000000000..90c58d555 --- /dev/null +++ b/src/java/org/apache/fop/fonts/base14/package.html @@ -0,0 +1,6 @@ +<HTML> +<TITLE>org.apache.fop.fonts.base14 Package</TITLE> +<BODY> +<P>Base 14 fonts used for PDF and PostScript. Generated entirely from XML files.</P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/src/java/org/apache/fop/fonts/package.html b/src/java/org/apache/fop/fonts/package.html new file mode 100644 index 000000000..33e1e2cb3 --- /dev/null +++ b/src/java/org/apache/fop/fonts/package.html @@ -0,0 +1,6 @@ +<HTML> +<TITLE>org.apache.fop.fonts Package</TITLE> +<BODY> +<P>Classes for font handling. Subpackages contain command line applications for font metrics generation, font parsing classes etc.</P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/src/java/org/apache/fop/fonts/truetype/package.html b/src/java/org/apache/fop/fonts/truetype/package.html new file mode 100644 index 000000000..6517f9889 --- /dev/null +++ b/src/java/org/apache/fop/fonts/truetype/package.html @@ -0,0 +1,6 @@ +<HTML> +<TITLE>org.apache.fop.fonts.truetype Package</TITLE> +<BODY> +<P>Classes for TrueType fonts.</P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/src/java/org/apache/fop/fonts/type1/package.html b/src/java/org/apache/fop/fonts/type1/package.html new file mode 100644 index 000000000..0c492fc4d --- /dev/null +++ b/src/java/org/apache/fop/fonts/type1/package.html @@ -0,0 +1,6 @@ +<HTML> +<TITLE>org.apache.fop.fonts.type1 Package</TITLE> +<BODY> +<P>Classes for Adobe Type 1 fonts.</P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/src/java/org/apache/fop/overview.html b/src/java/org/apache/fop/overview.html new file mode 100644 index 000000000..5e22c3235 --- /dev/null +++ b/src/java/org/apache/fop/overview.html @@ -0,0 +1,10 @@ +<HTML> +<TITLE>FOP Overview</TITLE> +<BODY> +<P>FOP formats and renders XSL-FO input into a variety of output formats, +including PDF and PostScript.</P> + +<P>To more information, including general documentation, go to the <A +href="http://xml.apache.org/fop" target="fop-home">FOP Home Page</A>.</P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/src/java/org/apache/fop/render/package.html b/src/java/org/apache/fop/render/package.html new file mode 100644 index 000000000..22671f054 --- /dev/null +++ b/src/java/org/apache/fop/render/package.html @@ -0,0 +1,6 @@ +<HTML> +<TITLE>org.apache.fop.render Package</TITLE> +<BODY> +<P>Generic renderer interface.</P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/src/java/org/apache/fop/tools/DocumentInputSource.java b/src/java/org/apache/fop/tools/DocumentInputSource.java new file mode 100644 index 000000000..c4067cc17 --- /dev/null +++ b/src/java/org/apache/fop/tools/DocumentInputSource.java @@ -0,0 +1,99 @@ +/* + * $Id: DocumentInputSource.java,v 1.4 2003/03/07 10:09:30 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.tools; + +import org.w3c.dom.Document; +import org.xml.sax.InputSource; + +/** + * This is an InputSource to be used with DocumentReader. + * + * @author Kelly A Campbell + */ +public class DocumentInputSource extends InputSource { + + private Document document; + + /** + * Default constructor. + */ + public DocumentInputSource() { + super(); + } + + /** + * Main constructor + * @param document the DOM document to use as input + */ + public DocumentInputSource(Document document) { + this(); + setDocument(document); + } + + /** + * Returns the input document. + * @return the input DOM document. + */ + public Document getDocument() { + return this.document; + } + + /** + * Sets the input document. + * @param document the DOM document to use as input + */ + public void setDocument(Document document) { + this.document = document; + } + +} + + diff --git a/src/java/org/apache/fop/tools/DocumentReader.java b/src/java/org/apache/fop/tools/DocumentReader.java new file mode 100644 index 000000000..4c0f478ea --- /dev/null +++ b/src/java/org/apache/fop/tools/DocumentReader.java @@ -0,0 +1,551 @@ +/* + * $Id: DocumentReader.java,v 1.4 2003/03/07 10:09:30 jeremias Exp $ + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "FOP" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ============================================================================ + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber <jtauber@jtauber.com>. For more information on the Apache + * Software Foundation, please see <http://www.apache.org/>. + */ +package org.apache.fop.tools; + +import java.io.IOException; + +// DOM +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +// SAX +import org.xml.sax.ContentHandler; +import org.xml.sax.DTDHandler; +import org.xml.sax.EntityResolver; +import org.xml.sax.ErrorHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.AttributesImpl; + +/** + * This presents a DOM as an XMLReader to make it easy to use a Document + * with a SAX-based implementation. + * + * @author Kelly A Campbell + * + */ + +public class DocumentReader implements XMLReader { + + // ////////////////////////////////////////////////////////////////// + // Configuration. + // ////////////////////////////////////////////////////////////////// + private boolean namespaces = true; + private boolean namespacePrefixes = true; + + + /** + * Look up the value of a feature. + * + * <p>The feature name is any fully-qualified URI. It is + * possible for an XMLReader to recognize a feature name but + * to be unable to return its value; this is especially true + * in the case of an adapter for a SAX1 Parser, which has + * no way of knowing whether the underlying parser is + * performing validation or expanding external entities.</p> + * + * <p>All XMLReaders are required to recognize the + * http://xml.org/sax/features/namespaces and the + * http://xml.org/sax/features/namespace-prefixes feature names.</p> + * + * <p>Some feature values may be available only in specific + * contexts, such as before, during, or after a parse.</p> + * + * <p>Typical usage is something like this:</p> + * + * <pre> + * XMLReader r = new MySAXDriver(); + * + * // try to activate validation + * try { + * r.setFeature("http://xml.org/sax/features/validation", true); + * } catch (SAXException e) { + * System.err.println("Cannot activate validation."); + * } + * + * // register event handlers + * r.setContentHandler(new MyContentHandler()); + * r.setErrorHandler(new MyErrorHandler()); + * + * // parse the first document + * try { + * r.parse("http://www.foo.com/mydoc.xml"); + * } catch (IOException e) { + * System.err.println("I/O exception reading XML document"); + * } catch (SAXException e) { + * System.err.println("XML exception reading document."); + * } + * </pre> + * + * <p>Implementors are free (and encouraged) to invent their own features, + * using names built on their own URIs.</p> + * + * @param name The feature name, which is a fully-qualified URI. + * @return The current state of the feature (true or false). + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the feature name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the feature name but + * cannot determine its value at this time. + * @see #setFeature + */ + public boolean getFeature(String name) + throws SAXNotRecognizedException, SAXNotSupportedException { + if ("http://xml.org/sax/features/namespaces".equals(name)) { + return namespaces; + } else if ("http://xml.org/sax/features/namespace-prefixes".equals(name)) { + return namespacePrefixes; + } else { + throw new SAXNotRecognizedException("Feature '" + name + + "' not recognized or supported by Document2SAXAdapter"); + } + + } + + + + /** + * Set the state of a feature. + * + * <p>The feature name is any fully-qualified URI. It is + * possible for an XMLReader to recognize a feature name but + * to be unable to set its value; this is especially true + * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser Parser}, + * which has no way of affecting whether the underlying parser is + * validating, for example.</p> + * + * <p>All XMLReaders are required to support setting + * http://xml.org/sax/features/namespaces to true and + * http://xml.org/sax/features/namespace-prefixes to false.</p> + * + * <p>Some feature values may be immutable or mutable only + * in specific contexts, such as before, during, or after + * a parse.</p> + * + * @param name The feature name, which is a fully-qualified URI. + * @param value The requested state of the feature (true or false). + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the feature name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the feature name but + * cannot set the requested value. + * @see #getFeature + */ + public void setFeature(String name, boolean value) + throws SAXNotRecognizedException, SAXNotSupportedException { + if ("http://xml.org/sax/features/namespaces".equals(name)) { + namespaces = value; + } else if ("http://xml.org/sax/features/namespace-prefixes".equals(name)) { + namespacePrefixes = value; + } else { + throw new SAXNotRecognizedException("Feature '" + name + + "' not recognized or supported by Document2SAXAdapter"); + } + + } + + + + /** + * Look up the value of a property. + * + * <p>The property name is any fully-qualified URI. It is + * possible for an XMLReader to recognize a property name but + * to be unable to return its state; this is especially true + * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser + * Parser}.</p> + * + * <p>XMLReaders are not required to recognize any specific + * property names, though an initial core set is documented for + * SAX2.</p> + * + * <p>Some property values may be available only in specific + * contexts, such as before, during, or after a parse.</p> + * + * <p>Implementors are free (and encouraged) to invent their own properties, + * using names built on their own URIs.</p> + * + * @param name The property name, which is a fully-qualified URI. + * @return The current value of the property. + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the property name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the property name but + * cannot determine its value at this time. + * @see #setProperty + */ + public Object getProperty(String name) + throws SAXNotRecognizedException, SAXNotSupportedException { + throw new SAXNotRecognizedException("Property '" + name + + "' not recognized or supported by Document2SAXAdapter"); + } + + + + /** + * Set the value of a property. + * + * <p>The property name is any fully-qualified URI. It is + * possible for an XMLReader to recognize a property name but + * to be unable to set its value; this is especially true + * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser + * Parser}.</p> + * + * <p>XMLReaders are not required to recognize setting + * any specific property names, though a core set is provided with + * SAX2.</p> + * + * <p>Some property values may be immutable or mutable only + * in specific contexts, such as before, during, or after + * a parse.</p> + * + * <p>This method is also the standard mechanism for setting + * extended handlers.</p> + * + * @param name The property name, which is a fully-qualified URI. + * @param value The requested value for the property. + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the property name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the property name but + * cannot set the requested value. + */ + public void setProperty(String name, Object value) + throws SAXNotRecognizedException, SAXNotSupportedException { + throw new SAXNotRecognizedException("Property '" + name + + "' not recognized or supported by Document2SAXAdapter"); + } + + + + // ////////////////////////////////////////////////////////////////// + // Event handlers. + // ////////////////////////////////////////////////////////////////// + private EntityResolver entityResolver = null; + private DTDHandler dtdHandler = null; + private ContentHandler contentHandler = null; + private ErrorHandler errorHandler = null; + + + /** + * Allow an application to register an entity resolver. + * + * <p>If the application does not register an entity resolver, + * the XMLReader will perform its own default resolution.</p> + * + * <p>Applications may register a new or different resolver in the + * middle of a parse, and the SAX parser must begin using the new + * resolver immediately.</p> + * + * @param resolver The entity resolver. + * @see #getEntityResolver + */ + public void setEntityResolver(EntityResolver resolver) { + entityResolver = resolver; + } + + + + /** + * Return the current entity resolver. + * + * @return The current entity resolver, or null if none + * has been registered. + * @see #setEntityResolver + */ + public EntityResolver getEntityResolver() { + return entityResolver; + } + + + + /** + * Allow an application to register a DTD event handler. + * + * <p>If the application does not register a DTD handler, all DTD + * events reported by the SAX parser will be silently ignored.</p> + * + * <p>Applications may register a new or different handler in the + * middle of a parse, and the SAX parser must begin using the new + * handler immediately.</p> + * + * @param handler The DTD handler. + * @see #getDTDHandler + */ + public void setDTDHandler(DTDHandler handler) { + dtdHandler = handler; + } + + + + /** + * Return the current DTD handler. + * + * @return The current DTD handler, or null if none + * has been registered. + * @see #setDTDHandler + */ + public DTDHandler getDTDHandler() { + return dtdHandler; + } + + + + /** + * Allow an application to register a content event handler. + * + * <p>If the application does not register a content handler, all + * content events reported by the SAX parser will be silently + * ignored.</p> + * + * <p>Applications may register a new or different handler in the + * middle of a parse, and the SAX parser must begin using the new + * handler immediately.</p> + * + * @param handler The content handler. + * @see #getContentHandler + */ + public void setContentHandler(ContentHandler handler) { + contentHandler = handler; + } + + + + /** + * Return the current content handler. + * + * @return The current content handler, or null if none + * has been registered. + * @see #setContentHandler + */ + public ContentHandler getContentHandler() { + return contentHandler; + } + + + + /** + * Allow an application to register an error event handler. + * + * <p>If the application does not register an error handler, all + * error events reported by the SAX parser will be silently + * ignored; however, normal processing may not continue. It is + * highly recommended that all SAX applications implement an + * error handler to avoid unexpected bugs.</p> + * + * <p>Applications may register a new or different handler in the + * middle of a parse, and the SAX parser must begin using the new + * handler immediately.</p> + * + * @param handler The error handler. + * @see #getErrorHandler + */ + public void setErrorHandler(ErrorHandler handler) { + errorHandler = handler; + } + + /** + * Return the current error handler. + * + * @return The current error handler, or null if none + * has been registered. + * @see #setErrorHandler + */ + public ErrorHandler getErrorHandler() { + return errorHandler; + } + + + + // ////////////////////////////////////////////////////////////////// + // Parsing. + // ////////////////////////////////////////////////////////////////// + + /** + * Parse an XML DOM document. + * + * + * + * @param input The input source for the top-level of the + * XML document. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @exception IOException An IO exception from the parser, + * possibly from a byte stream or character stream + * supplied by the application. + * @see org.xml.sax.InputSource + * @see #parse(java.lang.String) + * @see #setEntityResolver + * @see #setDTDHandler + * @see #setContentHandler + * @see #setErrorHandler + */ + public void parse(InputSource input) throws IOException, SAXException { + if (input instanceof DocumentInputSource) { + Document document = ((DocumentInputSource)input).getDocument(); + if (contentHandler == null) { + throw new SAXException("ContentHandler is null. Please use setContentHandler()"); + } + + // refactored from org.apache.fop.apps.Driver + /* most of this code is modified from John Cowan's */ + + Node currentNode; + AttributesImpl currentAtts; + + /* temporary array for making Strings into character arrays */ + char[] array = null; + + currentAtts = new AttributesImpl(); + + /* start at the document element */ + currentNode = document; + while (currentNode != null) { + switch (currentNode.getNodeType()) { + case Node.DOCUMENT_NODE: + contentHandler.startDocument(); + break; + case Node.CDATA_SECTION_NODE: + case Node.TEXT_NODE: + String data = currentNode.getNodeValue(); + int datalen = data.length(); + if (array == null || array.length < datalen) { + /* + * if the array isn't big enough, make a new + * one + */ + array = new char[datalen]; + } + data.getChars(0, datalen, array, 0); + contentHandler.characters(array, 0, datalen); + break; + case Node.PROCESSING_INSTRUCTION_NODE: + contentHandler.processingInstruction(currentNode.getNodeName(), + currentNode.getNodeValue()); + break; + case Node.ELEMENT_NODE: + NamedNodeMap map = currentNode.getAttributes(); + currentAtts.clear(); + for (int i = map.getLength() - 1; i >= 0; i--) { + Attr att = (Attr)map.item(i); + currentAtts.addAttribute(att.getNamespaceURI(), + att.getLocalName(), + att.getName(), "CDATA", + att.getValue()); + } + contentHandler.startElement(currentNode.getNamespaceURI(), + currentNode.getLocalName(), + currentNode.getNodeName(), + currentAtts); + break; + } + + Node nextNode = currentNode.getFirstChild(); + if (nextNode != null) { + currentNode = nextNode; + continue; + } + + while (currentNode != null) { + switch (currentNode.getNodeType()) { + case Node.DOCUMENT_NODE: + contentHandler.endDocument(); + break; + case Node.ELEMENT_NODE: + contentHandler.endElement(currentNode.getNamespaceURI(), + currentNode.getLocalName(), + currentNode.getNodeName()); + break; + } + + nextNode = currentNode.getNextSibling(); + if (nextNode != null) { + currentNode = nextNode; + break; + } + + currentNode = currentNode.getParentNode(); + } + } + + } else { + throw new SAXException("DocumentReader only supports parsing of a DocumentInputSource"); + } + + } + + + + /** + * DocumentReader requires a DocumentInputSource, so this is not + * implements and simply throws a SAXException. Use parse(DocumentInputSource) + * instead + * + * @param systemId The system identifier (URI). + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @exception IOException An IO exception from the parser, + * possibly from a byte stream or character stream + * supplied by the application. + * @see #parse(org.xml.sax.InputSource) + */ + public void parse(String systemId) throws IOException, SAXException { + throw new SAXException("DocumentReader only supports parsing of a DocumentInputSource"); + } + +} + + |