python--html to pdf
生活随笔
收集整理的這篇文章主要介紹了
python--html to pdf
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
Debian/UbuntuTo install wkhtmltopdf in a Debian/Ubuntu server, follow this steps(as root):apt-get install wkhtmltopdf apt-get install xvfb echo -e '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf -q $*' > /usr/bin/wkhtmltopdf.sh chmod a+x /usr/bin/wkhtmltopdf.sh ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf wkhtmltopdf http://www.google.com output.pdfthen :
pip install pdfkitvim test.py#coding:utf-8 #__author__:Bing import pdfkit pdfkit.from_file('test.html', 'out.pdf') # Generating PDFs from strings and web-pages is equally easy: pdfkit.from_string('Hello!', 'out.pdf') pdfkit.from_url('http://google.com', 'out.pdf')?
轉(zhuǎn)載于:https://my.oschina.net/u/2393235/blog/693567
總結(jié)
以上是生活随笔為你收集整理的python--html to pdf的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 人生第一次删好友,删的就是你!连路飞都怒
- 下一篇: Quartz总结(一):Quartz集成