How to restart pages counter at start of each chapter

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
mariom
Posts: 2
Joined: Tue Jun 25, 2024 3:55 pm

How to restart pages counter at start of each chapter

Post by mariom »

I'm testing PDF Chemistry and am currently testing page numbering. Currently I need to test Page 1 of #, (# is a total number of pages in a chapter). I can't find an example of how to do this via PDF Chemistry. The pages counter cannot be reset according the spec. How can I get the number of pages a chapter has?

I'm testing PDF Chemistry via the command line.
kr
Mario
julien_lacour
Posts: 544
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to restart pages counter at start of each chapter

Post by julien_lacour »

Hello Mario,

Unfortunately there's no additional page counter for the total number of pages in a chapter, Oxygen PDF Chemistry only allows you to get the current page number and the document total number of pages.

Regards,
Julien
mariom
Posts: 2
Joined: Tue Jun 25, 2024 3:55 pm

Re: How to restart pages counter at start of each chapter

Post by mariom »

Thanks for your quick reply. I'll be adding this to the feature request then.
kr
Mario
julien_lacour
Posts: 544
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to restart pages counter at start of each chapter

Post by julien_lacour »

Hello Mario,

I added the feature request to our tracking system, I will notify this thread once it will be available.

Just for clarification it is possible to reset the "page" counter but not the "pages" counter using CSS, for example with a rule similar to this one:

Code: Select all

article {
  counter-reset: page 1;
}
For DITA, a similar rule is already implemented in the default p-numbering-deep-chapter-scope.css stylesheet.
If you are using the DITA Map PDF - based on HTML5 & CSS transformation scenario you can control the page counter using the args.css.param.numbering parameter.

For more detailed information, you can refer to the Numbering and How to Make Chapters Look Like Individual Publications sections in the Oxygen XML documentation.

Regards,
Julien
Post Reply