I have a bunch of pdf files/forms that are all in a standardized format. They contain information such version history, author, who signed the document, and what documents it references. I need to extract that information to feed into a database containing information about the documents. I am pretty sure I could do this using a regular expression(s),but I am not entirely sure how to go about it. I would like to automate the process also, so that when new documents are created, they are added to the system, and also the system looks at all the documents on a web page and extracts the information.
What software do I need to convert a pdf to text that can then be processed using regex to extract specific pieces of data?
It's possible to convert
*nix it's possible to automate this using
pdftotext command line tool and a combination of
To download/upload documents from/to a web server you can use
SSH access is enabled or
lftp, extract metadata locally and push it to a web server. You will need to have a list of documents you already processed. Alternatively, you don't even need to download
sshfs. You can trigger the operation of extracting metadata every time a new
inotify mechanism or some kind of web server callback or execute it regularly using a
I am still not sure whether you prefer
Windows. If you prefer the latter, I can't help you because I don't use it.
Creatorof a given
exiftool doc.pdf | grep "^Creator" | perl -pe 's,^Creator.+: (.*)$,\1,'. To find an author:
exiftool doc.pdf | grep "^Author" | perl -pe 's,^Author.+: (.*)$,\1,'
*nixit's possible to automate this using
pdftotextcommand line tool and a combination of
pdftotext [options] [PDF-file [text-file]]. It also says that
Pdftotext reads the PDF file, PDF-file, and writes a text file, text-file. If text-file is not specified, pdftotext converts file.pdf to file.txt. If text-file is Â´-', the text is sent to stdout.. So, for example:
pdftotext <doc>.pdfwill produce
<doc>.txtin the same directory.