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:

  • deckjs, for deck.js
  • revealjs, for reveal.js
  • impressjs, for impress.js
  • dzslides, for DZSlides
  • flowtimejs, for Flowtime.js
  • googlehtml5, for Google html5slides
  • spf, for Slide Presentation Framework
  • remarkjs, for remark.js
  • ruban, for ruban. Note that the ruban profile expects to find the Ruban object in the global variable ruban. The minimum version of Ruban is 0.3.2.

deck2pdf --profile=deckjs

同时服务器的默认浏览器更改为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#/

你可能感兴趣的:(html to pdf)