On Fr, 2007-02-09 at 20:44 +0000, Ross Gardler wrote:
> [EMAIL PROTECTED] wrote:
> > How do I turn off the summary that's being created above my table of
> > contents in each of the page-level PDFs? It appears to be generated
> > by the PDF Outline XSLT in common skins (src\documentation\skins
> > \common\xslt\fo\pdfoutline.xsl), but I'm not positive.
>
> You are correct in that pdfoutline.xsl generates the outline. This is
> called from the root document-2-fo.xsl.
>
> Currently there is no configuration option for removing this outline.
> Adding one in is an easy job, just look at the way skinconf.xml values
> are used elsewhere in document-2-fo.xsl. Of course, you could create
> your own skin and provide your own XSL that does not call the outline.
> But providing a patch to make it configurable would be well recieved here.
I also wanted to turn off the TOC, so I patched the 0.8
main/webapp/skins/common/xslt/fo/document-to-fo.xsl - see attachement. I
don't know where "forrest seed" takes the skinconf.xml from, so I didn't
patch anything related to that. Here's what I added to my project's
skinconf.xml:
...
<!--
Disable the generation of the table of content on the first page
of the PDF. By default the TOC is generated.
-->
<disable-toc>true</disable-toc>
</pdf>
There's one problem with the patch: if <disable-toc> is not set in
skinconf.xml, then the TOC is disabled nevertheless. I'm not sure why;
what is the xsl:variable "disable-toc" set to in that case?
If <disable-toc> is present, then it works as expected: only "true"
disables the TOC, any other string generates the TOC.
--
Bye, Patrick Ohly
--
[EMAIL PROTECTED]
http://www.estamos.de/
Index: main/webapp/skins/common/xslt/fo/document-to-fo.xsl
===================================================================
--- main/webapp/skins/common/xslt/fo/document-to-fo.xsl (revision 535637)
+++ main/webapp/skins/common/xslt/fo/document-to-fo.xsl (working copy)
@@ -22,6 +22,8 @@
<xsl:variable name="text-align" select="string(//skinconfig/pdf/page/@text-align)"/>
<!-- print URL of external links -->
<xsl:variable name="show-external-urls" select="//skinconfig/pdf/show-external-urls"/>
+<!-- disable the table of content (enabled by default) -->
+ <xsl:variable name="disable-toc" select="//skinconfig/pdf/disable-toc"/>
<!-- Get the section depth to use when generating the minitoc (default is 2) -->
<xsl:variable name="toc-max-depth" select="number(//skinconfig/toc/@max-depth)"/>
<!-- The page size to be used -->
@@ -247,7 +249,7 @@
<xsl:apply-templates select="footer"/>
</fo:block>
<!-- don't list page number on first page if it's contents is just the TOC -->
- <xsl:if test="not($toc-max-depth > 0 and $page-break-top-sections)">
+ <xsl:if test="$disable-toc = 'true' or not($toc-max-depth > 0 and $page-break-top-sections)">
<xsl:call-template name="insertPageNumber">
<xsl:with-param name="text-align">start</xsl:with-param>
</xsl:call-template>
@@ -894,7 +896,7 @@
</fo:inline>
</xsl:template>
<xsl:template match="body[count(//section) != 0]">
- <xsl:if test="$toc-max-depth > 0">
+ <xsl:if test="$disable-toc != 'true' and $toc-max-depth > 0">
<fo:block font-family="serif" font-size="14pt" font-weight="bold"
space-after="5pt" space-before="5pt" text-align="justify" width="7.5in">
<xsl:call-template name="insertPageBreaks"/>