XHTML Publication - From Web to PDF
Part:
1
2
3
4
(Continued from previous part...)
TD.body {
PADDING-TOP: 25px;
PADDING-BOTTOM: 25px
}
TD.frame_top {
BORDER-WIDTH: 0pt;
BACKGROUND-COLOR: #707070;
WIDTH: 750px;
HEIGHT: 50px;
TEXT-ALIGN: center
}
TD.frame_left {
BORDER-WIDTH: 0pt;
BACKGROUND-COLOR: #707070;
WIDTH: 25px;
HEIGHT: 1px
}
TD.frame_center {
BORDER-WIDTH: 0pt;
BACKGROUND-COLOR: #707070;
WIDTH: 700px;
HEIGHT: 200px
}
TD.frame_right {
BORDER-WIDTH: 0pt;
BACKGROUND-COLOR: #707070;
WIDTH: 25px;
HEIGHT: 1px
}
TD.frame_bottom {
BORDER-WIDTH: 0pt;
BACKGROUND-COLOR: #707070;
WIDTH: 750px;
HEIGHT: 1px;
TEXT-ALIGN: center
}
TD.page_line {
WIDTH: 600px;
HEIGHT: 1px
}
UL {
MARGIN-TOP: 0pt;
MARGIN-BOTTOM: 0pt;
LIST-STYLE-TYPE: disc
}
The XSL File with XSLT and XSL-FO Statements
Here is my XSL file, book_fo.xsl:
<?xml version="1.0"?>
<!-- book_fo.xsl
Copyright (c) 2002 by Dr. Herong Yang
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml"/>
<xsl:preserve-space elements="html"/>
<xsl:template match="html">
<xsl:variable name="title"><xsl:value-of
select="head/meta/@title"/></xsl:variable>
<xsl:variable name="version"><xsl:value-of
select="head/meta/@version"/></xsl:variable>
<xsl:variable name="author"><xsl:value-of
select="head/meta/@author"/></xsl:variable>
<xsl:variable name="copyright"><xsl:value-of
select="head/meta/@copyright"/></xsl:variable>
<xsl:variable name="pagetitle"><xsl:value-of
select="head/meta/@pagetitle"/></xsl:variable>
<xsl:variable name="date"><xsl:value-of
select="head/meta/@date"/></xsl:variable>
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="page"
margin-left="1.2in" margin-right="0.8in"
margin-top="0.8in" margin-bottom="0.8in">
<fo:region-before region-name="header" extent="0.25in"
background-color="#ffffff"/>
<fo:region-after region-name="footer" extent="0.4in"
background-color="#ffffff"/>
<fo:region-body region-name="body"
margin-top="0.35in" margin-bottom="0.5in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:static-content flow-name="header"
font-family="sans-serif" font-size="12pt" font-style="normal">
<fo:block border-bottom-width="1px" border-bottom-style="solid">
<fo:list-block>
<fo:list-item>
<fo:list-item-label>
<fo:block font-weight="normal" text-align="start">
<xsl:value-of select="$pagetitle"/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body>
<fo:block font-weight="normal" text-align="end">
<fo:page-number/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="footer"
font-family="sans-serif" font-size="10pt" font-style="normal">
<fo:block border-top-width="1px" border-top-style="solid"
text-align="start">
<fo:list-block>
<fo:list-item>
<fo:list-item-label>
<fo:block font-weight="bold" text-align="start">
<xsl:value-of select="$title"/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body>
<fo:block font-weight="normal" text-align="end">
by <xsl:value-of select="$author"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label>
<fo:block font-weight="normal" text-align="start">
<xsl:value-of select="$version"/>,
updated on <xsl:value-of select="$date"/>
</fo:block>
</fo:list-item-label>
(Continued on next part...)
Part:
1
2
3
4
|