Adding title to PDF output

Here should go questions about transforming XML with XSLT and FOP.
yoyopoc
Posts: 1
Joined: Fri Oct 14, 2011 7:27 pm

Adding title to PDF output

Post by yoyopoc »

Hi,
Using Docbook5 book and currently have section title showing in PDF header for pages, trying to find a way of adding the <part> title to all pages. I'm a complete newbie but a good learner:)
Radu
Posts: 9439
Joined: Fri Jul 09, 2004 5:18 pm

Re: Adding title to PDF output

Post by Radu »

Hi,

You need good knowledge of XSLT and XPath in order to make customizations in the Docbook stylesheets.

Also this manual is a very good resource:
http://sagehill.net/docbookxsl/CustomizingPart.html

I'll try to give you some hints, but it's also a good idea to register and ask customization questions on the Docbook Apps users list which is very active.
We are using DITA for our user manual so I might not give you the best possible way.

So in the stylesheet:

OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo/pagesetup.xsl

there is an XSLT template called header.table which is used to render the content in the header which gets repeated on each page.

This template calls a template called header.content which has in it code like:

Code: Select all

 <xsl:when test="($sequence='odd' or $sequence='even') and $position='center'">
<xsl:if test="$pageclass != 'titlepage'">
<xsl:choose>
<xsl:when test="ancestor::d:book and ($double.sided != 0)">
<fo:retrieve-marker retrieve-class-name="section.head.marker"
retrieve-position="first-including-carryover"
retrieve-boundary="page-sequence"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:when>
That apply templates then matches templates located in the stylesheet:
OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/common/titles.xsl

You can use our XSLT debugger to see from which location in the stylesheet the header content is computed in the output XSL-FO and maybe attempt some modifications.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply