文件“test.pdf”无法在mac上打开。 [Ionic-iOS]
我正在尝试使用 Ionic 文件系统在 iOS 中保存 pdf。我正在使用以下函数来写入文件。
Filesystem.writeFile({
path: 'test',
data: EStatementConstant.BinData,
directory: Directory.Documents,
encoding: Encoding.UTF8,
});
其中 EStatementConstant.BinData 是我直接从 API 服务获取的 base64 数据 [已验证]。
问题是我无法在 Mac 上打开该文件。我没有找到任何可以解码的函数。
我使用的是 v-3 电容器。
注意:- 如果没有在 iOS 中进行编码,我无法保存 pdf 数据。另外,我无法使用 Cordova 插件。 最近几天我一直在为此苦苦挣扎。请帮忙。
I am trying to save the pdf in iOS using the Ionic Filesystem. I am using the below functions for writing the files.
Filesystem.writeFile({
path: 'test',
data: EStatementConstant.BinData,
directory: Directory.Documents,
encoding: Encoding.UTF8,
});
Where EStatementConstant.BinData is my base64 data [validated] which I am getting directly from the API service.
The problem is that I am unable to open the file on a Mac. I didn't find any function to decode.
I am using capacitor v-3.
Note:- I am unable to save the pdf data without encoding in iOS. Also, I can not use the Cordova plugin. I am struggling with this for the last few days. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论