类 Html2PdfByChrome
java.lang.Object
com.gdxsoft.easyweb.utils.fileConvert.Html2PdfByChrome
用 Chrome 转换 html或url 到 pdf 文件
chrome --headless --disable-gpu --print-to-pdf=xx.pdf https://a/test.html
chrome --headless --disable-gpu --print-to-pdf=xx.pdf https://a/test.html
- 作者:
- admin
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidconvert2PDF(File inputFile, File pdfFile) 转换成PDFvoidconvert2PDF(String inputFile, String pdfFile) 转换成PDFvoidconvertUrl2PDF(String url, File pdfFile) voidconvertUrl2PDF(String url, String pdfFile) 获取 Chrome 或 Edge 的执行路径,优先使用 Chrome,不存在时回退到 Edgeboolean无页头和页脚voidsetChromeCmd(String cmd) voidsetNoHeaderAndFooter(boolean noHeaderAndFooter) 无页头和页脚
-
构造器详细资料
-
Html2PdfByChrome
public Html2PdfByChrome()
-
-
方法详细资料
-
setChromeCmd
-
convert2PDF
-
getChromeCmd
-
convert2PDF
-
convertUrl2PDF
-
convertUrl2PDF