how can I change the image of my book's front cover? Currently I can see the chameleon tail (dotted version). I would like to set my own front cover picure per book. Since I'm writing on book sets it would be great to have an own image per book. But that is not necessary. In the first step the main cover will be enough.
Please give me some advises.
Regards
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
making the Geeko tail on the cover interchangeable has been an idea on the backburner for a while now -- so far though without an implementation.
DocBook has the <cover/> element for such purposes and you could write some XSLT to add your own images to the cover page. Just to remove the Geeko tail, disable the template secondary-branding (book.titlepage.templates.xsl, 47).
I will also add a parameter now, so you can remove this more easily in the future.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Done that now -- if you are using the stylesheets from the repo, there is now a parameter enable.secondary.branding which you can set to 0 and which will disable the Geeko tail.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I've read some tutorials and examples. But there are always set constant image paths in XSL. I just want to use the images set in my cover section.
In book.titlepage.template.xsl I have modified the cover section:
<!-- Cover --><fo:block-containertop="{(2 - &goldenratio;) * $height}{$unit}"left="0"absolute-position="fixed"><fo:block><fo:external-graphic><!-- That doesn't work --><xsl:attributename="fileref">url(<xsl:value-ofselect="ancestor-or-self::d:book/d:info/d:cover/d:mediaobject/d:imageobject"/>)</xsl:attribute></fo:external-graphic><!-- This is OK! <fo:external-graphic src="url('/srv/www/htdocs/docbook/images/src/jpg/candidatemanagement-cover.jpg')" width="100%" content-width="scale-to-fit"/> --></fo:block></fo:block-container>
My problem is that I don't know how to get the value of the fileref attribute of imagedata. Would be great if someone can show me the correct direction.
Regards
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
from DAPS, you should get a parameter called img.src.path. So you should be able to use concat($img.src.path,ancestor-or-self::d:book/...snip.../d:imageobject) in your value-of.
Also see, in the DAPS repo, make/pdf.mk, lines 70 + 74.
Last edit: Stefan Knorr 2016-06-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was struggling with the correct syntax a lot, hence here's a simple and working example (without positioning by a <block-container> and hard coded image file name):
Hi all,
how can I change the image of my book's front cover? Currently I can see the chameleon tail (dotted version). I would like to set my own front cover picure per book. Since I'm writing on book sets it would be great to have an own image per book. But that is not necessary. In the first step the main cover will be enough.
Please give me some advises.
Regards
Martin
Forgot to mention that I'm using the PDF output.
Regards
Martin
Hello Martin,
making the Geeko tail on the cover interchangeable has been an idea on the backburner for a while now -- so far though without an implementation.
DocBook has the
<cover/>
element for such purposes and you could write some XSLT to add your own images to the cover page. Just to remove the Geeko tail, disable the templatesecondary-branding
(book.titlepage.templates.xsl
, 47).I will also add a parameter now, so you can remove this more easily in the future.
Done that now -- if you are using the stylesheets from the repo, there is now a parameter
enable.secondary.branding
which you can set to 0 and which will disable the Geeko tail.Hello Stefan,
thank you. I will try to create my own XSLT. Unfortunately, I have only a rudimentary knowledge here. But I will try.
Hi Martin,
if you need some help about writing customizing layers, maybe this link is useful for you:
http://doccookbook.sourceforge.net/html/en/dbc.common.dbcustomize.html
Hope it helps,
Tom
Well, I've read some tutorials and examples. But there are always set constant image paths in XSL. I just want to use the images set in my cover section.
For example I have the following DocBook sources:
In book.titlepage.template.xsl I have modified the cover section:
My problem is that I don't know how to get the value of the fileref attribute of imagedata. Would be great if someone can show me the correct direction.
Regards
Martin
Hi Martin,
from DAPS, you should get a parameter called
img.src.path
. So you should be able to useconcat($img.src.path,ancestor-or-self::d:book/...snip.../d:imageobject)
in yourvalue-of
.Also see, in the DAPS repo,
make/pdf.mk
, lines 70 + 74.Last edit: Stefan Knorr 2016-06-14
Thank you Stefan.
I was struggling with the correct syntax a lot, hence here's a simple and working example (without positioning by a
<block-container>
and hard coded image file name):