如何在 iOS 上创建更高 dpi 的 PDF?
我正在我的应用程序中创建一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.