168 lines
9.1 KiB
XML
168 lines
9.1 KiB
XML
<?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"
|
|
xmlns:fox="http://xml.apache.org/fop/extensions">
|
|
|
|
<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" />
|
|
</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="../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="../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="../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="../graphics/linux.bmp"/>
|
|
</fo:block>
|
|
</fo:block>
|
|
<fo:block id="N2555">
|
|
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A PNG image in FOP</fo:block>
|
|
<fo:block>
|
|
<fo:external-graphic src="../graphics/asf-logo.png"/>
|
|
</fo:block>
|
|
</fo:block>
|
|
<fo:block id="N2556">
|
|
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A TIFF image in FOP</fo:block>
|
|
<fo:block>
|
|
<fo:external-graphic src="../graphics/asf-logo.tif"/>
|
|
</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" text-align="start" font-size="10pt">
|
|
<fo:block id="e-g-use" font-size="18pt" font-weight="bold">A. The usage of fo:external-graphic</fo:block>
|
|
<fo:block>
|
|
<fo:block>The image used in these examples has the following properties:</fo:block>
|
|
<fo:block start-indent="1cm">
|
|
<fo:block>169 x 51 px, 96 dpi, results in an intrinsic size of 44.715 x 13.494 mm</fo:block>
|
|
</fo:block>
|
|
<fo:block>
|
|
All the examples here will have a border="solid 0.1pt" to show the size of the viewport generated by the
|
|
external-graphic element and a background-color="yellow" to show what parts of the viewport are painted
|
|
upon by the image in the reference area. The image used is the non-transparent version of asf-logo.png:
|
|
file:../graphics/asf-logo-nt.png (nt=non-transparent)
|
|
</fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: [none]</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: inline-progression-dimension="60mm" block-progression-dimension="20mm"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" inline-progression-dimension="60mm" block-progression-dimension="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: width="30mm" height="20mm"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="30mm" height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: width="30mm" height="20mm" overflow="hidden"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="30mm" height="20mm" overflow="hidden" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm" text-align="center" display-align="center"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" text-align="center" display-align="center" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: content-height="20mm"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: content-width="60mm" content-height="40mm"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-width="60mm" content-height="40mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: content-width="60mm" content-height="40mm" scaling="non-uniform"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-width="60mm" content-height="40mm" scaling="non-uniform" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm" content-width="scale-to-fit"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block keep-with-next.within-column="always">Properties: width="60mm" content-width="scale-to-fit"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
|
|
<fo:block break-before="page"/>
|
|
<fo:block keep-with-next.within-column="always">Properties: width="100%" content-width="scale-to-fit"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
<fo:block space-before="0.5em">
|
|
The following example shows how to fit an oversized image into the
|
|
available width, but not scale smaller images up. This is a work-around
|
|
until "scale-down-to-fit" is supported. The second feather below is in
|
|
a block-container with a width of 40mm to simulate an oversized image.
|
|
</fo:block>
|
|
<fo:block keep-with-next.within-column="always">Properties: width="100%" content-width="scale-to-fit" content-height="100%"</fo:block>
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" content-height="100%" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
<fo:block-container width="40mm" background-color="lightgray">
|
|
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" content-height="100%" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
|
</fo:block-container>
|
|
</fo:block>
|
|
</fo:flow>
|
|
|
|
</fo:page-sequence>
|
|
|
|
</fo:root>
|
|
|