Using pdfmake - generate pdf tool in AngularJS

7.4k Views Asked by At

Using 'bower install pdfmake' I've downloaded the relevant files in order to work with pdfMake.

I want to work with this library in angular.

This is my sample code

angular controller:

    $scope.pdfMaker = function(){
        var docDefinition = { content: 'This is an sample PDF printed with pdfMake' };
        pdfMake.createPdf(docDefinition).open();
    }

html:

 <button ng-click="pdfMaker()">run pdf</button>

What am I missing? why this does not working?

1

There are 1 best solutions below

2
On BEST ANSWER

found it! I missed to import of the pdfMake plugin in my home html file.