Dowload and open pdf file in device

i get pdf file from web service and i want to download it and open it in my android device.
using this code,this.file.externalDataDirectory+ filename).then((entry) => {
text: ‘Téléchargement de fichier’+filename+’ est terminé !!’,
led: ‘FF0000’,
sound: null

download the pdf file but connot open it because it has been saved as “invalid format” !!!
i have been read a lot about encoding to base64!
is there any idea or example code to save pdf file in the right format??

thanks for repond, but i have the same code. it does save the pdf in device, but when i try to open it, i always get " error format invalid" with size 0.

1 Like

Have you found out any solution for this ?