action.skip

How to control the PDF page counter?

← PDF and Email FAQ

Generally, JustOn prints the page number for produced PDF files. The templates by default include the pattern [PageLabel] [PageCounter] [OfLabel] [NumberOfPages] (see Built-In Placeholders) in the field Info Left (hidden on the first page, see PDF Contents). This produces a string like, for example, Page 2 of 4 in the top left corner of the page starting with the second page of a document.

Your business may require to modify the page counter display – move it to another area on the page or change a label. Assume, for example, you want the page counter on the page bottom and "of" replaced with a slash character.

To this end, proceed as follows:

  1. Open the template to be edited.
  2. In the Header & Footer section, delete the string [PageLabel] [PageCounter] [OfLabel] [NumberOfPages] from the Info Left field and insert it in the Footer field.
  3. In the Overrides section, add the following JSON expression to the Override Labels field:

    {
        "Calculated": {
            "OfLabel": "/"
        }
    }
    

Since the footer is printed on every page of the PDF file, the page counter will be visible from page 1, and display like Page 1 / 2 for a two-page document.