A tool cut the black margin of eps figure
Base on gs
- first, get the bounds of the eps figure using the following command
gs -dNOPAUSE -dBATCH -q -sDEVICE=bbox fileName.eps
The output is, i.e
%%BoundingBox: 0 1 258 167
%%HiResBoundingBox: 0.594000 1.224000 257.140820 166.921800
- Then, replace the BoundingBox with the output value, usually lying at the first 3 lines of the eps figure.
- set up the environment
source setup.sh
- Cut Cut Cut
epstool fileName.eps
convert source.png -gravity SouthEast -background white -splice 0x0 -background
black -splice 0x0 -fuzz 5%% -trim +repage -chop 0x0 mks.png