Search code examples
javascriptangularjspdfpdf-generationpdfmake

Using pdfmake - generate pdf tool in AngularJS


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?


Solution

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