我只是第一次使用应用程序引擎 python 文件转换 api。我正在将 html 转换为 PDF。它似乎工作得很好,而且速度也很快,但即使 html 页面设置为 960px 宽度,生成的 PDF 也会裁剪掉内容,因为 PDF 似乎被格式化为以 A4 尺寸输出纵向。
查看文档我看不到任何选项。如果我能把它变成风景,它应该适合。
我是否遗漏了一些明显的东西,或者它总是 A4 肖像?
I am just using the app engine python file conversion api for the first time. I am converting html to PDF. It seems to work well, and pretty fast too, but even though the html page is set to 960px width the resulting PDF crops off the content, because the PDF seems to be formatted to output portrait in A4 size.
Looking at the docs I can't see any options for this. If I could make it landscape it should fit.
Am I missing something obvious or is it always A4 portrait?
发布评论
评论(1)
虽然我自己没有尝试过,但 GAE Conversion API 支持 分页媒体 CSS 用于自定义 HTML->PDF 转换,并且可能是页面“大小”属性 ( http://dev.w3.org/csswg/css3-page/#page-size-prop )就是您所需要的。
While I haven't tried this myself, the GAE Conversion API supports Paged Media CSS for customization of the HTML->PDF conversion, and it may be that the page 'size' property ( http://dev.w3.org/csswg/css3-page/#page-size-prop ) is what you need.