1
A
回答
1
不是Java,但C#的解决方案 - 作为替代PDF邮票(使用Debenu Quick PDF Library):
DPL.AddToFileList("file_list", "file_1.pdf"); //file with one page
DPL.AddToFileList("file_list", "file_2.pdf"); //file with one page
DPL.AddToFileList("file_list", "file_3.pdf"); //file with one page
DPL.AddToFileList("file_list", "file_4.pdf"); //file with one page
DPL.MergeFileList("file_list", "merged_files.pdf"); //merge the files into a new document
DPL.LoadFromFile("merged_files.pdf", ""); //load the new merged file
DPL.InsertPages(1, 1); //it is important to add a new blank page, becasue in the next steps the CapturePage function removes the pages and the document must have at least one page - the final page
int captured1 = DPL.CapturePage(2);
int captured2 = DPL.CapturePage(2); //the captured page is removed, so page numbers are decreased
int captured3 = DPL.CapturePage(2);
int captured4 = DPL.CapturePage(2);
DPL.SelectPage(1);
DPL.DrawCapturedPage(captured1, 100, 200, 100, 100); //you can set your custom coordinates: left, top, widt, height
DPL.DrawCapturedPage(captured2, 200, 200, 100, 100);
DPL.DrawCapturedPage(captured3, 300, 200, 100, 100);
DPL.DrawCapturedPage(captured4, 400, 200, 100, 100);
DPL.SaveToFile("merged_files.pdf");
0
至于纯Java的解决方案,检查出的mkl建议。我试过PDFBox solution和PDFClown solution。两者都很好。在我看来,PDFClown更为直接,因此在完成任务时不那么繁琐。例如,有很少摆弄坐标,这当然有助于安排一个多页。
相关问题
- 1. 将多个PDF文件合并为一个PDF文件
- 2. 追加多个PDF文件
- 3. 使用PFDF创建多个PDF文件?
- 4. 使用dompdf创建多个PDF文件
- 5. 从FPDF创建多个PDF文件
- 6. 如何在PHP中将多个PDF文件合并到一个单页PDF中
- 7. JAVA将.JPG和.PDF文件移动到特定位置
- 8. 从R Markdown在另一个文件位置创建PDF
- 9. 在特定页面或位置合并PDF文件ASP.NET
- 10. 如何通过特定的单词将pdf文件分割成多个pdf文件?
- 11. 从多个PDF文件中提取特定字段并写入文本文件
- 12. 转换多个PDF文件,在Windows
- 13. 在另一个.pdf文件
- 14. 使用Java将多个pdf文件压缩成单个文件zip文件
- 15. 我想水印一个PDF文件,而无需创建另一个PDF文件
- 16. 如何将多个PDF文件合并为一个PDF
- 17. 创建PDF文件
- 18. 创建PDF文件?
- 19. 在Facebook上创建链接以分享pdf和html文件的特定位置
- 20. 使用ggplot在单个PDF文件中绘制多个图片
- 21. 多个数据uri pdf文件到1文件javascript
- 22. 打印PDF到文件位置连同文件名
- 23. 在PDFBOX中创建PDF文件(从现有的pdf文件)
- 24. 从一个.ps文件创建两个pdf文件?
- 25. 从特定字节读取pdf文件到文件结尾
- 26. 多个PDF文件的密码
- 27. 用VBScript合并多个PDF文件
- 28. Zip多个数据库PDF blob文件
- 29. iOS - 从多个文件生成pdf
- 30. 从javascript下载多个PDF文件
*我想要构建包含特定位置的子pdf的主要pdf * - 我假设那些*子pdf的*只有一个页面页面,或者至少他们感兴趣的每个页面只有一个页面。在这种情况下,任何通用PDF库都应该这样做。有些PDF库明确支持(例如iText和PdfClown),而对于其他PDF功能库则很容易添加(例如PDFBox,参见[此答案](http://stackoverflow.com/a/26299557/1729265))。 – mkl 2014-10-20 08:38:04