Relative Content

Tag Archive for jspdf

jsPDF doc.save() generate pdf includes image in pdf is working fine but using doc.output() string image part generate as junk

doc.addImage(this.image, ‘JPEG’, 75, 15,57,23); doc.text(20, 100, ‘Subject : Notification’); doc.save(‘Test.pdf’); above code is working fine generated PDF string below, downloaded properly in local save pdf string doc.addImage(this.image, ‘JPEG’, 75, 15,57,23); doc.text(20, 100, ‘Subject : Notification’); this.GenPDF = doc.output(); above code the image part render as junk in pdf file – generated PDF string below, attached […]

Why does JsPDF.html() not render html content?

const pdf = new jsPDF(‘p’, ‘pt’, ‘a4’); const style = $(` <style> body{ color: black } </style> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque in dictum non consectetur a erat nam at. Facilisis sed odio morbi quis. Ornare aenean euismod elementum […]

custom fonts are not working as expected in jspdf

We have a client side Angular application & we are generating a pdf from a lengthy report. It works fine but our output screen has the roboto fonts and I used this link to apply the custom fonts https://www.devlinpeck.com/content/jspdf-custom-font. When I add a css to override few classes then it works with downloaded pdf but not works with output screen. I wants to apply the same fonts to both on output screen and to the downloaded pdf.