customize PDF output

Post here questions and problems related to editing and publishing DITA content.
catherine
Posts: 158
Joined: Fri Nov 10, 2017 8:16 am

customize PDF output

Post by catherine »

Hi, I want to add a customized PDF cover.
I followed by your suggestion, go to https://github.com/radu-pisoi/com.oxyge ... ion.sample and download the sample project as a zip file.

I tested the sample project. The PDF cover was changed successfully.
But still have some problem with the PDF output:
1: The section title, topic title don't show correctly if the language is Chinese. It shows ### instead of Chinese characters.
2: How to remove "Chapter X" before the 1st-level title?
For now, the 1st-level titles show as below:
Chapter 1. Introduction
Chapter 2. Getting Started
Chapter 3......

I want to remove the default "Chapter X", and display as:
Introduction
Getting Started
......

How to do that?
Thanks for your any response!
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: customize PDF output

Post by Dan »

Hello,

To remove the chapter labels from the table of contents and titles, please add these selectors to your customization CSS:

Code: Select all


/* Titles in the TOC. */
*[class ~= "map/topicref"][is-part] > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before{
content:none !important;
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before{
content:none !important;
}

/* Titles in the content. */
*[class ~= "topic/topic"][is-part] > *[class ~= "topic/title"]:before {
content:none !important;
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"]:before {
content:none !important;
}
Please read more about fonts here:

https://www.oxygenxml.com/doc/versions/ ... aid-title3

The ideea is to declare fonts capable of rendering Chinese characters and/or add fallback fonts to the titles. This is an example:

Code: Select all


*[class~= "topic/title"] {
font-family: Calibri, SimSun, "Malgun Gothic";
}

Let me know if you need more information.
Many regards,
Dan
catherine
Posts: 158
Joined: Fri Nov 10, 2017 8:16 am

Re: customize PDF output

Post by catherine »

Thanks, Dan.
Your suggestions helped me!
But, still have one question.
If I have Chinese character in "codeph" attribute, the PDF output will show the character as ####
Can I solve this problem?
Or, it is not allowed to enter Chinese character in "codeph" attribute?
catherine
Posts: 158
Joined: Fri Nov 10, 2017 8:16 am

Re: customize PDF output

Post by catherine »

Hi, Dan
I fixed the problem of "codeph", Thank you!! :D
Post Reply