Forum How do I...?

per-chapter page counts?

oliof
I would like to know how many pages a chapter has and what page count of it's chapter a given page has. Is that possible to do within prince?
mikeday
One thing you can do is restart the page counter at the beginning of a chapter, using "counter-reset: page" and use a link to the end of the current chapter with target-counter to get the page number of the last page of the chapter. Would that help?
oliof
Doesn't that kill per-book page counts?

Maybe a bit more of detail: I want automagically generate progressbar like graphics for the header for each chapter that reflect where in the chapter you are. And of course, I want to keep page numbers, too.
mikeday
Sounds tricky. How will you represent the progress bar, will it change length on each page? I can't think of any way to do that with CSS.
oliof
a number of symbols equal to the number of pages (i.e., a dash: -), the current page count being represented by another symbol (i.e., an equals sign: =). Page 5 of an eight page chapter would have this:

----=---
mikeday
That sounds cool, but I have no idea how to do it with CSS. :) It seems like the sort of feature that might require scripting support.