1 year ago

#372405

test-img

shivam

The file "test.pdf" could not be opened on mac. [Ionic-iOS]

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

ios

angular

ionic-framework

ionic3

0 Answers

Your Answer

Accepted video resources