博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用wkhtmltopdf创建PDF文件
阅读量:7023 次
发布时间:2019-06-28

本文共 1214 字,大约阅读时间需要 4 分钟。

参考资料:

https://stackoverflow.com/questions/33146021/generating-pdf-with-wkhtmltopdf-and-download-the-pdf#

https://github.com/topics/html-to-pdf

https://www.petrikainulainen.net/programming/spring-framework/spring-from-the-trenches-creating-pdf-documents-with-wkhtmltopdf/

http://www.laozhaimen.com/article/143508.html

 

String inputPath = new File("/file.xhtml").toURI().toURL().toString(); f.getAbsolutePath()
String inputPath = new File("/file.xhtml").toURI().toURL().toString();OutputStream outputStream = new FileOutputStream("/file.pdf");ITextRenderer renderer = new ITextRenderer();renderer.setDocument(inputPath);renderer.layout();renderer.createPDF(outputStream);outputStream.close(); 使用js导出pdf https://stackoverflow.com/questions/19786113/export-html-page-to-pdf-on-user-click-using-javascript itext: https://stackoverflow.com/questions/235851/using-itext-to-convert-html-to-pdf/311303#311303 https://www.tutorialspoint.com/springmvc/springmvc_pdf.htm https://memorynotfound.com/spring-mvc-pdf-view-example/ https://www.roseindia.net/tutorial/spring/spring3/web/spring-3-mvc-fileupload-example.html http://hmkcode.com/spring-mvc-view-json-xml-pdf-or-excel/
 

转载于:https://www.cnblogs.com/yangcw/p/9038528.html

你可能感兴趣的文章
监督学习——logistic进行二分类(python)
查看>>
css中的定位和框模型问题
查看>>
linux系统下git使用
查看>>
cookie
查看>>
网站流量统计PV&UV
查看>>
说一下StoreBoard和纯代码编程各有什么好处吧
查看>>
[系统开发] 基于Ansible的产品上线系统
查看>>
pacman -Syu : key could not be looked up remotely.
查看>>
Set容器
查看>>
CFG的定义
查看>>
Java类成员的访问权限
查看>>
2018/09/04循环+运算
查看>>
HTML5与CSS3中新增的属性详解
查看>>
hdu 1176 免费馅饼 (dp)
查看>>
poj 1330 Nearest Common Ancestors (LCA)
查看>>
HDU 2196 Computer【树形DP】
查看>>
js 给链接 url或href或js、css、图片等解决浏览器缓存
查看>>
ife2015-task2-4-5
查看>>
发布的时候Archive灰色
查看>>
html 锚点的使用
查看>>