文件“test.pdf”无法在mac上打开。 [Ionic-iOS]

发布于 2025-01-18 21:51:37 字数 985 浏览 0 评论 0原文

我正在尝试使用 Ionic 文件系统在 iOS 中保存 pdf。我正在使用以下函数来写入文件。

Filesystem.writeFile({
      path: 'test',
      data: EStatementConstant.BinData,
      directory: Directory.Documents,
      encoding: Encoding.UTF8,
     });

其中 EStatementConstant.BinData 是我直接从 API 服务获取的 base64 数据 [已验证]。

问题是我无法在 Mac 上打开该文件。我没有找到任何可以解码的函数。

我使用的是 v-3 电容器。

https://capacitorjs.com/docs/apis/filesystem?_gl=11i199tw_gaMTYzMjY4 MzAzMi4xNjM0ODQxNDI4_ga_REH9TJF6KF*MTY0ODgwMzI4NS40OS4wLjE2NDg4MDMyODUuMA..#type-401

注意:- 如果没有在 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.

https://capacitorjs.com/docs/apis/filesystem?_gl=11i199tw_gaMTYzMjY4MzAzMi4xNjM0ODQxNDI4_ga_REH9TJF6KF*MTY0ODgwMzI4NS40OS4wLjE2NDg4MDMyODUuMA..#type-401

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.

Problem image

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文