如何在 iOS 上创建更高 dpi 的 PDF?

发布于 2024-11-14 22:03:33 字数 345 浏览 3 评论 0原文

我正在我的应用程序中创建一个 PDF,用作邮件附件。效果很好,但我不知道如何创建除了 72dpi PDF 之外的任何内容。

我这样开始

CGRect mediaBox = CGRectMake(0, 0, 595, 842);
CGContextRef context = CGPDFContextCreateWithURL([NSURL fileURLWithPath:path], &mediaBox, NULL);

在上下文中执行所有 Quartz 绘图,一切正常,但是通过增加媒体框,我只能更改页面的大小。
我确信我忽略了一些明显的事情,但我找不到在哪里指定 dpi?

I'm creating a PDF, to be used as a mail attachment, inside my app. Which works fine, but I have no idea how to create anything but a 72dpi PDF.

I start like this

CGRect mediaBox = CGRectMake(0, 0, 595, 842);
CGContextRef context = CGPDFContextCreateWithURL([NSURL fileURLWithPath:path], &mediaBox, NULL);

Do all my Quartz drawing inside the context, all works well, but by increasing the mediabox I can only change the size of the page.
I'm sure I'm overlooking something obvious, but I can't find where to specify the dpi?

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

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

发布评论

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

评论(1

酒中人 2024-11-21 22:03:34

Xcode 没有替换我设备上的图像文件,因此旧的(低分辨率)文件仍然开始使用,从设备中完全删除应用程序,并进行干净的构建,解决了我的问题。

Xcode was not replacing image files on my device, so old (low res) files were still begin used, removing the app from the device completely, and doing a clean build, fixed my problems.

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