Closed BrianMoreno1994 closed 6 years ago
Hi, are you getting any error message ?, you can look for the error message by using chrome remote debugger in your phone.
Thank for your reply. When using the remote debugger I get the following message in the console:
vendor.js:1 TypeError: pdf.usingURL is not a function
at a. table (5.e6c91e714285ec609d3f.js:1)
at a.n [as table] (vendor.js:1)
at click (5.e6c91e714285ec609d3f.js:1)
at a.e (vendor.js:1)
at a.t.$emit (vendor.js:6)
at a.click (vendor.js:11)
at n (vendor.js:1)
at e (vendor.js:1)
at HTMLButtonElement.t._withTask.t._withTask (vendor.js:1)
Perfect, but unfortunately it now gets stuck on the "Preparing preview..." screen.
This is what I'm trying:
let options = {
documentSize: 'A4',
type: 'share'
}
pdf.fromData('<html><h1>Hello World</h1></html>', options).then(() => alert('ok')).catch((err) => alert(err))
I also tried fromURL
and it also gets stuck on that same screen.
I found the problem, is in the alert, it will popup and focus the current WebKit, so basically the next view will wait until you click the alert, but the problem is you won't be able to go back. long history short if you want to get feedback choose console.log, DOM Modal like SweetAlert2 or you can use a native Progress Bar.
This would work:
pdf.fromData('<html><h1>Hello World</h1></html>', options)
.then(() => console.log('ok'))
.catch((err) => alert(err))
Ahh I see, thanks a lot for your help, it's working now. This is really an excellent plugin. I'm gonna for sure share your work! 👍
Thanks again!
Hi, I'm currently trying to generate a PDF from my Android device. Unfortunately, when I try to generate it nothing happens. This is the code I'm using:
Any help will be greatly appreciated! :)
These are my cordova plugins installed:
Android Version:
Android Version 7.0