Open getreu opened 8 years ago
A piece of code to start with:
<xsl:template name="book.titlepage.before.recto">
<fo:block>​
<fo:external-graphic src="url(titlepage-image.svg)" margin="0"/></fo:block>
</xsl:template>
The attribute for Asciidoctor PDF is documented here: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#theme-related-document-attributes
Thank you. I did not know about this document. Impressing how easy asciidoctor-pdf
can be customized.
In asciidoctor-fopub I have customized this by using below configuration: And passing this on the command line while generating a book.
<xsl:template name="front.cover">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference">titlepage-cover-image</xsl:with-param>
<xsl:with-param name="content">
<fo:block text-align="center">
<fo:external-graphic src="url(book/cover-images/front-cover/in-digital-front-cover.png)" content-height="9in" content-width="7in"/>
</fo:block>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
Here is the detailed description http://stackoverflow.com/questions/34932347/how-to-generate-a-cover-image-picture-with-asciidoctor-fopub
Thank you!
Concerning the asciidoctor
xml output, this is what docbook expects: See cover
<book xmlns='http://docbook.org/ns/docbook'>
<info>
<title>DocBook</title>
<subtitle>The Definitive Guide</subtitle>
<!-- THIS IS FRONT COVER -->
<cover>
<mediaobject>
<imageobject>
<imagedata fileref="graphics/duck-cover.png">
</imagedata>
</imageobject>
</mediaobject>
</cover>
<!-- THIS IS BACK COVER -->
<cover>
<mediaobject>
<imageobject>
<imagedata fileref="graphics/duck-backcover.png"/>
</imageobject>
</mediaobject>
</cover>
</info>
<preface>
<title>Preface</title>
<para>DocBook provides a system …</para>
</preface>
<!-- … -->
</book>
asciidoctor
translate :front-cover-image:
to <cover>
when -b docbook
<cover>
in asciidoctor-fopub
Make asciidoctor translate :front-cover-image: to
<cover>
when -b docbook
I'd be glad to implement this. We can support both front and back. Great idea. Can you file in issue in asciidoctor core?
This post was updated on Oct 27, 2016; 10:12am. I just discovered the new attribute
:front-cover-image:
for asciidoctor-pdf. I will try to implement something similar for asciidoctor-fopub. Help or ideas are very much appreciated.It will render the svg-image instead of a titlepage.