Docbook XML: Image in the Page Header

S

Simon Stuber

Hello,

I'm using Docbook XML 4.2 and FOP 0.20.5 to create a pdf from my xml
source. I can generate the pdf with no problem, however I could not
manage to include our company logo within the header. The pdf is
created with the correct header, but there is no image.

What I did:

I copied the whole header.template section from pagesetup.xsl into my
customization layer, and tried to insert the picture in the 'right'
section:

<xsl:template name="header.content">
<xsl:param name="pageclass" select="''"/>
<xsl:param name="sequence" select="''"/>
<xsl:param name="position" select="''"/>
<xsl:param name="gentext-key" select="''"/>
<fo:block>

<!-- sequence can be odd, even, first, blank -->
<!-- position can be left, center, right -->
<xsl:choose>

.... snip ...

<xsl:when test="$position='right'">
<fo:external-graphic src="logo.gif"/>
<!-- Same for odd, even, empty, and blank sequences -->
<xsl:call-template name="draft.text"/>
</xsl:when>

.... snip ...

</xsl:template>

The logo.gif is in the same directory as the xml. I also tried
<fo:external-graphic src="url('logo.gif')"/>, but it doesn't work
either.

I thought that the image might be to big to fit into the header, but
neither making it very small nor enlarging the right section of the
header was successfull.

Does anybody have an idea what is wrong? I would highly appreciate a
customization layer example with an image in the header.

Thanks a lot,

Simon Stuber
 
P

Patrick TJ McPhee

% The logo.gif is in the same directory as the xml. I also tried

This is a knee-jerk reaction: are GIF graphics supported? I'd
convert it to PNG and try with that.
 
S

Simon Stuber

Patrick,

According to the Apache FOP webpage, gif is supported natively, but not
png. I also tried bmp with the same result.

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top