convert pdf to bitmap
There are several ways to convert pdf file to bitmap (jpg, png, etc), including PREVIEW, InkScape, Illustrator, PDF-Xviewer, and the convert command in ImageMagick, etc.
However, these methods may encounter a problem induced by "anti-aliasing", if there are too many small triangle elements (such as pcolor figures created in MATLAB).
Now I find "gs" from the GhostScript package do this job best (by disabling 'anti-aliasing' effect).
The command is like:
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -dGraphicsAlphaBits=1 -dTextAlphaBits=1 -sOutputFile=outimage.png inputfile.pdf
Here, '-r300' indicates resolution for output image. '-dTextAlphaBits=1' applies for text.
UPDATE:
If the bitmap figure is used by InkScape as link (open .svg file in text mode and see 'href' value there), it is quite nice that changing the resolution of bitmap doesn't change the size in InkScape, so that all positions are kept.
Update2:
To save multiple pages into separate files, do:
gs -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile="image_%02d.png" inputfile.pdf
However, these methods may encounter a problem induced by "anti-aliasing", if there are too many small triangle elements (such as pcolor figures created in MATLAB).
Now I find "gs" from the GhostScript package do this job best (by disabling 'anti-aliasing' effect).
The command is like:
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -dGraphicsAlphaBits=1 -dTextAlphaBits=1 -sOutputFile=outimage.png inputfile.pdf
Here, '-r300' indicates resolution for output image. '-dTextAlphaBits=1' applies for text.
UPDATE:
If the bitmap figure is used by InkScape as link (open .svg file in text mode and see 'href' value there), it is quite nice that changing the resolution of bitmap doesn't change the size in InkScape, so that all positions are kept.
Update2:
To save multiple pages into separate files, do:
gs -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile="image_%02d.png" inputfile.pdf