How to split a PDF using Apache PDFBox? [closed]

对着背影说爱祢 提交于 2019-11-28 05:08:16

问题


I am using Apache PDFBox to handle PDF files in my Java application. I would like to split a PDF document, for example, on every page.

Is it possible to do this wirth Apache PDFBox? If so, how?


回答1:


This is possible using a Splitter.

This is a sample code that will split a document on every page:

PDDocument document = PDDocument.load(myPDF);
Splitter splitter = new Splitter();
List<PDDocument> splittedDocuments = splitter.split(document);

You can control the number of pages on every splitted PDF using setSplitAtPage(split).



来源:https://stackoverflow.com/questions/32259167/how-to-split-a-pdf-using-apache-pdfbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!