Remove all space from bottom in PDFKit

Viewed 135

I want to remove white space from bottom. My code is

var doc = new PDFDocument({
   size: [200,100]
  });
  doc.font('Times-Roman')
      .fontSize(7)
      .text("1.49G",100,4);
  doc.font('./public/fonts/LibreBarcode39-Regular.ttf')
      .fontSize(18)
      .text('12345678',145,4,{align:"right"});
  doc.font('Times-Roman')
        .fontSize(7)
        .text("DC1",100,20)
        .text("120,000MMK",145,20,{align:"left"});
  doc.end();
  doc.pipe(fs.createWriteStream("./public/upload/barcode/doc.pdf"));

This result is

enter image description here

Actually, I want to change size [200,100] to [200,50]. But it split many template as in picture(2) when I reduce height size.

enter image description here

So, I want to remove space from bottom. Any help would be much appreciated!

0 Answers
Related