iOS 以最小边距打印 pdf

发布于 2024-12-06 00:13:59 字数 331 浏览 5 评论 0原文

这一定很简单,但我似乎无法弄清楚。

我已经成功实现了从我的应用程序打印 PDF 的代码。问题是,PDF 周围有相当多的空白,并且具有默认边距……这不是我希望页面从打印机中打印出来的方式。

所以,我正在努力将利润减少到最低限度。我该怎么办呢?我是否需要使用自定义 UIPrintFormatter、UIPrintPageRenderer 或 UIPrintPaper。我需要在 UIPrintInteractionControllerDelegate 的哪个方法中进行更改?

我知道这是可以做到的,因为当我从 Apple 的 iBook 应用程序打印 PDF 时,边距明显减少。

谢谢。

This must be quite simple but I can't seem to figure this out.

I've managed to implement the code for printing an PDF from my App. Problem is, the PDF has quite some whitespace around it and with the default margins... it's just not how I would like the page to come out of the printer.

So, I'm trying to reduce the margins to minimum. How would I go about this? Do I need to use a custom UIPrintFormatter, UIPrintPageRenderer or UIPrintPaper. In which method from UIPrintInteractionControllerDelegate would I need to change things?

I know it can be done because when I print the PDF from Apple's iBook App, margines are significant less.

Thanks.

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

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

发布评论

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

评论(1

这个俗人 2024-12-13 00:13:59

我没有完全解决问题,但我对现在的结果很满意。
其实我没有改变任何东西,我问这个问题的原因是因为在AirPrint模拟器中,我的PDF打印时有过多的空白/边距。但在实际设备上打印PDF则没有这个问题。

因此,如果您在 AirPrint 模拟器中遇到此问题,请在真实的设备/打印机上尝试,变化是一切打印正常。

I did not quite solve the problem but I'm satisfied with the result now.
Actually I did not change anything, the reason why I asked this questing was because in the AirPrint simulator, my PDF printed with an excessive amount of white space / margin. But printing the PDF on an actual device did not have this problem.

So, if you run into this problem in the AirPrint simulator, try it on a real device/printer, changes are that everything prints fine.

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