Asciidoctor-PDF provides a way to add a cover page at the beginning of the document. Is there a way to add a back-side cover (an additional last page at the end of the document)?
We a looking for the possibility to add a background image and a logo; similar to the title_page: back_page: background_image: b_back-image.png logo: image: image: b_logo.png[] |
Administrator
|
Jérémie, Asciidoctor PDF supports a back cover image or PDF. However, this is not something that is currently supported in the theme. In each document, you can add: :back-cover-image: image:back-cover.pdf[] See https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#theme-related-document-attributes for details. What I recommend is using either Asciidoctor PDF or another tool to generate a 1-page PDF document, then use that as the back cover. -Dan On Thu, May 11, 2017 at 11:11 PM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote: Asciidoctor-PDF provides a way to add a cover page at the beginning of the document. Is there a way to add a back-side cover (an additional last page at the end of the document)? Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
I have tried it, and it works well.
See commit 0b29927b for an example. (I am not sure if we want to have it in the official maven-examples repo or not). --- @Dan: in the "theming-guide.adoc", there is no mention of the "back-cover-image" attribute. It this on purpose? |
Administrator
|
Great! It's up to you all whether you want to include it. I don't mind. Though I think perhaps it would reduce size if we used an SVG instead (any image format is supported). -Dan On Mon, Jun 5, 2017 at 10:58 PM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote: I have tried it, and it works well. Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
In reply to this post by mojavelinux
Is this value allowed?
:back-cover-image: image:{pdf-stylesdir}/backcover.pdf[] Where the value "pdf-stylesdir" is set in the pom: <execution> <id>asciidoc-to-pdf</id> <phase>generate-resources</phase> <goals> <goal>process-asciidoc</goal> </goals> <configuration> <backend>pdf</backend> <!-- ... --> <attributes> <!-- use the "assets" folder as "pdf-stylesdir" value --> <pdf-stylesdir>${project.build.directory}/assets</pdf-stylesdir> <!-- ... --> </attributes> </configuration> </execution> It seems to work, but I get this in the logs: asciidoctor: WARNING: image to embed not found or not readable: C:/***/git/my_project/src/docs/asciidoc/images/ image:C:/***/git/my_project/target/assets/backcover.pdf The idea behind this config is to have everything in "pdf-styledir" because I share the assets in this directory across multiple projects in our company (I unpack the assets form a maven artifact into a local folder during a previous maven build step). |
Administrator
|
That should be possible. Attribute references in attribute values are resolved immediately. You may need to check the safe mode value...probably unsafe if you want to refer to an image above the base directory. -Dan On Tue, Jun 13, 2017 at 11:19 AM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote: Is this value allowed?:back-cover-image: image:{pdf-stylesdir}/ Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |