Skip to content

I don't get any pdf out #8

Open

Description

@DianaGrigorovaKaan

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));

        });
    };

Activity

  1. cesarvr commented on Feb 9, 2018

    @cesarvr
    Owner

    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.

  2. DianaGrigorovaKaan commented on Feb 9, 2018

    @DianaGrigorovaKaan
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions