多个pdf合并为一个
//aspose.pdf的包
PdfFileEditor pdfFileEditor=new PdfFileEditor();
//多个证书的路径
String[] paths={"机构证书0.pdf","机构业务证书1.pdf","机构个人证书2.pdf"};
//第二个参数,合并后的路径
pdfFileEditor.concatenate(paths,"123.pdf");
多个word合并为一个
aspose-words的包
@Test
public void test4() throws Exception {
//将doc1和doc2合并后保存到doc3中
Document doc1 = new Document( "C:\\Users\\HHH\\Desktop\\上传文件\\会议记录123.docx" );
Document doc2 = new Document( "C:\\Users\\HHH\\Desktop\\上传文件\\商户受损.docx" );
com.aspose.words.Document doc3 = new Document();
doc3.removeAllChildren();
doc3.appendDocument( doc1, ImportFormatMode.USE_DESTINATION_STYLES );
doc3.appendDocument( doc2, ImportFormatMode.USE_DESTINATION_STYLES );
doc3.save( "C:\\Users\\HHH\\Desktop\\上传文件\\333.docx" );
System.out.println( "合并完成" );
}