It might be possible to solve this issue using a small variation of the JavaScript hack I posted here:
http://www.princexml.com/forum/topic/2568/marks-crop-cross-over-the-top#17433You would still have to run Prince twice though, just to copy some information from the output of the first run and insert it into the script. Here's some JavaScript that would create two distinct, serial sets of page numbers depending on CSS selectors matching content inside a given page. Be sure to edit the suppressPageNumForSelectors list. The output you'll need to paste will look slightly different, otherwise the steps in the post I link to above apply.
(function(){
// This list can be customized by hand or auto-generated
var pages = {};
// If you wish to auto-generate the list, add
// CSS selectors matching elements that should
// "suppress" page numbers here and run Prince once,
// then paste the output above:
var suppressPageNumForSelectors = ['div.notes'];
var numNotePagesSofar = 0;
Prince.addScriptFunc("pageNumOrNot", function(num) {
if(num in pages){
numNotePagesSofar = pages[num];
return 'Notes p ' + numNotePagesSofar;
}
num = parseInt(num, 10);
return '' + (num - numNotePagesSofar);
});
// Below is code for auto-generating the list of pages that page numbers
// should be omitted for
Prince.trackBoxes = true;
Prince.addEventListener("complete", function() {
var pages = {};
var numSeenNotePages = 0;
var lastSeenNotePage = null;
for(var i = 0; i < suppressPageNumForSelectors.length; i++) {
var elms = document.querySelectorAll(suppressPageNumForSelectors[i]);
for(var j = 0; j < elms.length; j++) {
var boxes = elms[j].getPrinceBoxes();
for (var k = 0; k < boxes.length; ++k) {
if(boxes[k].pageNum !== lastSeenNotePage) {
numSeenNotePages++;
lastSeenNotePage = pages[boxes[k].pageNum];
}
pages[boxes[k].pageNum] = numSeenNotePages;
}
}
}
console.log('// Paste this code into the script to suppress listed page numbers:');
console.log('var pages = ' + JSON.stringify(pages));
});
})();
Announcement: repos for tests/utils