简体   繁体   English

如何在IOS中以编程方式将PDF转换为PNG

[英]How to convert a PDF to a PNG in IOS programmatically

I am developing an iPhone application to display large image(s) and PDF(s). 我正在开发一个iPhone应用程序以显示大图像和PDF。 The PDF and images are available for web downloading or through iTunes importing. PDF和图像可通过Web下载或通过iTunes导入。

I am using a tiling approach where after the download/import a set of PNG/JPEG tiles are programmatically generated and saved to the iPhone. 我使用的是切片方法,在下载/导入后,将以编程方式生成一组PNG / JPEG切片并将其保存到iPhone。

Looking previous questions I found a way to do tiling for large images, but it does not work with PDF files? 回顾以前的问题,我找到了一种处理大图像的方法,但是它不适用于PDF文件吗?

I wonder if it is possible to convert the PDF file into a PNG/JPEG before running the tiling routine, or if there are better approaches to do this. 我想知道是否有可能在运行切片程序之前将PDF文件转换为PNG / JPEG,或者是否有更好的方法来做到这一点。

您可以创建图像对象,为图像创建图形上下文,在图像的图形上下文中呈现PDF页面,然后保存图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM