summaryrefslogtreecommitdiff
path: root/docs/examples/draw-document.js
blob: 1e285ede6a8ca3ea63a0792ace5852b01aa240cc (plain)
1
2
3
4
5
6
7
8
9
// Draw all pages in a document and save them as PNG files.

var doc = new Document(argv[1]);
var n = doc.countPages();
for (var i = 0; i < n; ++i) {
	var page = doc.loadPage(i);
	var pixmap = page.toPixmap(Identity, DeviceRGB);
	pixmap.saveAsPNG("out" + (i+1) + ".png");
}