pdf-generator
pdf-generator copied to clipboard
This plugin has become obsolete for the ionc 3?
I am trying to use this plugin with cordova and ionic 3. I already installed it through the following commands:
$ cordova plugin add cordova-pdf-generator;
$ npm install cordova-pdf-generator;
$ cordova plugins add node_modules/cordova-pdf-generator;
I tried to use the following syntax, according to the documentation:
declare var cordova: any;
And after that, I try to use the fromURL() function:
`cordova.plugins.pdf.fromURL('My_url', options)
.then((stats) => console.log('status', stats))
.catch((err) => console.log(err));`
(<any>cordova).pdf.fromURL('My_url', options)
.then((stats) => console.log('status', stats))
.catch((err) => console.log(err));
However, in execution the method is not recognized. Being the cord and (
I create this example using ionic2 hope is useful for you:
On that example I'm using there an older version of the API, but it should work with the new version as well: cordova.pdf.fromURL
I had already tried this same solution that you portray in the example.
However in the command: cordova.pdf.fromURL
, cordova
is null.
Is there any restriction of this feature to work only when tested on mobile devices? Does it work on an android emulator?
For me it is
window.cordova....
Maybe that helps.