Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229637

Invalid Format of "filename.pdf" when we open it on success of WriteFile Api

$
0
0

On success of this WriteFile API it generates a .pdf file.
but when I open it through fileOpener or I open it manually while going it into that directory it gives me error that test.pdf is of Invalid Format

When I generate .docx file or .txt file it is opening and displaying the data.

this.file.writeFile(cordova.file.externalDataDirectory,"test.pdf","HEllO WORLD",true).then(succ=>{
      console.log("File write success : ", succ)
      this.fileOpener.open(
      succ.nativeURL,
      'application/pdf'
    ).then((success) => {
      console.log('success open file: ', success);
    }, (err) => {
      console.log('error open file', err);
    });

    },
    err=>{
      console.log(" write File error : ", err)
    })

I am facing this issue.
Can anyone please help me out to figure out this issue


Viewing all articles
Browse latest Browse all 229637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>