How to traverse folder and sub folder when converting PDF to image?

When you need to convert PDF to image, but your PDF files are kept here and there. Say you have 5000 PDF files and they are kept in folders and sub folders, but you need to do the conversion from PDF to image in a batch. How can you make that?In this article, I will take extracting tiff from PDF for example to show you how to convert PDF to image traversing folders and sub folders.

Take extracting tiff from PDF for example, you can convert PDF files under this directory “C:\Program Files\VeryPDF PDF2Image v2.1” to all the tiff file, no matter how many sub folders under this directory. You can set a output folder to save all the converted tiff file, like “C:\Program Files\VeryPDF PDF2Image v2.1\over”. Under this circumstance, you can write an bat file like the following snapshot. 

 convert pdf to image in batch

(ErgodicFilePath): set ErgodicFilePath=C:\Program Files\VeryPDF PDF2Image v2.1

(ExeFilePath): set ExeFilePath=C:\Program Files\VeryPDF PDF2Image v2.1

(OutPutFilePath): set OutPutFilePath=C:\Program Files\VeryPDF PDF2Image v2.1\over

The command: for /r "%ErgodicFilePath%" %%i in (*.pdf) do "%ExeFilePath%\pdf2img.exe" -i "%%i" -o "%OutPutFilePath%\%%~ni

=================================================

So the bat file content:

echo off

set ErgodicFilePath=C:\Program Files\VeryPDF PDF2Image v2.1

set ExeFilePath=C:\Program Files\VeryPDF PDF2Image v2.1

set OutPutFilePath=C:\Program Files\VeryPDF PDF2Image v2.1\over

for /r "%ErgodicFilePath%" %%i in (*.pdf) do "%ExeFilePath%\pdf2img.exe" -i "%%i" -o "%OutPutFilePath%\%%~ni.tif"

pause

============================================

bat file content

By this bat file, you can convert all the PDF files under this folder. This way can be used to all VeryPDF software to do batch conversion. If you need to download this software for a free trial, here is the link for you,http://www.verypdf.com/pdf2tif/pdf2image.exe. If you need to know more about this software, you can check it on its official homepage.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!