How to save Jspdf file into specific folder -
i using jspdf generate pdf.its working file download "download" folder.but want download specific folder this("localhost/ccs/ccs/invoice") folder path save generated pdf.how solve change in code. example code is
<div class="invoice" id="customers" ng-repeat="aim in input"> <div align="right"><h1 align="right"><b>invoice</b> </h1></div> <table> <tr> <td> hello </td> <td> hi </td> </tr> </table> </div> <button onclick="javascript:demofromhtml();">pdf</button>
my scripting code is
<script> function demofromhtml() { var pdf = new jspdf('p', 'pt', 'letter'); // source can html-formatted string, or reference // actual dom element text scraped. source = $('#customers')[0]; // support special element handlers. register them jquery-style // id selector either id or node name. ("#iamid", "div", "span" etc.) // there no support other type of selectors // (class, of compound) @ time. specialelementhandlers = { // element id of "bypass" - jquery style selector '#bypassme': function (element, renderer) { // true = "handled elsewhere, bypass text extraction" return true } }; margins = { top: 80, bottom: 60, left: 40, width: 522 }; // coords , widths in jspdf instance's declared units // 'inches' in case pdf.fromhtml( source, // html string or dom elem ref. margins.left, // x coord margins.top, {// y coord 'width': margins.width, // max width of content on pdf 'elementhandlers': specialelementhandlers }, function (dispose) { // dispose: object x, y of last line add pdf // allow insertion of new lines after html pdf.save('invoice.pdf'); }, margins); } </script> <script type="text/javascript" src="http://mrrio.github.io/jspdf/dist/jspdf.debug.js"> </script>
thank you.
you use 'filesaver.js' along jspdf.js, save pdf in specific folder whereever like.
var pdf = new jspdf(); // code here write in pdf. pdf.save(filename);
have you solve this problem
ReplyDelete