I hope a new thread is appropriate here. Others have had issues applying counter-reset to various elements in their source. My problem involves using counter-reset on the "pages" counter, but counter-reset seems to be evaluated just fine.
Our printed reports contain information on multiple people. We number our pages "[page] of [pages]" and reset both counters after each person. When trying to reproduce our current reports in HTML with Prince, I'm unable to reset the "pages" counter to achieve this effect.
With the start of each new person I'm generating a footer table (static flow in @bottom) which has:
Also with the start of each new person we display that person's primary information in a table. This table uses the class "header_visit" and I'm associating the reset-counter with this class:
I should note that .header_visit appears twice in the <style> block of the page. Multiple css files are dumped into a <style> block (Prince sees no external links). The first instance is from a reusable CSS file, the second from the specific report implementation.
The counter-reset on "page" works fine, but if I put in the reset line for "pages" the entire CSS block fails. With just the reset on "page", I get:
Page 1 of 4
Page 2 of 4
Page 3 of 4
-- new person, counters reset --
Page 1 of 4
I've tried a solution suggested in another thread for the footer content:
But .header_visit doesn't seem to be working or isn't the proper way to express "the next instance of an item with class 'header_visit'." In this solution, the entire content: statement fails and I get no page numbering at all.
I can use custom counters, or I can generate a "reset div" with a unique ID for each new person, but these implementations are more cumbersome and less clean.
Is there a possibility I've missed or have I goofed up somewhere?
Our printed reports contain information on multiple people. We number our pages "[page] of [pages]" and reset both counters after each person. When trying to reproduce our current reports in HTML with Prince, I'm unable to reset the "pages" counter to achieve this effect.
With the start of each new person I'm generating a footer table (static flow in @bottom) which has:
content: "Page " counter(page) " of " counter(pages);
Also with the start of each new person we display that person's primary information in a table. This table uses the class "header_visit" and I'm associating the reset-counter with this class:
.header_visit {
counter-reset: page 1;
counter-reset: pages 1;
}
I should note that .header_visit appears twice in the <style> block of the page. Multiple css files are dumped into a <style> block (Prince sees no external links). The first instance is from a reusable CSS file, the second from the specific report implementation.
The counter-reset on "page" works fine, but if I put in the reset line for "pages" the entire CSS block fails. With just the reset on "page", I get:
Page 1 of 4
Page 2 of 4
Page 3 of 4
-- new person, counters reset --
Page 1 of 4
I've tried a solution suggested in another thread for the footer content:
content: "Page " counter(page) " of " target-counter(".header_visit", page);
But .header_visit doesn't seem to be working or isn't the proper way to express "the next instance of an item with class 'header_visit'." In this solution, the entire content: statement fails and I get no page numbering at all.
I can use custom counters, or I can generate a "reset div" with a unique ID for each new person, but these implementations are more cumbersome and less clean.
Is there a possibility I've missed or have I goofed up somewhere?