CSS-based PDF - Cannot put page breaks 1st level titles and toc

Post here questions and problems related to editing and publishing DITA content.
Julie P
Posts: 18
Joined: Fri Dec 02, 2016 7:34 pm

CSS-based PDF - Cannot put page breaks 1st level titles and toc

Post by Julie P »

Hi,
I have Oxygen XML editor version 20.1, build 2018061313.
I’m using pdf transformation scenario based on HTML5 and CSS.
I am struggling with page breaks… I cannot manage to remove page breaks before the 1st level titles and after the toc.
In my customization file, I’ve tried:

Code: Select all

*[class ~= "topic/title"] {
    page-break-before: avoid;
}

*[class ~= "topic/title1"] {
    page-break-before: avoid;

}

h1 {
    page-break-before: avoid;
}

@media print {

*[class ~= "map/topicref"] {
    page-break-after: avoid;
    page-break-inside: avoid;
}

}
Thanks
Costin
Posts: 846
Joined: Mon Dec 05, 2011 6:04 pm

Re: CSS-based PDF - Cannot put page breaks 1st level titles and toc

Post by Costin »

Hi Julie,

By design, we decided that each chapter should start a new page sequence, so we've added a custom property (an oXygen extension) for that.
You could overwrite this behavior by using in your customization CSS:

Code: Select all

*[class ~= "topic/topic"][is-chapter] {
  -oxy-page-group:auto;
}
Regarding the page break after the Table Of Contents, things are a bit more complicated.
There are different pages used in different parts of the publication (for example, the preface, the TOC, the chapters, the Index, have their own dedicated pages).
The CSS rules are matching for instance the TOC and associate the page named "table-of-contents" to that structure. This is different from the following pages, and will cause a page break. Any switch between different pages are causing page breaks.
Given this, there is no easy way to remove the page breaks between different named-pages.


Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Post Reply