diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-04-25 15:43:26 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-04-26 15:12:58 +0200 |
commit | a7c3d73078f9e0cfc12d7eee86d0e2de197768ab (patch) | |
tree | 3c3edc73cf4a49f4e1e8d31e7bc0cd388137314f /docs/mutool/examples/draw-document.js | |
parent | ccba5ca5548a394670f4e71d1df5be0efc66db69 (diff) | |
download | mupdf-a7c3d73078f9e0cfc12d7eee86d0e2de197768ab.tar.xz |
Add 'mutool run' documentation.
Diffstat (limited to 'docs/mutool/examples/draw-document.js')
-rw-r--r-- | docs/mutool/examples/draw-document.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/mutool/examples/draw-document.js b/docs/mutool/examples/draw-document.js new file mode 100644 index 00000000..1e285ede --- /dev/null +++ b/docs/mutool/examples/draw-document.js @@ -0,0 +1,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"); +} |