PDFkit - 生产机器上的不同页面大小

时间:2017-12-21 13:18:11

标签: python django wkhtmltopdf python-pdfkit

我有一个Django项目,我使用PDFkit从HTML生成PDF。

在我的本地机器上,我看到pdf就好了,但在生产机器上生成的pdf页面稍大一些。

html在两台机器上都是正确且相同的。

操作系统是相同的(ubuntu 14.04)。

检查了所有软件包版本,它们是相同的。

我的pdf生成代码是:

options = {'page-size': 'A2', 'margin-top': '0in', 'margin-right': '0in', 'margin-bottom': '0in', 'margin-left': '0in'}
pdf_location = '/...../executive_summary.pdf'
pdfkit.from_string(my_template.render(context_dict), pdf_location, options=options, css='/....../executive_summary.css')

wkhtmltopdf是最新的

pdfkit == 0.6.1

附上截图。还有什么地方可以解决问题?

enter image description here

enter image description here

0 个答案:

没有答案