CGPDFDocumentCreateWithURL 内存使用情况

发布于 2024-12-22 13:46:13 字数 264 浏览 4 评论 0原文

大家好,我来这里是为了澄清我的疑问,这对大多数人来说可能很愚蠢,但我的应用程序需要它。我的问题是在编写以下行 CGPDFDocumentRef myDocumentRef= CGPDFDocumentCreateWithURL(pdfUrl); 时需要多少内存,就像 pdf 大小或任何其他大小一样。当然,我正在使用 CGPDFDocumentRelease(myDocumentRef) 释放 CGPDFDocumentRef。任何人都可以告诉我 CGPDFDocumentRef 可以使用多少内存吗?提前致谢。

Hi every one i am here to clarify my doubt it might be silly for most of them but i need it for my app.my question is while writing the below line CGPDFDocumentRef myDocumentRef= CGPDFDocumentCreateWithURL(pdfUrl); how much memory will it take like what ever the size of the pdf size or any other.Of course i am releasing the CGPDFDocumentRef using CGPDFDocumentRelease(myDocumentRef). Can any one please give an idea how much memory CGPDFDocumentRef can it use.Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

唯憾梦倾城 2024-12-29 13:46:13

文件大小与 CGPDFDocument 消耗的内存量关系不大。对 CGPDFDocumentCreateWithURL 的调用实际上会分配很少的内存,因为它只是读取一些元数据(文档标题、页数...)。

当您实际对文档执行某些操作(例如渲染页面)时,您会看到内存使用量增加,因为所有图像、字体等都必须从文件加载到内存中。然而,这并不直接取决于文件大小,因为文档(或其中的一部分)可能被压缩,某些资源可能由多个页面共享等。

The file size has very little to do with how much memory CGPDFDocument consumes. The call to CGPDFDocumentCreateWithURL will actually allocate very little memory because it's just reading some metadata (title of the document, number of pages...).

You will see the memory usage increase when you actually do something with the document, like rendering a page, because then all the images, fonts, etc. have to be loaded from the file into memory. This does not however depend directly on the file size because the document (or just parts of it) might be compressed, some resources could be shared by multiple pages, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文