Batch file to convert all pdf to text (with xpdf)

13.3k views Asked by At

I would like to run a batch conversion in a folder with full of pdf files. I have using xPDF and this is the command prompt for a single file:

c:\Test\pdftotext -layout firstpdftoconvert.pdf firstpdfconverted.txt

Could somebody help please to do it in one go (convert all the pdf files only) using a batch file? Thanks in advance!

1

There are 1 answers

4
marapet On BEST ANSWER

Combining your question with this answer iterating over files of a directory:

for /r %i in (*.pdf) do "c:\Test\pdftotext" -layout "%i"

This will work on all pdf files in the current directory.

Be sure to double the % signs if you run this from a batch file.