javascript 从 angular.js 表单生成 PDF

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19555576/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 15:57:40  来源:igfitidea点击:

Generating a PDF from an angular.js form

javascriptangularjspdf

提问by

I need to make a form that upon submission uses the input to make a PDF. I am using angular for the form data and handling so it would make sense if there was a way to leverage angular in the generation of the PDF.

我需要制作一个表单,在提交时使用输入来制作 PDF。我将 angular 用于表单数据和处理,因此如果有一种方法可以在 PDF 的生成中利用 angular,那将是有意义的。

采纳答案by Anil Singh

It might help you!! http://blog.sayan.ee/angular-pdf/

或许能帮到你!!http://blog.sayan.ee/angular-pdf/

HTML code-sample

HTML 代码示例

<div class="container" ng-controller="DocCtrl">
  <ng-pdf template-url="viewer.html"></ng-pdf>
</div>

AngularJs code-sample

AngularJs 代码示例

app.controller('DocCtrl', function($scope) {
  $scope.pdfUrl = '/path/to/all/pdf/' + $routeParams.pdfname + '.pdf';
});