8

I have a entire folder of nearly 4000 pdf files that had gotten accidentally scanned into pdf files instead of jpg by a co worker. we were scanning nearly 7000 paper files and at some point second shift somehow changed the saves to pdf.

This was originally done in windows, I have been chasing a way to correct this for over a week and everyone says use Linux, along the way i had installed mint, then dumped that for Ubuntu. I know nothing about command line.

All I need is a simple command to make this convert the contents of the entire folder. the problem being out of all the files that were scanned we don't know from the originals which ones were done correctly and which ones were done as pdf or we could just re scan them -- all the pdf files are separated in a folder by themselves.

I have no idea what to type, where to type it at or how to get this to work. Help please!

1

1 Answer 1

9

This will help convert all your pdf files to jpg images. It will preserve the original file names and add page numbers to them as this has to be done page by page.

Instructions:

  1. Open a terminal and cd to the directory containing the files you need to convert, for example if the directory is named pdf_files and located in your home directory run the following command:

    cd ~/pdf_files

    or

    cd /home/your_username/pdf_files

  2. Once inside that directory (you will know when you see the name of the directory appears on the left before the blinking courser), then you can type or copy and paste the following command in the terminal and press enter:

    find . -maxdepth 1 -type f -name '*.pdf' -exec pdftoppm -jpeg {} {} \;

Done, you will find the new converted jpg files in the same directory alongside the old pdf files.

Extra step:

If you wish to separate the converted jpg files from the original pdf files, please run the following command in the terminal after finishing step # 2 above to create a new directory called jpg_files within your current directory and move all jpg files into it:

mkdir jpg_files && mv *.jpg jpg_files/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .