Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I don't get any pdf out #8

Open
attigo2010 opened this issue Feb 9, 2018 · 2 comments
Open

I don't get any pdf out #8

attigo2010 opened this issue Feb 9, 2018 · 2 comments

Comments

@attigo2010
Copy link

Hello,

I don't know if I can ask here, as I am pretty sure it is me who doesn't get it right what to do.
I have angularjs application with cordova. I have isntalled the plugin. Then I have this code on click of a button. Do I do something right here, or I have got it completely wrong?
Thank you in advance. Excuse me if this is not the place for my question.
$scope.generate = function (item) {

        document.addEventListener('deviceready', function () {

            let options = {
                documentSize: 'A4',
                type: 'share'
            }

            pdf.fromData('<html><h1>Hello World</h1></html>', options)
                .then((base64) => 'ok')   // it will
                .catch((err) => console.err(err));

        });
    };
@cesarvr
Copy link
Owner

cesarvr commented Feb 9, 2018

Hi,
No problem you can ask here.

Are you try to run this project cordova-pdf-example, or you are trying to run a snippet ?

Debug

To debug your Cordova app you can use Chrome. check this

It will give you a clue of where the problem is and also it will facilitate other people to help.

Check plugin

Check that you have installed the plugin

cordova plugins

You should see the plugin, if you don't: Try reinstall the plugin you can follow this directions.

If you see it, then that means that the plugin didn't make it to the .APK (Android Executable) or .IPA (iOS Executable).

Try, delete your platform folder:

rm -r platform

Then
cordova platform add android ios , This command will create the two projects (Android, iOS) and will try to load the plugins, keep an eye in the logs if some error happens.

More Info

For a more info you can use this starting guide.

Cheers.

@attigo2010
Copy link
Author

Hi
Thank you for your answer.
I am trying but I am new at these things, so I probably don't have a clue what I am doing wrong.
I am using the code above in my own angularjs project, which has installed the plugin and the android and ios platforms ( i checked).
I have no clue how to run the example project. I will try to reseach in the link you showed me. :)

Thank you!

Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants