Page 1 of 1

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

Posted: Tue Jun 18, 2019 12:01 pm
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

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

Posted: Tue Jun 18, 2019 3:39 pm
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