Flip n' Go!

Batch join JPEG images into PDF bundles.


Flip n' Go! was created in 2008 for the Stockholm City Archives in Sweden. The program was developed by Patrik Lermon as a favour to the archive.

The program has a few simple tasks, mainly it takes series of JPEG images and bundle them into a single PDF document (obviously using already existing excellent software like GhostScript and ImageMagick).

Note that Flip n' Go! is completely GUI-less, besides the PrintFile portion. The program is runned as a batch script.


The reason for this program is that the Stockholm City Archives for some types of documents have been switching from scanning documents to photographing them instead. This is not only quicker, but also more merciful to old books and documents. The quality is naturally not as good as it get with a good scanner, but the quality is certainly good enough for readiability, especially because Flip n' Go! does some auto contrast (using ImageMagick).

The photographies are taken using a camera mounted on the wall in a custom designed device which is able to place the camera in any desired position. The camera is connected to a computer running (unfortunately) Microsoft Windows. A foot-pedal (an X-keys Foot Pedal in our case) is connected to the computer, so zooming and taking photos can be handled using the feets, leaving the arms free to flip pages.

Photography station, with Flip n' Go! running on it.

The custom designed wall mount for the camera. Moves in all directions.

Program description

When Flip n' Go! is runned it will look in a certain folder for files matching the pattern *_???.jpg, and group files into PDF files. Consider the files:

These files will after program execution be resulting in two PDF files, one called patrik (002).pdf and one called erik (002).pdf.

Flip n' Go! is not very intelligent, so for images to get grouped they must match the pattern *_???.jpg, where ??? must be a number starting at 001 followed by a non-broken sequence (i.e. in the sequence 001, 002, 004, the images after 002 will be ignored).

The magic of numbering lies on the software used to take the photos, which automatically numbers the pictures.

Additionally Flip n' Go! will rotate images in the correct orientation using the software jhead, which reads the EXIF orientation flag out of the images.
Read about EXIF Orientation:

Detailed description

Flip n' Go! has all code in one file, rotate.vbs. All configuration of the program is also done within this file. Flip n' Go! is installed to %programfiles%\flipngo, so to change the behaviour of the program one must edit the file called %programfiles%\flipngo\rotate.vbs. In the top of this file is the configuration of which folders that are used to look for images.

These are the default folders/rules:

  • The JPEG images must reside in
    H:\Data\Mina bilder\Fotograferade handlingar
  • Images must match the pattern <name>_<3 numbers>.jpg, for example:
    Patrik_001.jpg, Patrik_002.jpg, Patrik_003.jpg
  • Files which are merged will be moved to the BACKUP folder:
    H:\Data\Mina bilder\Fotograferade handlingar\BACKUP
  • The folder for automatic printing is:
    H:\Data\Mina bilder\Fotograferade handlingar\Skriv ut

    Technical description

    The program (or rather script) is written in VBScript. This is how it works in general:

    • The program will loop over files wich are matching:
      H:\Data\Mina bilder\Mail\.*.jpg
    • Images are (one at the time) copied to:
      H:\Data\Mina bilder\Fotograferade handlingar\BACKUP
    • JHead is executed: jhead.exe -v -autorot <file>
    • ImageMagick is executed: imagemagick -contrast <file>.jpg <file>.pdf
    • Image is deleted (copy still resides in the BACKUP folder)
    • When the loop reaches the next "name" (i.e. in this example it reaches the file Patrik_003.jpg) all images which are now converted into PDF documents will be merged into one single PDF document using GhostScript
    • Finally all PDF files are deleted (besides the merged ones)

    Flip n' Go! uses the following software internally, which of all are distributed under the GPL or similar, besides PrintFile where I have got a written permission from the author to distribute:

    Flip n' Go! can also function as a copier (xerox machine) using a program called PrintFile. PrintFile monitors a folder, and whenever a JPEG file is put in this directory it will be printed. This is useful at Stockholm City Archives when people themselves are doing research on public material - this let's them copy more than 50 pages per minute, compared to an ordinary copier.


    Flip n' Go! is distributed under GPL. AFAIK that should be alright, because all software used internally is licensed under GPL or compatible licenses, besides PrintFile for which I have received a written permission to distribute it freely,


    Download flipngo from Sourceforge.