Using pdfmake - creating a PDF tool in AngularJS

Using 'bower install pdfmake' I have downloaded the appropriate files to work with pdfMake.

I want to work with this library in angular.

This is my example 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 doesn't it work?

+3


source to share


1 answer


found it! I missed importing the pdfMake plugin into my home html file.



+4


source







All Articles