chrome headless在命令行把html生成pdf

chrome 编程进阶笔记
发布日期 2023-01-30 更新日期 2023-01-30 阅读次数 189 文章字数 151

chrome headless 模式可以不打开浏览器而仅使用命令行执行命令

打开cmd,生成

chrome --headless --disable-gpu --print-to-pdf-no-header --print-to-pdf=D:/212.pdf file:///D:/1.html

会把 D:/1.html 生成 D:/212.pdf。


参考资料

chromium文档


文章作者: 朱丰华

文章链接: https://smart.52dixiaowo.com/blog/post-335.html

版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。

chrome

发表评论

相关推荐
朱丰华   |   1个月前   |   对象 · 属性 · 反射 · js

js 对象反射 Reflect

73    评论    点赞
朱丰华   |   1个月前   |   启动 · php

debian12开机启动sh

128    评论    点赞
朱丰华   |   3个月前   |   sql · mysql · 字节 · 字符

mysql常用字段类型详解

106    评论    点赞
朱丰华   |   11个月前   |   git

git从缓存中移除数据git rm --cached

479    评论    点赞
朱丰华   |   11个月前   |   php

php判断是否被iframe

297    评论    点赞
朱丰华   |   1年前   |   checkbox

checkbox默认传值问题

449    评论    点赞
朱丰华   |   1年前   |   页面 · 监听

iframe子父页面信息传递与监听

504    评论    点赞
朱丰华   |   1年前   |   linux · upx

Linux下安装UPX

549    评论    点赞
朱丰华   |   1年前   |   linux

linux保持后台进程不被关闭nohup &

304    评论    点赞
朱丰华   |   1年前   |   php

php正则表达式定界符:异常Delimiter must not be alphanumeric or backslash

231    评论    点赞
朱丰华   |   1年前   |   git

git push -u参数是什么意思?--set-upstream

335    评论    点赞
朱丰华   |   1年前   |   git · hub · 仓库

go克隆并引用github仓库

189    评论    点赞
朱丰华   |   1年前   |   sql · mysql

mysql Timestamp或dateTime格式筛选

166    评论    点赞
朱丰华   |   1年前   |   javascript

通过Javascript获得页面元素的字体大小

179    评论    点赞
{{item.author_name}}   |   {{new Date(item.date*1000).log()}}   |   {{it}} ·

{{item.title}}

{{item.uv}}    评论    点赞