Skip to content

Instantly share code, notes, and snippets.

@panfu
Created June 6, 2017 02:03
Show Gist options
  • Save panfu/185a603ea20ee0e9321ce3c56870bc75 to your computer and use it in GitHub Desktop.
Save panfu/185a603ea20ee0e9321ce3c56870bc75 to your computer and use it in GitHub Desktop.
sample for pdfkit usage
var PDFDocument = require('pdfkit')
const fs = require('fs');
var doc = new PDFDocument
doc.image('images/qrc_1000.png', 20, 15, {width: 100}).text('Proportional to width', 0, 0)
doc.image('images/qrc_1000.png', 220, 15, {width: 100}).text('Proportional to width', 0, 0)
doc.image('images/qrc_1000.png', 320, 15, {width: 100}).text('Proportional to width', 0, 0)
doc.image('images/qrc_1000.png', 420, 15, {width: 100}).text('Proportional to width', 0, 0)
doc.pipe(fs.createWriteStream('test_out.pdf'))
doc.end()
function genQRcodePDFwithIDs(...ids) {
console.log(ids);
}
genQRcodePDFwithIDs(1,2,3,4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment