Angular JS generating PDF - any creator - maker modules?

后端 未结 4 1113
爱一瞬间的悲伤
爱一瞬间的悲伤 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:56

    You can use window.print() which prints current HTML document. Use media queries to adjust styles document. You can build your document in fly and call print anytime you want

    @media print { 
     /* All your print styles go here */
     #header, #footer, #nav { display: none !important; } 
    }
    

    Some code from one of my project, print's only content from table:

     $scope.print = function () {
        console.log('modal print');
    
        var table = document.querySelector('.CSSTableGenerator').innerHTML;
        var myWindow = window.open('', '', 'width=800, height=600');
        myWindow.document.write(table);
        myWindow.print();
    
      };
    

提交回复
热议问题