I have the following:
<a class="button" onclick="demoFromHTML()">Generate PDF</a>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.min.js"></script>
<script>
function demoFromHTML() {
var pdf = new jsPDF('p', 'mm', [297, 210]);
source = jQuery('.wpforms-entry-preview-table_compact')[0];
specialElementHandlers = {
'#bypassme': function (element, renderer) {
return true
}
};
margins = {
top: 20,
bottom: 20,
left: 20,
width: 572
};
pdf.fromHTML(
source,
margins.left,
margins.top,
'width': margins.width,
'elementHandlers': specialElementHandlers
},
function (dispose) {
pdf.save('Test.pdf');
}, margins);
}
</script>
The margins seem to work fine - but for some reason the actual DIV I am trying to print, is half way across on the page and half cut off, plus the font size is huge.
Am I missing something? Is there a setting to make the font size smaller? The actual div I am trying to print is 2 columns.