Back-side cover in PDF document

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Back-side cover in PDF document

Jeremie Bresson
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[]
Reply | Threaded
Open this post in threaded view
|

Re: Back-side cover in PDF document

mojavelinux
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[]


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)?

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[]



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Back-side-cover-in-PDF-document-tp5585.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Back-side cover in PDF document

Jeremie Bresson
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?
Reply | Threaded
Open this post in threaded view
|

Re: Back-side cover in PDF document

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

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?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Back-side-cover-in-PDF-document-tp5585p5648.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Back-side cover in PDF document

Jeremie Bresson
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).
Reply | Threaded
Open this post in threaded view
|

Re: Back-side cover in PDF document

mojavelinux
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}/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).


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Back-side-cover-in-PDF-document-tp5585p5657.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux