PDF Page Numbering in Java & iText

前端 未结 3 1071
温柔的废话
温柔的废话 2020-12-11 12:38

I am creating some PDF reports using iText in Java. According to the requirements, what I should do is to number pages in the format of page_number/page_numbers_in_t

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 13:05

    you could handle page number with @page style sheet Like this @page { @top-right { content: "Page " counter(page) " of " counter(pages); } }

    And when you need page number/Total page try with this: counter(page) "/" counter(pages)

提交回复
热议问题