Publishing templates pdf

Jeff_Reynolds
Posts: 10
Joined: Tue Apr 13, 2021 9:48 pm

Publishing templates pdf

Post by Jeff_Reynolds » Tue Apr 13, 2021 10:04 pm

Hi Folks,

I am new to publishing templates and I need some advice on:
  • injecting a full page graphic as a back cover page
  • Injecting copyright boilerplate page as frontmatter ahead of the TOC


I am using a modded copy of of ashes.
I have just the most tenuous grasp of CSS. Can someone explain how to complete these 2 tasks to me like I was five?

Thanks!

Jeff from Ottawa

julien_lacour
Posts: 182
Joined: Wed Oct 16, 2019 3:47 pm

Re: Publishing templates pdf

Post by julien_lacour » Thu Apr 15, 2021 9:33 am

Hello Jeff,

First you need to create a CSS style-sheet from Oxygen and insert the following content in it:

Code: Select all

/* Defines the copyright boilerplate page. */
@page second-cover {
  @top-left {content: none};
  @top-right {content: none};
  @bottom-center {content: none};
   
  background-image: url("path/to/copyright.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* Defines the back cover page. */
@page back-cover {
  @top-left {content: none};
  @top-right {content: none};
  @bottom-center {content: none};
   
  background-image: url("path/to/back-cover.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* Displays the copyright boilerplate after PDF's front-page. */
*[class ~= 'front-page/front-page']:after {
  page: second-cover;
  page-break-after: always;
  display: block;
  content: "\2002";
}

/* Displays the back cover after the last chapter (first-level topic). */
*[class ~= 'topic/topic'][is-chapter]:last-of-type:after {
  page: back-cover;
  page-break-after: always;
  display: block;
  content: "\2002";
}
You just need to update the path to your images in both cases, all images formats are supported (jpg, png, svg, etc.).

Then open the transformation dialog from DITA Maps Manager, duplicate the DITA Map PDF - based on HTML5 & CSS transformation scenario and set the args.css parameter to the path to your CSS file.

If you still have problems with the transformation, the result is not as expected or do not understand the CSS, do not hesitate to ask.

Regards,
Julien

Post Reply