eBookReaderSwitch/mupdf/docs/examples/draw-document.js

10 lines
280 B
JavaScript

// Draw all pages in a document and save them as PNG files.
var doc = new Document(scriptArgs[0]);
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");
}