jspdf

How can I send PDF file from my angular fronted to my laravel backend

你。 提交于 2020-01-03 03:23:09
问题 I'm trying to send a PDF file created in angular, By the jsPDF plugin to my laravel backend. I tried getting the base64 datauristring. And sent it to the backend. Then I used the base64 decode and wrote it to storage. But I was unable to get the exact PDF file there was an error saying the file is broken . 回答1: It depends on how you convert your page to pdf. If you use addHtml() , your datauristring starts with something like this data:application/pdf;base64 . But if you use newer version

How to save PDF file from jsPDF on a server in Javascript?

落花浮王杯 提交于 2020-01-02 05:22:05
问题 var doc = new jsPDF(); $('#generatereport').click(function() { doc.fromHTML($('#lppresults')[0], 15, 15, { width: 170 }, function() { doc.save('sample-file.pdf'); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.4/jspdf.min.js"></script> <div class="survey-results" id="lppresults"> <button id="generatereport">Download Report</button> <h1 style="border: solid;"

How to make a multiple table header

坚强是说给别人听的谎言 提交于 2020-01-02 01:10:12
问题 I am trying to make a table with 2 headers merged. At the moment i made 2 seperate tables with 2 seperate headers and it looks okay, but when the table width expands the first table header does not expand. How can i merge the 2 headers or can i make 1 table with 2 tableheaders. Please see picture (how the table is at the moment with 2 tableheaders) Here is my code : function createPDF(){ /** START PDF INSTANCE */ //var doc = new jsPDF('p', 'pt'); var doc = new jsPDF('l', 'pt'); var row = 80;

How to enable UTF-8 in jsPDF library

这一生的挚爱 提交于 2019-12-30 04:20:07
问题 I am very happy to use jsPDF library which helps me to export my HTML page as PDF file. I came across some difficulties. I downloaded the library from http://parall.ax/products/jspdf/. When I use some characters like š, ć (UTF-8), in pdf they look like error. Even if I insert via doc.text. On the library's website, when I use their examples and change text using some of these characters - it works. So it is suppose to work with UTF-8. Why it isn't working on my computer. I provide you my code

How to add watermark in PDF genereted from jsPDF?

让人想犯罪 __ 提交于 2019-12-29 09:28:05
问题 I am generating PDF from canva and using jsPDF to generate it. https://github.com/MrRio/jsPDF Here is my code what I am using I want to add watermark into page. Can anyone help me in that ? self.downloadCanvasObjectAsPDF = function () { canvas.deactivateAll().renderAll(); try { canvas.getContext('2d'); var imgData = canvas.toDataURL("image/jpeg", 1.0); var pdf = new jsPDF('p', 'mm', [297, 210]); pdf.addImage(imgData, 'JPEG', 5, 5); var namefile = 'export'; if(namefile != null) { pdf.save

Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

匆匆过客 提交于 2019-12-29 09:08:05
问题 I have two flot charts in One page , and with the code below, I want to use jsPDF to create report of them in two different pages (but one PD file) here id my code: Lets use this sample graphs : function flot1() { var oilPrices = [[1167692400000, 61.05], [1167778800000, 58.32], [1167865200000, 57.35], [1167951600000, 56.31], [1168210800000, 55.55], [1168297200000, 55.64] , [1168383600000, 54.02], [1168470000000, 51.88], [1168556400000, 52.99], [1168815600000, 52.99], [1168902000000, 51.21],

Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

£可爱£侵袭症+ 提交于 2019-12-29 09:08:02
问题 I have two flot charts in One page , and with the code below, I want to use jsPDF to create report of them in two different pages (but one PD file) here id my code: Lets use this sample graphs : function flot1() { var oilPrices = [[1167692400000, 61.05], [1167778800000, 58.32], [1167865200000, 57.35], [1167951600000, 56.31], [1168210800000, 55.55], [1168297200000, 55.64] , [1168383600000, 54.02], [1168470000000, 51.88], [1168556400000, 52.99], [1168815600000, 52.99], [1168902000000, 51.21],

HTML2canvas generates Blurry images

橙三吉。 提交于 2019-12-28 03:54:08
问题 I am using jsPDF and it uses html2canvas to generate an image from some html element and insert on the .pdf file. But there is a problem on html2canvas, it generates blurry images from the html. See example below: HTML content: http://puu.sh/7SZz4.png html2canvas generated image: http://puu.sh/7SZAT.png Is there any way to fix it or is there any better option to get the image form html? thanks! 回答1: you can use scale options in html2canvas. In the latest release, v1.0.0-alpha.1, you can use

Exporting PDF with jspdf not rendering CSS

偶尔善良 提交于 2019-12-27 14:50:05
问题 I am using jspdf.debug.js to export different data from a website but there are a few problems, I can't get it to render the CSS in the exported PDF and if I have an image in the page I am exporting, the PDF returns blank... Does anyone know a way to fix this ? Here is a jsfiddle showing it's not rendering the CSS And my script $(document).ready(function() { $('#export').click(function(){ var d = new Date().toISOString().slice(0, 19).replace(/-/g, ""), filename = 'financiar_' + d + '.pdf',

Exporting PDF with jspdf not rendering CSS

删除回忆录丶 提交于 2019-12-27 14:44:03
问题 I am using jspdf.debug.js to export different data from a website but there are a few problems, I can't get it to render the CSS in the exported PDF and if I have an image in the page I am exporting, the PDF returns blank... Does anyone know a way to fix this ? Here is a jsfiddle showing it's not rendering the CSS And my script $(document).ready(function() { $('#export').click(function(){ var d = new Date().toISOString().slice(0, 19).replace(/-/g, ""), filename = 'financiar_' + d + '.pdf',