将 PDF 拆分至末尾
Contents
[
Hide
]
将 PDF 拆分至末尾
此 Java 示例提取从第 2 页开始的所有页面。
步骤
- 创建一个
PdfFileEditor实例。 - 调用
splitToEnd使用源文件、起始页码和输出文件。 - 保存生成的 PDF 文档。
public static void splitPdfToEnd(Path inputFile, Path outputFile) {
PdfFileEditor pdfFileEditor = new PdfFileEditor();
pdfFileEditor.splitToEnd(inputFile.toString(), 2, outputFile.toString());
}