Original: Http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=251071&start=0
The core part of this program is to invoke the Pdftotxt command under Linux.
#!/bin/bash #与朋友们共享. If you have a good change of opinion, please leave a message to me. ubuntu.org.cn centerpoint Thank IRC#UBUNTU-CN IGoogle and other Daniel's help. Please comment. #功能: This program can convert PDF files into txt text in bulk. #用法: The number of maxdepth is directory depth, 1 is the directory. Save this file as pdf2txt.sh, set permissions to executable, and copy to the PDF file directory you want to convert. At the command line, CD to that directory. #执行./pdf2txt.sh can be. #作者: ubuntu.org.cn centerpoint 2010.1.6 #扫描的文件类型. Find./-maxdepth 1-name ' *.pdf ' >files.mybak myi=0 while read-line do filename= ' ${line##*/} '; Myi= ' echo ' $myi +1 "|BC ' echo" ************************ $myi *************************** "Ls-sh" ${filename} "Pdftotext" ${filename} "Ls-sh" ${filename%%.pdf}.txt "Done < Files.mybak RM Files.mybak