-1

I'm using html-pdf to convert an SVG file to PNG, and I can't get the output image size to reflect the input size (128x128). Instead it comes with blank space (see image below). I've tried explicitly setting width and height, setting header and footer height (as per this link), but nothing has any effect.

Any suggestions?

enter image description here

Code:

htmlpdf.create(qrcode, { "border": "0", "type": "png"}).toFile(originalname.split(".")[0]+".png", function(err, res) {
        if (err) throw err;
        console.log(res);
      });
G.H.
  • 199
  • 10

1 Answers1

1

To fix the above problem you can make use of an npm package called: npm:sharp.

It worked perfectly for the problem above.

briancollins081
  • 845
  • 9
  • 19
G.H.
  • 199
  • 10