I have had a piece of code which generates a pdf from an image using html2canvas and jspdf. I create an image using the addImage() method and then save it on the callback of