gpt4 book ai didi

iphone - 如何在 iOS 上从 pdf 文件中提取给定页面?

转载 作者:行者123 更新时间:2023-11-29 04:47:13 27 4
gpt4 key购买 nike

我想通过电子邮件发送 iOS 上 pdf 的当前页面。我想我必须先提取页面。

如何从 pdf 文件中提取/保存页面?我找到了这个链接: https://stackoverflow.com/questions/9238229/iphone-how-to-extract-the-pdf-pages-from-pdf-file-if-the-pdf-file-pdf-page-conta

(但我没有 HelperClass)

最佳答案

试试这个:

CGPDFDocumentRef document;
UIGraphicsBeginImageContext(/* PDF_SIZE */);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextDrawPDFPage(context, CGPDFDocumentGetPage(/* PDF_PAGE */));

UIImage *output = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

关于iphone - 如何在 iOS 上从 pdf 文件中提取给定页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9447006/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com