Page 1 of 1

Customize cover page

Posted: Tue Jun 12, 2018 4:12 pm
by ThomasX
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]

Re: Customize cover page

Posted: Wed Jun 13, 2018 4:30 pm
by Dan
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 {
..
}

Re: Customize cover page

Posted: Wed Jun 13, 2018 4:35 pm
by Dan
You might find useful the CSS property text-decoration:overline instead of using a border.

Re: Customize cover page

Posted: Wed Jun 13, 2018 5:41 pm
by ThomasX
Thank you Dan, it works. The css property text decoration overline cannot be used because I have adjust the line width. :D

Re: Customize cover page

Posted: Fri Jun 22, 2018 10:17 pm
by shudson310
I'm trying to add a logo to the cover, and build the publication title, but am only seeing the booktitle contents display.

Here's the variables I set:

Code: Select all

 :root {
font-family: 'Helvetica Neue', sans-serif;
font-size:10pt;
string-set: prodname oxy_xpath("//bookmeta//prodinfo/prodname");
string-set: prodversion oxy_xpath("//bookmeta//prodinfo/vrmlist/vrm/@version") "." oxy_xpath("//bookmeta//prodinfo/vrmlist/vrm/@release") "." oxy_xpath("//bookmeta//prodinfo/vrmlist/vrm/@modification");
string-set: category oxy_xpath("//bookmeta//category[last()]");
string-set: creationdate oxy_xpath("//bookmeta//created/@date[1]");
string-set: copyrfirst oxy_xpath("//bookmeta/bookrights/copyrfirst/year");
string-set: copyrlast oxy_xpath("//bookmeta/bookrights/copyrlast/year");
string-set: companyname oxy_xpath("//bookmeta/bookrights/bookowner/organization");
string-set: bookrights oxy_xpath("//bookmeta/bookrights/summary");
string-set: permission oxy_xpath("//bookmeta/permissions/@view");
}
Based on the earlier thread, I'm trying to use:

Code: Select all

front-page {
page: front-page;
}

front-page-title{
color:transparent;
font-size: 2em;
width: 80%;
font-weight:bold;
margin-left:auto;
margin-right:auto;
content:none;
}
front-page-title:before(3) {
content: url("../../images/logo.print.png");
display:block;
padding-left: 0px;
padding-top: 20px;
}
front-page-title:before(2){
content: string(prodname) string(prodversion) !important;;
display:block;
color:black;
}
front-page-title:before(1){
content:string(category);
display:block;
color:black;
}
However, all I am getting is the value of booktitle centered on the page. What am I missing?

Re: Customize cover page

Posted: Mon Jun 25, 2018 12:14 pm
by Dan
See the response from: post48027.html#p48027