Search Posts

Category: jspdf

trying to modify the js function so that it gives the same output as it was when called the other js function

I am exporting the content on the webpage to the PDF file, for this i have used jsPDF API and i could able to get it work but now i want to use html2PDF as it resolves few issues which were faced when using jsPDF API. I have written the function $scope.exportUsingJSPDF which is called when the button Export Using JSPDF is clicked. Similarly i want to implement the function $scope.exportUsingHTML2PDF which uses html2PDF API […]

canvas plugin not installed – exception

I want to export the content into PDF, for this i’m using html2PDF. When user click on export button, i want to export the content into PDF and download the PDF. I have large content in the div which i am getting dynamically. I am getting exception when clicked on export button. Exception below: jsPDF canvas plugin not installed. Please find the demo plunker: https://plnkr.co/edit/ixVF4HAQTYXh42ZeSM01?p=preview Below is the code demo: var app = angular.module(“app”, []); […]

showing SCRIPT5:Access is denied exception, when trying to download a PDF onclick on a button in IE11

I am trying to export the content to the PDF and download the PDF when user click on a button. Please find the demo here : https://plnkr.co/edit/5eIgTGjYjOeOoVGMWFMx?p=preview When user click on export button in the above show demo , content is exported to the PDF and a PDF is downloaded. I see two issues. First issue is when user click on export button, the download of PDF is not working when tested in IE11 but […]

unable to hide the div’s for each iteration and want to hide the border being displayed

When user click on export button, the data is exported to PDF. I’m trying to hide one of the div content while exporting to PDF. Below is the code i have used to hide the div content. $(“#dontExport1”).hide(); When the .hide() is used data is hidden on PDF and webpage too, so i have used $(“#dontExport1”).show() after generating and saving the PDF to display the hidden content again on webpage. Issue is with my code, […]

special characters are not being exported to PDF

I am using jspdf to export the data to PDF. When the data is exported to the PDF, special characters are not displayed in the PDF. Please find the demo plunker : https://plnkr.co/edit/BCgDQm3jV9ctwYJMWkjh?p=preview In the above demo plunker, when user click on export button, the content is exported to the PDF and PDF is downloaded but issue is i noticed special characters are not being exported to the PDF. The bullets and the numbers mentioned […]

Show each item in different pages with jsPDF export

I have a list of object, while getting each element of the object, I want to export each to individual pages inside the PDF. I am getting the data by iterating the list object(eg. $scope.employees). Currently when a user clicks on export button, the data is exported to the PDF. My requirement is each object while iterating should be stored in the individual pages of the PDF. Like for example the object with pageHeader “This […]

using jsPDF i want to export content from within js code instead of loading the entire div

I am working on java and angularjs application. I want to work with jsPDF to export data into PDF. I can able to succesfully use jsPDF to export the data when user click on the button. Please find the demo : https://plnkr.co/edit/HP4mG47G3bEHgVfsvNn8?p=preview In the above demo plunker, when user click on PDF button, i’m calling demoFromHTML() in which the content of the entire div with id=”exportthis” is exported. Please advice how to export the data […]

jsPDF muliple pages with div height – unable to determine the height

I am trying to generate a pdf from html divs with dynamic height and width. Below is the code. let pages = this.rootDataContainer.nativeElement.getElementsByClassName(‘pdfpage’); for (let i = 0; i < pages.length; i++) { this.pdfDoc.addHTML(pages[i], 0, 0, options, () => { let pxHeight = pages[i].offsetHeight / scaleFactor; this.pdfDoc.addPage(0, pxHeight); this.counter = this.counter – 1; }); } There are couple of issues I am facing. As addHTML is async, pages are added to pdf in random way. […]