Not able to add Margin on page 2 onwards of generated pdf using addImage method
Here's the code I'm using -
`html2canvas($('[id$="iframePanel"]').get(0), {
background: "#ffffff",
onrendered: function(canvas) {
var imgData = canvas.toDataURL("image/jpeg", 1.0);
var imgWidth = 210;
var pageHeight = 295;
var imgHeight = canvas.height * imgWidth / canvas.width;
var heightLeft = imgHeight;
var doc = new jsPDF('p', 'mm', 'a4');
var position = 0;
doc.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight);
heightLeft -= pageHeight;
while (heightLeft >= 0) { position = heightLeft - imgHeight; doc.addPage(); doc.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight); heightLeft -= pageHeight; } blob = doc.output('blob'); doc.save('test.pdf'); } });`
here iframePanel is name of a div with content to be converted into pdf
This is a snapshot of pdf page 2 . I want a margin at top of each page