A-PDF :: Affordable PDF Tools

How to convert a complete subdir of PDF files to text?

Return KB main page

Question

I need the ability to extract text from a subdir of PDF files. How to do that with A-PDF Text Extractor Command Line?

Solution

You can use dos command to do that. For example, you can need process files in c:\pdfs and subdirs, you may type the command:

FOR /F "tokens=*" %G IN ('DIR /b /s "c:\pdfs\*.pdf"') do PTCMD "%G"

More detail about the commnad:

DIR /B /S c:\pdfs\*.pdf
lists all files that are named ".pdf"
/B makes the output "bare" with nothing but the file name
/S recurses subdirectories to include their contents if they match the listing criteria

FOR /F processes each item (in this case directories) in the set IN ('[command]') by executing the DO [command]
%G is a parameter, which in this example is a pdf file name
"tokens=*" says that all the characters output in a line (i.e. by the dir command) are assigned to the parameter %G

If you need use it in a batch file, you need replace the %G to %%G.

Related products

We always like improving our products based on your suggestions. Please send your feedback (or ask questions) to us in the contact page.

Return KB main page