python pdfkit : increase font size

标签 python python-2.7 pdf pdfkit

我通过以下方式将 HTML 文件转换为 pdf:

pdfkit.from_file("cpp.html",'cpp.pdf')

问题是字体太小了。

如何使用 pdfkit 增加字体大小(包括标题和段落)?显然,我希望标题字体保持大于段落字体。

我想我必须调整选项,但我找不到方法。

最佳答案

在我的例子中,手动设置 dpi 有帮助。

options = {
    'dpi':96,
}
pdfkit.from_url(url,out_file,options=options)

关于 python pdfkit : increase font size,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34978801/

相关文章:

python-2.7 - 如何在 Python 中解析具有八进制值的 char 数组?

python - 在 for 语句中更改列表(元组)列表的值

java - 通过 PDFBox 访问图像的 "alternate text"

c++ - 开罗:裁剪 PDF 表面?

java - iText:通过投影变换添加图像

python - 将系统 python 安装的 sys.path 附加到我的个人 python 安装中

python - 我的代码中不断出现错误,无法弄清楚

python - 按行分组、NaN 值和数字之间的联接和选择

design-patterns - Python 设计模式,交叉导入

Python读取unicode文件夹和文件名