How to convert a pdf file into sequentially numbered images and animated gif

pdftoppm -rx 300 -ry 300 -png myPDFfile.pdf img
pdftoppm -rx <dpi-x> -ry <dpi-y> -<image-format> <input-pdf-file> <image-file-pre-fix>
  1. The above command in Linux will convert each page of the pdf file “myPDFfile.pdf” into sequentially numbered png files of the file names starting with “img” such as
  2. Options “-rx 300 -ry 300” means that 300 dpi is used for both x and y coordinates.

convert -delay 3000 -loop 0 img*.png myimage.gif
convert -delay <time-interval> -loop <loop-number> <imagge-file-prefix>*.png <output-gif-file>
  1. The above command read all the png files, starting with “img” and convert the image files into a single animated gif file, myimage.gif.
  2. The “-delay” option indicate the interval between two images in millisecond. So, “-delay 3000” means 3 seconds between two slide images.

About albertsk

Professor at the University of Hawaii
This entry was posted in Uncategorized. Bookmark the permalink.