我正在寻找一个很好的选择,可以使用angular在我的每个应用页面上导出pdf功能。有没有人对角度模块有任何建议可以实现这一点,因为我找不到任何基于角度的模块。
答案 0 :(得分:0)
您应该使用此angular-save-html-to-pdf
//Here goes your script in html file
<script src="../bower_components/angular/angular.js"></script>
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/niklasvh/html2canvas/0.5.0-alpha2/dist/html2canvas.min.js"></script>
<script src="../bower_components/jsPDF/dist/jspdf.debug.js"></script>
<script src="../dist/saveHtmlToPdf.min.js"></script>
//Add this module to your angular app :
var app = angular.module('app' , ['htmlToPdfSave']) ;
//This is your html file
<button pdf-save-button="idOneGraph" pdf-name="hello.pdf" class="btn">Hello World</button>
<!-- below block will be saved as pdf -->
<div pdf-save-content="idOneGraph" >
Hello World
</div>