2. How Do I Generate Page Numbers?

Using generated content and the counter property, you can display the page number:

@page{
    counter-increment: page;
    @bottom-right {
        content: "Page " counter(page) " / " counter(pages);
    }
}

According to the code above, the number of the current page and the number of total pages are shown on every page using decimal values. The pages counter is available by default.

Note:

When the output of PDFreactor is appended after an existing PDF document, the page counter of the output generated by PDFreactor does not know anything about the number of pages of the PDF document it will be appended to. To ensure the page numbering is correct when appending the output of PDFreactor to an existing PDF document, you can use the applicationValue("com/realobjects/pdfreactor/start-page-number") function.

Example:

@media print{
  @page:first {
    counter-reset:
      page applicationValue("com/realobjects/pdfreactor/start-page-number");
    }
  @page{
    margin: 1.3cm;
    counter-increment: page;
  }
}