简体   繁体   English

从angular.js表单生成PDF

[英]Generating a PDF from an angular.js form

I need to make a form that upon submission uses the input to make a PDF. 我需要制作一个表单,在提交时使用输入来制作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时利用角度,那么这将是有意义的。

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';
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM