Crop all images (from/in a PDF) at once taking parity into account, using only free tools

I’ve found this PDF:

I want it to look better, so I decided to cut away 159 pixels from the right side of all odd images, and the same amount from the left side of all even images.

First I extracted all images to a folder using Some PDF Image Extract (version 1.5), using bmp format.

Then I used cygwin command prompt. I probably could have used the cygwin mv and find commands from the windows command prompt too, or use some other windows ports of them, for example the gnuwin32 ports. This is how it looked like:

$ find


I did this:

mkdir even odd
mv  $(find -regex “…..[02468]\.bmp”) even
mv  $(find -regex “…..[13579]\.bmp”) odd

This is not ….. but 5 equal points. It seems WordPress is making an eclipse from the first 3 and I do not know how to prevent it. Oh, I’m waiting for the day when I will stop using such “clever” software!

Then I used IrfanView from the Windows command prompt.

set irf=”C:\Program Files\IrfanView\i_view32.exe”

I created cropped bitmaps

cd odd
%irf% *.bmp /crop=(0,0,2324,3367) /convert=..\bmp\*.bmp
cd ..
cd even
%irf% *.bmp /crop=(159,0,2483,3367) /convert=..\bmp\*.bmp
cd ..

and cropped gifs.

cd odd
%irf% *.bmp /crop=(0,0,2324,3367) /convert=..\gif\*.gif
cd ..
cd even
%irf% *.bmp /crop=(159,0,2483,3367) /convert=..\gif\*.gif
cd ..

I used bmps to create a new PDF using Options / Multiple images from the IrfanView (version 4.27) GUI. The default compression options seemed OK since the result PDF size was remarkably similar to the original PDF file size:
old PDF size / new PDF size = 3882 kB /3648 kB = 1.064
old image size / new image size = 2483 px /2324 px = 1.068

I deleted all bmps. I kept gifs for viewing in CDisplay.


  1. Gifs are too big and viewing in CDisplay is slow. I should have resized them.
  2. The new PDF is password protected. I did not want that.
  3. I was so proud to have done it in a simple way but now I see I did not need Some PDF Image Extract at all. I could have done the extraction with IrfanView too using “/extract”. Well, I just tried this and got bmps that seem to be lower quality, lower resolution and more than double size than those I got using Some PDF Image Extract! Also, as far as I remember, extracting using Some PDF Image Extract was much faster.
  4. Maybe even avoided that cygwin business using printing of only even/odd pages?
  5. Of course, all that could be done using other tools, say, ImageMagic library on Linux.


2. Instead of using IrfanView, which in turn uses ImPDF plugin, it is possible to use ImPDF directly (version 0.74 ). It’s a beautiful, only free tool I was able to find that makes PDFs from images. Unfortunately:
(a) no command line
(b) do not use drag-drop or the images will not appear in right order, use file/open instead
(c) it forgets all settings after each exit