I am using jspdf.debug.js
latest version.
FontAwesome
icons used in a web page are not rendering in pdf
.
I added a FontAwesome
user icon in the page.Refer to the image.(Left one is HTML
and pdf
output is on right)
Below is my code snippet.
var pdf = new jsPDF('p', 'pt', 'letter');
pdf.addFont('FontAwesome', 'FontAwesome', 'normal');
pdf.setFont('FontAwesome');
pdf.canvas.height = 72 * 11;
pdf.canvas.width = 72 * 8.5;
html2pdf(document.body, pdf, function(pdf){
var iframe = document.createElement('iframe');
iframe.setAttribute('style','position:absolute;right:0; top:0; bottom:0; height:100%; width:500px');
document.body.appendChild(iframe);
iframe.src = pdf.output('datauristring');
});