jspdf

Html to pdf using jsPDF rtl support

强颜欢笑 提交于 2019-12-24 02:09:07
问题 I am trying to convert html to pdf with jsPDF using angular 5 Here is my code: import * as jsPDF from "jspdf"; . . . htmlToPdf(){ var doc=new jsPDF(); var specialElementHandlers = { '#content' : function(element,render) {return true;} }; doc.fromHTML(document.getElementById('content'), 20,20,{ 'width':500, 'elementHandlers': specialElementHandlers, }); doc.save('Reports.pdf'); } I am trying to export the pdf with direction right to left without sucsses When I try this command: doc

Trying to save a PDF file with Intel XDK

空扰寡人 提交于 2019-12-24 01:27:57
问题 I´m trying to recreate this example. But When I click the button I get the error: "Uncaught ReferenceError: LocalFileSystem is not defined". Here's my code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jsPDF</title> <script src="js/jquery-1.7.1.min.js"></script> <script src="js/jspdf.js"></script> <script src="js/FileSaver.js"></script> <script src="js/html2canvas.js"></script> <script> function guardar(){ var pdf = new jsPDF('p', 'pt', 'a4'); var source = $('

How can I add div content to a new page in jspdf?

江枫思渺然 提交于 2019-12-23 20:06:29
问题 How can I add div content to a new page in jspdf? I tried to use <br> and it creates a new page but I can't see the contents. <div id="printArea"> <div style="margin: 3px 430px;">First Page</div> <div>Place content to Second Page</div> </div> var doc = new jsPDF(); var specialElementHandlers = { '#editor': function (element,renderer) { return true; } }; $('#wrapper_div').on("click", "#print", function () { doc.fromHTML($('#printArea').html(), 15, 15, { 'width': 170,'elementHandlers':

Exporting images to jsPDF from html

故事扮演 提交于 2019-12-23 18:31:24
问题 I have a webpage on which I wish to print some HTML. To do so, I use html2canvas and jsPDF . The issue that I encounter is that it does not print the images shown in the HTML. My HTML and css looks as follows (complete code in fiddle): .handsomeHtml { background: red; } .crazyFrog { background: url('http://e-cdn-images.deezer.com/images/artist/01eb92fc47bb8fb09adea9f763bb1c50/500x500.jpg'); width: 500px; height: 500px; } <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1

Can't find name jsPdf in TypeScript

蹲街弑〆低调 提交于 2019-12-23 15:10:05
问题 My task is to print the data's into a pdf file using JavaScript . So i selected jsPdf for my task and Succeeded in that also . My task task is to convert that print task into TypeScript . Here am facing a new problem Can't find name jsPdf in TypeScript i don't know the reason here because the code which was successfully run in my JavaScript is failed to do that when run with TypeScript . I spended two day's for finding solution for that but failed . Refer many site's but didn't find out any

Angular 7: convert HTML to PDF

允我心安 提交于 2019-12-23 13:11:08
问题 I'm trying to convert an HTML table to a PDF without success. I've used jsPDF to do that but the result is really poor and I'm trying to understand why. Considering I have a tablet, what I want is to have this table printed on A4 pages in landscape mode (using all the pages that are needed). My problem is that the PDF is composed by images (and I prefer text) and that images are in a really low quality. What I've tryed is this: const html = document.getElementById('resultTable'); const pdf =

jsPDF page break

ε祈祈猫儿з 提交于 2019-12-23 12:17:45
问题 I have 2 divs in my page tab1 and tab2. I would like to export both divs in 1 PDF file with tab1 as the 1st page and tab2 starting from the following page. Currently the 2nd div appears broken in the exported file hence I would like to have the div appear from the next page. Any help would be appreciated. 回答1: Just use <!--ADD_PAGE--> (ADD_PAGE with in commented angular <> braces) from where you want new page. It works. 来源: https://stackoverflow.com/questions/36300310/jspdf-page-break

Adding a fixed header/footer for each page jsPDF

删除回忆录丶 提交于 2019-12-23 12:08:33
问题 I am using jsPDF to generate PDF's out of dynamic HTML content of my web-application. Right now I am trying to give those PDF's a unique layout. I want to add a "header" & "footer" for each page of my PDF. jsPDF generates page breaks automaticly and there is no command to act on those. Is there any known work-a-round to implement a fixed header/footer for each page without depending on doc.addPage(); Looking forward for any help or ideas. 回答1: See https://github.com/MrRio/jsPDF/pull/260 You

Can't create instance of jsPDF class - Error : « jsPDF » is undefined - IE11

做~自己de王妃 提交于 2019-12-23 05:22:42
问题 I know it's close to these posts : jsPDF is not supported in remote server for IE-11 I am generating a pdf file using jspdf library and I am getting the error "jspdf is not defined" but since they are old unresolved topics, i'll up it here. Here is my problem : I don't understand why I can't create a new instance of jsPDF. I'm using an existing library that I downloaded to be sure it was ok : <script language="javascript" type="text/javascript" src="C:\Program Files (x86)\Apache Software

Saving pdf on server side with jsPDF

雨燕双飞 提交于 2019-12-23 01:58:20
问题 I have an application that generates a HTML page with data which the user can edit. At the end I generate a .pdf file with jsPDF. Is there any way that I can save this generated .pdf on my server-side database? I'm using PrimeFaces. Thanks in advance 回答1: Thanks all for the help! I've found my solution: Once the user presses on the button to generate the .pdf, I'll save all the data he filled on the database, just the data. When the user wants to see the pdf he generated back, I'll generate a