html to pdf

成功的用法是使用 [deck2pdf] (https://github.com/melix/deck2pdf/)
并且更新java程序 改好环境变量

export PATH="/public/home/hysplit/work/study/tool/wkhtmltox/Highload_2018/deck2pdf-0.3.0/bin:$PATH"
export JAVA_HOME=/public/home/hysplit/src/jdk1.8.0_191/
export PATH=/public/home/hysplit/src/jdk1.8.0_191/bin:$PATH

java更新地址

By default, deck2pdf assumes that you are using deck.js, but there more profiles supported:

deck2pdf --profile=deckjs <inputfile> <outputfile>

同时服务器的默认浏览器更改为chrome 参考: Centos7 yum安装Chrome浏览器

一.创建yum源文件

cd /etc/yum.repo.d/
touch google-chrome.repo

二.输入yum源信息

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

三.安装google chrome

yum -y install google-chrome-stable --nogpgcheck

最后输入google-chrome 弹窗选择为默认浏览器

其他参考
css-to-pdf
export-html-css-js-report-to-pdf
how-to-efficiently-transfer-html-to-pdf
impressjs2pdf
Ability to export in PDF plain, but solid
css-page-3
JS 如何将 HTML 页面导出为 PDF

PDF Export for reveal.js

Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use Google Chrome or Chromium and to be serving the presentation from a webserver. Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.

https://revealjs.com/?print-pdf#/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容