Docbook XML: Image in the Page Header

Discussion in 'XML' started by Simon Stuber, Jan 13, 2004.

  1. Simon Stuber

    Simon Stuber Guest

    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
    Simon Stuber, Jan 13, 2004
    #1
    1. Advertising

  2. In article <>,
    Simon Stuber <> wrote:

    % 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.
    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Jan 13, 2004
    #2
    1. Advertising

  3. Simon Stuber

    Simon Stuber Guest

    Patrick,

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

    Simon



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Simon Stuber, Jan 13, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cougarkhan

    DocBook vs XML

    Cougarkhan, Jul 22, 2003, in forum: XML
    Replies:
    1
    Views:
    451
    Christopher Browne
    Jul 22, 2003
  2. Markus Hoenicka

    can't create PDFs from DocBook XML

    Markus Hoenicka, Aug 5, 2003, in forum: XML
    Replies:
    0
    Views:
    312
    Markus Hoenicka
    Aug 5, 2003
  3. Antonio Amato
    Replies:
    2
    Views:
    1,255
    Michael Wiedmann
    Nov 18, 2004
  4. Replies:
    1
    Views:
    509
    Joseph Kesselman
    Nov 27, 2007
  5. mlt
    Replies:
    2
    Views:
    809
    Jean-Marc Bourguet
    Jan 31, 2009
Loading...

Share This Page