Files
maven-plugins/pdf/src/plugin-resources/fo-layouts.xslt
T

39 lines
2.5 KiB
HTML

<?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">
<!-- Set the default page width, in inches -->
<xsl:variable name="pageWidth">
<xsl:choose>
<xsl:when test="$paperType = 'US'">8.5</xsl:when>
<xsl:when test="$paperType = 'A4'">8.25</xsl:when>
<xsl:otherwise>8.5</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Set the default page height, in inches -->
<xsl:variable name="pageHeight">11</xsl:variable>
<!-- Set the default left and right margin, in inches -->
<xsl:variable name="bodySideMargins">1</xsl:variable>
<xsl:variable name="maxBodyWidth" select="$pageWidth - (2 * $bodySideMargins)"/>
<xsl:variable name="maxTableWidth" select="$maxBodyWidth"/>
<xsl:template name="fo-layouts">
<!-- Defines the layout set -->
<fo:layout-master-set>
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.2in" margin-bottom="0.2in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:region-body margin-top="0.7in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="cover-inside" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0in" margin-bottom="0in" margin-left="0in" margin-right="0in">
<fo:region-body margin-top="0in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="toc" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.625in" margin-bottom="0.6in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:region-before extent="0.35in"/>
<fo:region-body margin-top="0.7in" margin-bottom="0.8in"/>
<fo:region-after extent="0.125in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="body" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.625in" margin-bottom="0.6in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:region-before extent="0.35in"/>
<fo:region-body margin-top="0.7in" margin-bottom="0.8in"/>
<fo:region-after extent="0.125in"/>
</fo:simple-page-master>
</fo:layout-master-set>
</xsl:template>
</xsl:stylesheet>