i can download a pdf in a browser but its not working in mobile app so can you suggest any solution?
thanks but here am using ionic 2 so could u help this?
Ionic 2 uses angular 2.
So angular 2 examples are what you need
yeah i knows but its working in browser and not in my app while am using cordova platform
follow this link:
generatePdf(){
const before = Date.now();
document.addEventListener('deviceready', () => {
console.log('DEVICE READY FIRED AFTER', (Date.now() - before), 'ms');
var file = 'file:///android_asset/www/assets/lolc.html';
// var file = 'https://www.google.com/';
cordova.plugins.pdf.fromURL(file,{
documentSize: "A4",
landscape: "portrait",
type: "share"
}),
(sucess) => console.log('sucess: ', sucess),
(error) => console.log('error:', error);
});
}