PDF转换总是A4纵向吗?

发布于 2025-01-06 04:42:09 字数 213 浏览 5 评论 0 原文

我只是第一次使用应用程序引擎 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

桃扇骨 2025-01-13 04:42:09

虽然我自己没有尝试过,但 GAE Con​​version 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文