Created
June 6, 2017 02:03
-
-
Save panfu/185a603ea20ee0e9321ce3c56870bc75 to your computer and use it in GitHub Desktop.
sample for pdfkit usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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