Customize cover page

ThomasX
Posts: 4

Customize cover page

Tue Jun 12, 2018 4:12 pm

Hi,
I'd like to use Oxygen PDF chemistry to create a PDF from a Dita map and I have some problems with the cover page. I'd like to have a line above the title name that shall be as long as the title itself. Actually this can be achieved by adapting the p-front-page.css: Just adding to the front-page-title: display: inline; border-top: 8px solid red; However, if I add further pseudo elements with front-page-title:after, the display:inline property is overwritten and the line is extended over the whole page. How is the title page created? Is it possible to add an additional element to the title page that can be styled individually? Thank you very much.

[Codebox=] front-page {
page: front-page;
}

front-page-title {
display:inline;
text-align:left;
margin-top: 3em;
font-size:40pt;
font-family:"akkurat pro", helvetica, sans-serif;
font-weight:100;
color:red;
border-top:8px solid red;
}

front-page-title:after(1) {
display:inline;
content:"\2002";
border-top:none;
clear:both;
font-size: 26pt;
color: gray;
}
front-page-title:after(2) {
display:block;
content:"\2002""\a""Benutzerhandbuch""\a""Version 4.36";
clear:both;
font-size: 26pt;
color: gray;
}[/Codebox]
Dan
Posts: 257

Re: Customize cover page

Wed Jun 13, 2018 4:30 pm

Hello Thomas,

The :after pseudo elements are "inside" the front-page-title, that is why the top border extends and covers the entire width. I propose the following workaround:
- In your DITA Map, locate the <title> element and wrap its content in a <ph outputclass="bordered"> element.

Code: Select all

<map>
  <title><ph outputclass="bordered">Growing Flowers</ph></title>
  ...

- In the CSS use:

Code: Select all


*[outputclass~="bordered"] {
  display: inline;
  margin-top: 3em;
  font-size: 40pt;
  font-family: "akkurat pro", helvetica, sans-serif;
  font-weight: 100;
  color: red;
  border-top: 8px solid red;
}


*[class~="front-page/front-page-title"],
front-page-title{
  text-align: left;
  display:block;
}


*[class~="front-page/front-page-title"]:after(1),
front-page-title:after(1) {
  display: block;
  content: "\2002";
  border-top: none;
  clear: both;
  font-size: 26pt;
  color: gray;
}

*[class~="front-page/front-page-title"]:after(2),
front-page-title:after(2) {
  display: block;
  content: "\2002" "\a" "Benutzerhandbuch" "\a" "Version 4.36";
  clear: both;
  font-size: 26pt;
  color: gray;
}



I used the CSS selectors to make sure the CSS will be compatible with the new oXygen 20.1 that will be released in a couple of days:

Code: Select all

*[class~="front-page/front-page-title"],
front-page-title {
..
}
Dan
Posts: 257

Re: Customize cover page

Wed Jun 13, 2018 4:35 pm

You might find useful the CSS property text-decoration:overline instead of using a border.
ThomasX
Posts: 4

Re: Customize cover page

Wed Jun 13, 2018 5:41 pm

Thank you Dan, it works. The css property text decoration overline cannot be used because I have adjust the line width. :D

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 2 guests