WeasyPrint页面大小错误. (8.27英寸x 11.69英寸) [英] WeasyPrint page size wrong. (8.27in x 11.69 in)
本文介绍了WeasyPrint页面大小错误. (8.27英寸x 11.69英寸)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在一个使用WeasyPrint输出文档的项目中.在我的一生中,我无法弄清楚为什么默认将页面大小设置为非标准页面大小.
I am working on a project that uses WeasyPrint to output documents. for the life of me I cannot figure out why it is defaulting the page size to a non standard page size.
我希望它默认为8.5 x 11英寸. 取而代之的是,PDF的尺寸为8.27 x 11.69英寸.
I would expect it to default to 8.5 x 11 inches. instead the pdfs come out as 8.27 x 11.69 inches.
在我的一生中,我无法弄清为什么页面大小这么小.
for the life of me I cannot figure out why the page size is so off.
有什么想法吗?
推荐答案
我发现css标签@page可以让我将pdf生成的实际页面大小更改为:
I found that the css tag @page would allow me to change the actual page size of what the pdf would generate to:
@page {
size: Letter;
margin: 0in 0.44in 0.2in 0.44in;
}
好时机设法弄清楚那个.
good times trying to figure that one out.
这篇关于WeasyPrint页面大小错误. (8.27英寸x 11.69英寸)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文