Skip to content

Instantly share code, notes, and snippets.

@glurp
Created February 1, 2013 18:58
Show Gist options
  • Select an option

  • Save glurp/4693283 to your computer and use it in GitHub Desktop.

Select an option

Save glurp/4693283 to your computer and use it in GitHub Desktop.
Tst pbif pdf generation witj 400,000 images
var PDFDocument = require('pdfkit');
var ML=2000
var MC=200
var px=6000/ML
var py=4000/MC
doc = new PDFDocument({margin: 10,size: [6000,4000]});
for (var col=0;col<ML*px;col+=px)
for (var li=0;li<MC*py;li+=py)
doc.image('test.png', col,li,{fit:[px,py]});
console.log("Created "+(MC*ML)+" images, write...")
doc.write('out.pdf');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment