nodejs gm module script to split a big multipage tiff file in multiple single images

StackOverflow https://stackoverflow.com/questions/22156805

  •  19-10-2022
  •  | 
  •  

Domanda

When executed from command line, invoking directly GraphicsMagick, the following instructions split correctly a big tiff multipage image in several single image files. Now I need to find the right translation to make it work with the Node.js gm module ( http://aheckmann.github.com/gm/):

gm convert +adjoin -trim input.pdf PNG8:output%03d.png

Any help would be really appreciated.

È stato utile?

Soluzione

You can use custom arguments directly from nodejs.

Example:

var gm = require('gm');

gm().command('convert').in('+adjoin').in(filePath).write('image%02d.jpeg', function(err) {
   // something                
});

Info: https://github.com/aheckmann/gm

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top