/** * @param args */ public static void main(String[] args) { //String files[] = {"E:\\workspace\\marketing\\src\\config\\template\\sales_stodelivery_seed_first.pdf", "E:\\workspace\\marketing\\src\\config\\template\\sales_stodelivery_seed_last.pdf"}; String savepath = "E:\\temp\\test.pdf"; //mergePdfFiles(files, savepath); partitionPdfFile(savepath, 1); } /** * 多个PDF合并成一个 * @param files 文件的物理全路径(包括文件名)数组 * @param savepath 合并后文件的保存路径(包括文件名) * @return 合并成功返回true,否则返回false */ public static boolean mergePdfFiles(String[] files, String savepath) { try { Document document = new Document(new PdfReader(files[0]).getPageSize(1)); PdfCopy copy = new PdfCopy(document, new FileOutputStream(savepath)); document.open(); for (int i = 0; i |