最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Python3轉(zhuǎn)換html到pdf的不同解決方案

 更新時(shí)間:2019年03月11日 10:04:34   作者:網(wǎng)絡(luò)整理  
今天小編就為大家分享一篇關(guān)于Python3轉(zhuǎn)換html到pdf的不同解決方案,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧

問(wèn)題:python3 如何轉(zhuǎn)換html到pdf

描述:

我的電腦是windows764位,python3.4

我想用python 轉(zhuǎn)換html到pdf.

我嘗試了html2pdf,貌似它只支持Python2

我又嘗試了wkhtmltox-0.12.2.2_msvc2013-win64和pdfkit,并用下面的例子測(cè)試。

import pdfkit
pdfkit.from_url('http://google.com', 'out.pdf')

報(bào)錯(cuò)信息

Traceback (most recent call last):
 File "E:\Python34\lib\site-packages\pdfkit\configuration.py", line 21, in __init__
  with open(self.wkhtmltopdf) as f:
FileNotFoundError: [Errno 2] No such file or directory: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
 File "<pyshell#2>", line 1, in <module>
  pdfkit.from_url('http://google.com', 'out.pdf')
 File "E:\Python34\lib\site-packages\pdfkit\api.py", line 22, in from_url
  c
 File "E:\Python34\lib\site-packages\pdfkit\pdfkit.py", line 38, in __init__
  self.configuration = (Configuration() if configuration is None
 File "E:\Python34\lib\site-packages\pdfkit\configuration.py", line 27, in __init__
  'https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf' % self.wkhtmltopdf)
OSError: No wkhtmltopdf executable found: "b''"
If this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf

請(qǐng)大神們告訴我,該怎么做呢?

解決方案1:

直接使用里邊的wkhtmltopdf即可

wkhtmltopdf http://google.com a.pdf

解決方案2:

把可執(zhí)行文件的路徑加入到環(huán)境變量里

以上介紹了“python3 如何轉(zhuǎn)換html到pdf”的問(wèn)題解答,希望對(duì)有需要的網(wǎng)友有所幫助。

總結(jié)

以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請(qǐng)查看下面相關(guān)鏈接

相關(guān)文章

最新評(píng)論

登封市| 精河县| 灯塔市| 郴州市| 慈利县| 缙云县| 革吉县| 柏乡县| 乐山市| 迁西县| 邳州市| 黄平县| 遂溪县| 韶山市| 汶上县| 东丽区| 永善县| 乡城县| 兰考县| 肇东市| 江山市| 延长县| 道真| 黎川县| 东光县| 特克斯县| 水富县| 新绛县| 隆尧县| 临沭县| 柯坪县| 富民县| 高平市| 太谷县| 南康市| 高安市| 丰台区| 邛崃市| 长阳| 吴旗县| 贵阳市|