/**
* Maps a map of {@link PdfPageLabel} to a {@link PdfPageLabels} instance that can be used as input for the PdfCopy.
*
* @param labels
* @param totalPages
* @return the resulting {@link PdfPageLabels}
*/
public static PdfPageLabels getLabels(Map<Integer, PdfPageLabel> labels, int totalPages) {
PdfPageLabels retVal = new PdfPageLabels();
for (Entry<Integer, PdfPageLabel> entry : labels.entrySet()) {
PdfPageLabel label;
if (entry.getKey() <= totalPages) {
label = entry.getValue();
retVal.addPageLabel(entry.getKey(), PAGE_NUMBERS_STYLES.get(label.getNumberingStyle()),
label.getLabelPrefix(), label.getLogicalPageNumber());
} else {
LOG.warn("Page number out of rage, {} will be ignored.", entry.getValue());
}
}
return retVal;
}
PageLabelUtils.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:sejda-itext5
作者:
评论列表
文章目录