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
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.
Changes to PDF viewer cannot be done in the cloud since the viewers are user application extensions to their browser so every browser can be set different by the client.
There seems to be a lack of knowledge that the web is in effect a transfer of data where the browser is responsible for securely requesting, accepting and editing the incoming into the display, thus a server can only advise not control such incoming data. Any attempt to control the user such as adverts, or other non-requested cajoling should ideally be blocked.
for more examples of colouring blackground's see https://stackoverflow.com/a/74228850/10802527