'How to change background color in jspdf

I try to export image to PDF , But black background is showing around the image in PDF file. How can I remove this black background ?

Thanks



Solution 1:[1]

Try to export image to PDF as png it works for me .

var canvas = plot.getCanvas();
var src = canvas.toDataURL("image/png");
var doc = new jsPDF('landscape');
doc.addImage(src, 'PNG', 10, 20, 280, 150);

Please review full demo here working well in Mozilla.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jaydeep Pandya