sea-stream

python生成pdf文件,使用pdfkit很方便。由于pdfkit要依赖系统中的wkhtmltopdf,所以要先安装wkhtmltopdf。
#手动安装
下载地址:
https://wkhtmltopdf.org/downloads.html
安装包:
链接:https://pan.baidu.com/s/1Yk09q35_XqK9ZnatqbkA_g  密码:g6bn
#命令行安装
# mac环境下homebrew安装,类似于linux的apt-get和yum
brew cask install wkhtmltopdf
安装pdfkit包
Pip3.7 install pdfkit
code
import pdfkit
with open(\'test.html\') as f:
    pdfkit.from_file(f, \'out.pdf\')

 

 
 

分类:

技术点:

相关文章:

  • 2023-02-24
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-10-09
  • 2022-12-23
猜你喜欢
  • 2021-04-19
  • 2021-11-27
  • 2021-12-15
  • 2021-05-14
  • 2021-06-14
  • 2021-11-19
  • 2022-12-23
相关资源
相似解决方案