如何让pdf打印输出占满整个A4纸
我使用 jboss seam iText 模块生成一个示例 pdf 文件,默认情况下以 143% 的页面放大倍率呈现。当我打印出来时,输出并没有占据整个页面。我应该修改哪些设置才能使打印输出使用整张纸。
I use jboss seam iText module to generate a sample pdf file, which by default renders with a page magnification of 143%. When I take a print out, the output doesn't occupy the entire page though. What settings should I modify to make the print out use the entire sheet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 seam-pdf,文档大小的设置位于
标签中:If seam-pdf is what your are using, settings for document size are in the
<document>
tag:您可以将初始页面尺寸更改为 A4。
您可以要求您的用户正确配置他们的打印机。在 Reader X 中,有一个“页面缩放”下拉列表,选项之一是“适合可打印区域”。我相信以前的版本有一个用于相同控件的复选框,但我不确定。
您可以更改初始页面视图,但这不会改变打印行为......至少不会改变您想要的方式。请参阅 PdfViewerPreferences,由
PdfWriter.
还有一个 javascript 方法,
doc.print(...)
,无需用户输入即可控制所有这些,但“无用户输入”参数需要特殊执行权限...您也许能够通过证书安全性和一些用户设置来安排这一点,但话又说回来,您可能不会。You can change your initial page size to be A4.
You can ask your users to configure their printer properly. In Reader X there's a "Page Scaling" drop list, and one of the options is "Fit to Printable Area". I believe previous versions had a check box for the same control, but I'm not sure.
You can change the initial page view, but that won't change the printing behavior... at least not the way you want. See PdfViewerPreferences, implemented by
PdfWriter
.There's also a javascript method,
doc.print(...)
, that can control all of that without user input, but the "no user input" parameters require Special Execution Privileges... you might be able to arrange that with certificate security and some user settings, but then again, you might not.