创建 PDF 小册子
Contents
[
Hide
]
创建 PDF 小册子
使用 PdfFileEditor.makeBooklet 将现有 PDF 的页面重新排列成小册子顺序。
步骤
- 创建一个
PdfFileEditor实例。 - 呼叫
makeBooklet使用源 PDF 和输出文件。 - 保存小册子文档。
- 如果要检查返回状态,请使用布尔返回的变体并处理失败的结果。
Java 示例
public static void createPdfBooklet(Path inputFile, Path outputFile) {
PdfFileEditor bookletMaker = new PdfFileEditor();
bookletMaker.makeBooklet(inputFile.toString(), outputFile.toString());
}
public static void tryCreatePdfBooklet(Path inputFile, Path outputFile) {
PdfFileEditor bookletMaker = new PdfFileEditor();
if (!bookletMaker.makeBooklet(inputFile.toString(), outputFile.toString())) {
System.out.println("Failed to create booklet.");
}
}