Прежде всего, вы можете изменить скрипт здесь, после проверки этого скрипта он будет работать
<script type="text/javascript">
document.getElementById('downloadbtn').addEventListener('click',
exportPDF);
var specialElementHandlers = {
// element with id of "bypass" - jQuery style selector
'.no-export': function(element, renderer) {
// true = "handled elsewhere, bypass text extraction"
return true;
}
};
function exportPDF() {
var pdf = new jsPDF('p', 'pt', 'a4');
var img = new Image;
pdf.text('Recommended Consumer Price list Month : <?php echo date('F Y'); ?>', 150,31);
pdf.text('Customer Care : 9010316786', 150,51);
pdf.text('email us : info@karimullagroup.com', 150,71);
pdf.text('Website : www.karimullagroup.com', 150,91);
var source = document.getElementById('canvas').innerHTML;
margins = {
top: 80,
bottom: 60,
left: 50,
width: 322
};
// all coords and widths are in jsPDF instance's declared units
// 'inches' in this case
pdf.fromHTML(
source, // HTML string or DOM elem ref.
margins.left, // x coord
margins.top, { // y coord
'width': margins.width, // max width of content on PDF
'elementHandlers': specialElementHandlers
},
function (dispose) {
// dispose: object with X, Y of the last line add to the PDF
// this allow the insertion of new lines after html
img.onload = function() {
pdf.addImage(this, 40, 10, 90, 70);
pdf.save('starfence.pdf');
} },margins);
img.crossOrigin = "";
img.src = "images/Starfence.png";
}
</script>