Forum How do I...?

PrinceXML: Page Breaks in Deki

ricky.how
Background
We are using Deki's transclusion mechanism (wiki.page) to assemble a single document from individual wiki pages. When printed, we want to force a page break before each wiki page.

Approach
We have modified /var/www/dekiwiki/skins/common/prince.content.css by adding the following rule:

#topic h1#title {
page-break-before: always;
}

Result
So far, no page breaks. Any ideas how to get the desired page breaks?
jim_albright
Try changing color or something else that you can easily see that it is happening. Usually this means that you haven't selected the tag.

Jim Albright
Wycliffe Bible Translators

mikeday
Do you really have multiple <h1> elements all with the same id value ("title"), or should that be a class instead, eg. h1.title?
ricky.how
I found that I was selecting the wrong element. The element I need to target is a div class called map_subtitle. I can select it and change its color, but still no luck with the page-break-before property.

This is my initial experience with Prince so I am surely overlooking something. Do I need to define other properties before page breaks are even possible?
mikeday
No, you should be able to break before or after any block element using the page-break-before and page-break-after properties.
ricky.how
I had the page breaks all along! Deki has a button to print and it gives you a rendition of the print job. However you need to go into Print Preview to see the pagination. Problem solved...

UPDATE
Problem not solved! When you press Print Page Deki offers 2 buttons
- Print Preview (which paginates)
- Save as PDF (which does not paginate)

The CSS that get used for each rendering isn't the same. Prince.content.css seems to affect only the Print Preview.

There are also prince.css file and print.css files. Which is the one that needs to be changed to work with Save as PDF?