jspdf

Exporting PDF with jspdf not rendering CSS

﹥>﹥吖頭↗ 提交于 2019-12-27 14:43:46
问题 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',

Aspx to pdf jsPDF

你。 提交于 2019-12-25 10:00:59
问题 I want to convert my form (Sharepoint) to pdf with jsPDF but i have a problem ... Result: Can you help me ? My code: function demoFromHTML() { var pdf = new jsPDF('p', 'pt', 'letter'); // source can be HTML-formatted string, or a reference // to an actual DOM element from which the text will be scraped. source = $('.JsPDF tbody')[0]; // we support special element handlers. Register them with jQuery-style // ID selector for either ID or node name. ("#iAmID", "div", "span" etc.) // There is no

Aspx to pdf jsPDF

我怕爱的太早我们不能终老 提交于 2019-12-25 10:00:14
问题 I want to convert my form (Sharepoint) to pdf with jsPDF but i have a problem ... Result: Can you help me ? My code: function demoFromHTML() { var pdf = new jsPDF('p', 'pt', 'letter'); // source can be HTML-formatted string, or a reference // to an actual DOM element from which the text will be scraped. source = $('.JsPDF tbody')[0]; // we support special element handlers. Register them with jQuery-style // ID selector for either ID or node name. ("#iAmID", "div", "span" etc.) // There is no

jsPDF fromHTML() not show image

风流意气都作罢 提交于 2019-12-25 03:57:24
问题 HTML CODE: <div id="customers" > <div class=""> <div class="heading"> <img class="form_head" src="http://dev.syntrio.in/kchr-project/images/kchr-kchr.png" alt=""> </div> <button onclick="javascript:demoFromHTML();">PDF</button> JS CODE: function demoFromHTML() { var pdf = new jsPDF('p', 'pt', 'letter'); // source can be HTML-formatted string, or a reference // to an actual DOM element from which the text will be scraped. source = $('#customers')[0]; // we support special element handlers.

jsPDF with non-latin fonts

这一生的挚爱 提交于 2019-12-24 22:42:51
问题 I want to create pdf from javascript. For this I use jsPDF I want to use cyrillic fonts. I create js-file that contents font Roboto-regular by recommendations in docs. And I try get pdf with cyrillic font. But unfortunately. This is my code. How I must use js-file that contents font? function doPdf() { var pdf = new jsPDF('l', 'pt', 'letter'); pdf.setFont('Roboto-Regular', 'normal'); pdf.html(document.body, { callback: function(pdf) { var iframe = document.createElement('iframe'); iframe

How to add several images onto a PDF using jsPDF

為{幸葍}努か 提交于 2019-12-24 11:12:01
问题 Argument 'link' is an array of images' links. function genPDF_fromUrl(link) { var doc = new jsPDF(); doc.setFontSize(40); doc.text(80, 25, 'MAP001'); const rtnimg = compute(doc, link); console.log(rtnimg) Promise.all(rtnimg).then((success) => { doc.save("map.pdf"); }); console.log("Finish hello PDF!") } function compute(doc, link) { return link.map(l => { let x = 0; let y = 0; x += 10; y += 10; return new Promise((resolve, reject) => { var genImg = new Image(); genImg.setAttribute(

Save pdf directly to file using jspdf

China☆狼群 提交于 2019-12-24 08:25:15
问题 My script is a Firefox addon so has access to sensitive code like access to filesystem etc. I display a Panel populated with html content, I could easily send input to the addon code using postMessage When I run the code below a pdf is generated and a download prompt is shown so i can select directory to place file, but I'd like to save the file using javascript directly to a file in background without the download prompt showing. Something like: doc.saveToFile("/path/to/file") // custom

Can't get div content using jsPDF

巧了我就是萌 提交于 2019-12-24 06:11:39
问题 I was trying to generate PDF from HTML using jsPDF and html2canvas. It worked with full page, but not specific div using getElementById() . The console says IndexSizeError: Index or size is negative or greater than the allowed amount html2canvas.js:2859 Here's my script <script> let doc = new jsPDF(); doc.addHTML(document.getElementById('content'), function() { doc.save('html.pdf'); }); </script> can anyone help me with this? 回答1: doc.addHTML() is actually deprecated now. The new vector

Facing some design issue about jsPDF

混江龙づ霸主 提交于 2019-12-24 05:15:31
问题 I am using jsPDF it works fine. It downloads the document as "PDF" but the thing is I am getting wrong design for the same, I want the table as displayed on the site. How to set the column height and width for table in jsPDF? Here is my script function exportPdf() { var pdf = new jsPDF('p', 'pt', 'letter'); // source can be HTML-formatted string, or a reference // to an actual DOM element from which the text will be scraped. source = $('#infobox')[0]; // we support special element handlers.

How to fix: Cannot create property 'header' on string

早过忘川 提交于 2019-12-24 02:43:14
问题 I'm trying to create a pdf using jspdf from json data. But it is causing an error which i'm not able to understand. Please help me solve the issue. Data: fileDataSpecific = [{ Date: "01/Jan/2019", ServerName: "prlhpcms01", ServerRequest: "Front End License returned", ServerStatus: "57 timed out", Time: "01:03:32", UserName: "root", srno: 1 }] displayColumns = [ { "val": "srno", "col": "Sr. No." }, { "val": "ServerName", "col": "Server Name" }, { "val": "UserName", "col": "User Name" }, { "val