JSPDF NotWorking with android device


#1

Hi can any one please help me to generate and download a pdf file from client side using jsPDF and FileTransfer cordova plugin , i tried below code ,
let time = new Date().getMilliseconds();
let fileName = ‘Itirenary’ + time + ‘.pdf’;
let output = doc.save(‘Itirenary’ + time + ‘.pdf’);
fileTransfer.download(doc, cordova.file.externalDataDirectory + fileName).then((entry) => {
cordova.plugins.fileOpener2.open(
cordova.file.externalDataDirectory + fileName,
‘application/pdf’,
{
error : function(e) {
console.log('Error status: ’ + e.status + ’ - Error message: ’ + e.message);
},
success : function () {
console.log(‘file opened successfully’);
}
}
);
//console.log('download complete: ’ + entry.toURL());
}, (error) => {
console.log('download complete: ’ + error);
});
above code working fine with desktop , but its not working on emulator and devices