Placing an image in the footer
-
- Posts: 11
- Joined: Mon Mar 25, 2013 9:52 pm
Placing an image in the footer
Hello
Another newbie question! I am creating pdf from DocBook and although I have read the Sage Hill chapter on footers, it is still not clear to me how to insert an image in the footer. Can I do this by only editing the customisation layer? Or do I have to edit the footer.content template as well?
Thanks in advance for any pointers.
Best wishes
Helen
Another newbie question! I am creating pdf from DocBook and although I have read the Sage Hill chapter on footers, it is still not clear to me how to insert an image in the footer. Can I do this by only editing the customisation layer? Or do I have to edit the footer.content template as well?
Thanks in advance for any pointers.
Best wishes
Helen
-
- Posts: 2
- Joined: Tue Jan 26, 2010 12:14 pm
Re: Placing an image in the footer
Hi Helen,
no, you do not have to customize the footer content in a separate stylesheet, but to keep things neat and tidy it is advisable.
If you don't want to do it, though, you have to add the footer.content template to your customization layer and change it, e.g. like that:
Please note that you have to consider what pageclass you want to have the picture on, in this case body, but there is also frontmatter, like titlepage, lot etc. and backmatter, like appendices, index; it is stated in the template, so you have to define the parameter for this within the stylesheet:
Also, the position has to be stated where needed, the parameter has to be defined for that also:
Also it can be important to format the layout table for the footer, probably the generated text, but these are details.
More important is probably to define the width for your picture
<xsl:variable name="footer.graphic.width">
<xsl:text>150pt</xsl:text>
</xsl:variable>
since otherwise it will get stretched or compressed.
This at least is the way I do it, hopefully it could help you a bit.
cheers,
Quintus
no, you do not have to customize the footer content in a separate stylesheet, but to keep things neat and tidy it is advisable.
If you don't want to do it, though, you have to add the footer.content template to your customization layer and change it, e.g. like that:
Code: Select all
<xsl:template name="footer.content">
<!-- Prints the referenced Picture in the center of the footer content -->
<xsl:choose>
<xsl:when test="$pageclass = 'body' and $position = 'center'">
<fo:external-graphic width="auto" padding-top="0.5em" height="auto"
content-width="{$footer.graphic.width}"src="images/Logo.png"/>
</xsl:when>
</xsl:choose>
</xsl:template>
Code: Select all
<xsl:param name="pageclass" select="''"/>
Code: Select all
<xsl:param name="position" select="''"/>
More important is probably to define the width for your picture
<xsl:variable name="footer.graphic.width">
<xsl:text>150pt</xsl:text>
</xsl:variable>
since otherwise it will get stretched or compressed.
This at least is the way I do it, hopefully it could help you a bit.
cheers,
Quintus
-
- Posts: 11
- Joined: Mon Mar 25, 2013 9:52 pm
Re: Placing an image in the footer
Hi again Quintus.
I got this working according to your instructions - thank you so much! Just one surprising result - The logo appears 3 times in the footer. It seems to me that maybe the footer has 3 columns and it is putting the logo in the centre of each column. Could this be the case?
Thanks in advance.
Best wishes,
Helen
I got this working according to your instructions - thank you so much! Just one surprising result - The logo appears 3 times in the footer. It seems to me that maybe the footer has 3 columns and it is putting the logo in the centre of each column. Could this be the case?
Thanks in advance.
Best wishes,
Helen
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Placing an image in the footer
Post by sorin_ristache »
Hi Helen,
Can you show your complete customization / custom XSLT template? From your description it's hard to tell why the logo shows up 3 times in the footer. Did you try to create a table in your custom XSLT code? I looked in the "footer.content" named template in the built-in stylesheet xsl/fo/pagesetup.xsl and it does not create a table.
Regards,
Sorin
Can you show your complete customization / custom XSLT template? From your description it's hard to tell why the logo shows up 3 times in the footer. Did you try to create a table in your custom XSLT code? I looked in the "footer.content" named template in the built-in stylesheet xsl/fo/pagesetup.xsl and it does not create a table.
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service