Angular JS generating PDF - any creator - maker modules?

后端 未结 4 1119
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 12:09

As title says, is there any PDF creator / generator for Angular?

I have seen https://github.com/MrRio/jsPDF, but can\'t find any for Angular. I want to make an html

4条回答
  •  半阙折子戏
    2020-12-30 12:41

    Looks like @Mike had it close there. A few quick changes generated a decent looking file and brought up a print pop-up.

    1 - Give the area that you want to print an ID of 'printArea'

    2 - Add the $window service

    $scope.printIt = function(){
       var table = document.getElementById('printArea').innerHTML;
       var myWindow = $window.open('', '', 'width=800, height=600');
       myWindow.document.write(table);
       myWindow.print();
    };
    

提交回复
热议问题