I am using pdfkit to generate PDF file and I want to send this PDF file to browser. My following code is working fine and I am getting one pdf with text.
Actually following code is sample to generate PDF using pdfkit in Node.js but now I want to create html table.
Latest Code
var PDFDocument = require("pdfkit");
var fs = require("fs");
doc = new PDFDocument();
doc.pipe(fs.createWriteStream("out.pdf"));
doc.moveTo(300, 75)
.lineTo(373, 301)
.lineTo(181, 161)
.lineTo(419, 161)
.lineTo(227, 301)
.fill("red", "even-odd");
var loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in...";
doc.y = 320;
doc.fillColor("black");
doc.text(loremIpsum, {
paragraphGap: 10,
indent: 20,
align: "justify",
columns: 2
});
doc.pipe(res);
doc.end();
But I don't have any idea how to generate HTML table in pdf using pdfkit?
Can any one help me to create HTML table PDF?