Forum How do I...?

continous page numbering across multiple html docs

damian
I have a number of html documents, one per chapter plus title page, etc. and all html docs use the same css file.

I've setup page numbering easy enough but can't get the numbers to run consecutively in the pdf output. As it is each chapter starts at 1, but should continue from the previous chapter, e.g. chapter 1 end on page 9, chapter 2 should start on page 10.

Currently my css is:

@page main { size: A4 portrait;
		margin: 20mm;
	@top-center {
		content: "Book title";
				}

	@bottom-center {
		content: counter(page);
				}


I know the answer must be pretty logical, but evades me.

Many thanks
mikeday
That's odd. Are there any other CSS rules being applied, perhaps to reset the page counter?

If you run "prince -s style.css chap1.html chap2.html -o out.pdf" with the files attached below it should generate a PDF file that has "1" and "2" in the top page margin, as expected.
  1. chap1.html0.1 kB
  2. chap2.html0.1 kB
  3. style.css0.0 kB
damian
Note sure if this will have anything to do with it, but II use the
--input=FILENAME
to feed all the html files and are listed as
cover-print.html
toc.html
ch001.xhtml
ch002.xhtml
ch003.xhtml
etc


My css that deals with print is
@page main { size: A4 portrait;
		margin: 20mm;
	@top-center {
		content: "Making the Grade ~ Grade 4-6 Parent Handbook";
		font-size: 10pt;
		font-family: "Helvetica Neue", Helvetica, sans-serif;
				}

	@bottom-center {
		content: counter(page);
		font-size: 10pt;
		font-family: "Helvetica Neue", Helvetica, sans-serif;
		color: #000;
				}

	@bottom-right {
		content: "© Macrat Publishing";
		font-size: 8pt;
		font-family: "Helvetica Neue", Helvetica, sans-serif;
		color: #000;
				}
}

.page-footer
{
	font-size: 8pt;
	display: block;
}

@page cover-page {
	margin:0;
	padding:0;
	@top-center {
		content: "";
		}
	@bottom-center {
		content: "";
		}
}
@page toc {
	@top-center {
		content: "";
		}
	@bottom-center {
		content: "";
		}
}

body
{
	page: main;
	counter-reset: page 1;
	font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
	line-height: 1.55;
	margin: 5px;
	padding: 0;
	orphans: 2;
	widows: 2;
}

mikeday
The "counter-reset: page 1" will reset the page counter to 1 for the <body> element of each input document.
damian
Of course, makes sense. Knew it was staring at me. Thanks very much.