1 回答
TA贡献1851条经验 获得超3个赞
页面标签配置适用于您设置的页面以及所有连续页面。因此,要使第 2 页及以后的页面具有标准的阿拉伯数字,只需确保显式设置配置即可。对于您提到的情况,代码大致如下:
PdfPage page = pdfDocument.getPage(1);
page.setPageLabel(PageLabelNumberingStyle.UPPERCASE_ROMAN_NUMERALS, "Cover", 1);
page = pdfDocument.getPage(2);
int pageNumToStartFrom = 2; // Replace it with 1 if you want the blocks to be numbered independently
page.setPageLabel(PageLabelNumberingStyle.DECIMAL_ARABIC_NUMERALS, null, pageNumToStartFrom);
page = pdfDocument.getPage(4);
pageNumToStartFrom = 4; // Replace it with 1 if you want the blocks to be numbered independently
page.setPageLabel(PageLabelNumberingStyle.UPPERCASE_ROMAN_NUMERALS, null, pageNumToStartFrom);
添加回答
举报
