gpt4 book ai didi

ios - 如何查找/访问通过 iOS 上的应用程序生成的 PDF 文件?

转载 作者:行者123 更新时间:2023-11-29 05:15:36 25 4
gpt4 key购买 nike

我正在使用https://github.com/christopherdro/react-native-html-to-pdf生成 PDF 文件。在 Android 上,它们最终会出现在我的下载文件夹中,一切都很好,但在 iOS 上,它们最终会出现在:

/var/mobile/Containers/Data/Application/xxxxxxxxxx/Documents/xxxx.pdf

用户如何找到这些文件?我以为它们会在"file"应用程序中可见,但事实并非如此。我基本上是在 iOS 上这样做的:

let options = {
html: '<h1>PDF TEST</h1>',
fileName: 'test',
directory: 'Documents',
};

我尝试过不提供目录,或者“docs”而不是“Documents”,这将它们放在同一个位置,但/temp 而不是/Documents。

我做错了什么吗? iOS 用户应该如何定位/访问 PDF 文件,而无需通过一堆东西来访问该文件夹?是否可以让它们默认出现在"file"中?

提前致谢。

最佳答案

我明白了。

您必须将“UIFileSharingEnabled”和“LSSupportsOpeningDocumentsInPlace”添加到 Info.plist 中,值为“YES”。

这会显示 iPhone 上您的应用程序的文档文件夹。

关于ios - 如何查找/访问通过 iOS 上的应用程序生成的 PDF 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59222482/

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