开发者

CGPDFDocumentCreateWithProvider() and CGPDFDocumentCreateWithURL() used on a local file

开发者 https://www.devze.com 2023-01-20 17:14 出处:网络
Most, if not all, tutorials use CGPDFDocumentCreateWithURL(). What is the difference if using CGPDFDocumentCre开发者_JAVA技巧ateWithProvider() instead? Let\'s say the pdf is being taken from a local f

Most, if not all, tutorials use CGPDFDocumentCreateWithURL(). What is the difference if using CGPDFDocumentCre开发者_JAVA技巧ateWithProvider() instead? Let's say the pdf is being taken from a local file on the device, not downloaded from some website. Will there be a performance difference? Which is better?


The most direct approach will be to use CGPDFDocumentCreateWithURL() with a file URL. To use CGPDFDocumentCreateWithProvider(), you will just have to create a provider from the file (or worse, read it all into an NSData, then wrap that in the provider), then create the document with the provider.

The only way to tell if there's a performance difference is to do both and then profile each for the workload you'll be applying them to.

0

精彩评论

暂无评论...
验证码 换一张
取 消