Create copyright page

locke955
Posts: 2

Create copyright page

Wed Nov 08, 2017 8:05 pm

Hi!

I am using a custom CSS with Chemistry to generate PDF documents, with pretty good results. The one thing that I cannot figure out is how to create a copyright page after the cover page and before the TOC page. I have tried defining a blank page, a copyright page, and several other solutions in my CSS file, but cannot discern how to generate a blank page with copyright information in the footer.

Does anyone have a solution for solving this problem with CSS?

Cheers,

Adam
cud
Posts: 27

Re: Create copyright page

Mon Sep 03, 2018 3:37 pm

I would like to bump this issue. I'm using the new template-based transform to PDF. But I still have the same issue... I need a blank page after the title that includes copyright and a link to our EULA. Is there an obvious way to do this?

Or do I have to hack it as a separate topic in the book?
Dan
Posts: 325

Re: Create copyright page

Tue Sep 04, 2018 12:52 pm

Regular DITA maps do not have the concept of a copyright notice. This is available only in the DITA bookmap structure.
If you are constrained to using a regular map and you need to add a copyright page between the front cover and the TOC, use the following technique:
In your customization CSS, declare a new page layout:

Code: Select all

@page copyright-notice-page {
  @top-left {
    content:none; /* Clear the headers for the copyright page */
  }
  @top-right {
    content:none;
  }
}

The oxy:front-page element contains the title of the publication and generates the cover page. A synthetic :after element is created that follows this element and it is placed on a different page.

Code: Select all

front-page:after{
  display:block;
 
  page: copyright-notice-page; /* Moves the synthetic element on a new page. */
 
  margin-top:90%; /* use margins to position the text in the page */
  margin-left: 5em;
  margin-right: 5em;

  content: "Copyright 2018-2019 MyCorp Inc. \A All rights reserved";

  text-align:center; /* More styling */
  color:blue;
}

If you need to add more content as blocks, use the :after(2), :after(3) pseudo elements:

Code: Select all

front-page:after(2){
  display:block;
  page: copyright-notice-page;  /* Continue on the same page as the first ':after'. */
  content: "Some more styled text";
  color:red;
}

If you want to extract information from the document, use the oxy_xpath() function. For example, if the copyright info is stored in the map like this:

Code: Select all

 <map ...>
  <topicmeta>
    <copyright>
      <copyryear year="2018"/>
      <copyrholder>MyCorp Inc.</copyrholder>     
    </copyright>
  </topicmeta>
 ...

Use:

Code: Select all

front-page:after(3){
  display:block;
  page: copyright-notice-page;
  content: "Year: " oxy_xpath('//*:front-page/topicmeta/copyright/copyryear/@year')
           "\A Holder: " oxy_xpath('//*:front-page/topicmeta/copyright/copyrholder/text()') ;
  color:green;
}


Let me know if it worked for you,
Many regards,
Dan

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 0 guests