I have straange problem with jsPDF, when i test on local pc, i generate PDF good, but when i upload online and try to generate, it looks like slipped, like in the picture
Here is the link to sample image
i have tried just create PDF from HTML, but lots of problems, then i decided to create image from html, then add it to jsPDF page, its 2 page ID card, then generate PDF, it works ok on local, and it work ok sometime online, but most of time it is not working, like in the picture.
var qrcode = new QRCode("qrBox", { text: "https://sis.paragonisc.edu.kh/verify?code="+studentId, width: 180, height: 180, colorDark : "#000000", colorLight : "#ffffff", correctLevel : QRCode.CorrectLevel.H });
var settings = { output: 'css', bgColor: '#FFFFFF', color: '#000000', barWidth: 5, barHeight: 100, moduleSize: 10, addQuietZone: true, showHRI: false, };
$("#barCodeBox").barcode(studentId, 'code39', settings);
var pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: [759, 1200] });
var imgData = ""; var imgData2 = "";
html2canvas($("#printPage"), {
onrendered: function(canvas) {
imgData = canvas.toDataURL('image/jpeg');
pdf.addImage(imgData, 'JPG', 0, 0, 759, 1200);
$('#printPage').hide();
$('#printPage2').show();
pdf.addPage();
html2canvas($("#printPage2"), {
onrendered: function(canvas) {
imgData2 = canvas.toDataURL('image/jpeg');
pdf.addImage(imgData2, 'JPG', 0, 0, 759, 1200);
pdf.save(arr[1]+'-'+arr[0]+'-'+studentId+'.pdf');
$('#qrBox').empty();
$('#loading').hide();
}
});
}
});