在 Cocoa 中将 PDF 转换为高分辨率图像的最佳方法
在 Cocoa 中将 PDF 转换为 300 dpi(例如)tiff 的最佳方法是什么?
我使用 PDFImageRep
创建 NSImage
但我找不到放大分辨率的方法。
What is the best way to convert PDF to 300 dpi (for example) tiff in Cocoa?
I use PDFImageRep
for creating NSImage
but I cannot find the way to enlarge the resolution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案是为图像创建图形上下文并在该上下文中渲染 PDF 页面。创建上下文时,您指定所需的分辨率。
此代码将完成这项工作:
它取自此处: http://ipdfdev.com/2011/03/28/convert-a-pdf-page-to-image-on-the-iphone-and-ipad/
The solution is to create a graphics context for your image and render the PDF page in that context. When you create you context you specify the desired resolution.
This code will do the job:
It is taken from here: http://ipdfdev.com/2011/03/28/convert-a-pdf-page-to-image-on-the-iphone-and-ipad/