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