Zend certified PHP/Magento developer

when using pdfinfo on a large number of files and directories, how do I associate errors with filenames?

I am using pdftools to count the number of pages in several thousand PDFs; the command I use is:

find . -name *.pdf -print -exec pdfinfo {} ;|grep -E '^(.|Pages)' >> FileList

That part works fine now, thanks to a helpful commenter here.

The other problem is I get a lot of these errors in the console:

Syntax Error: Expected the optional content group list, but wasn't able to find it, or it isn't an array

AND one:

Syntax Error (2): Unknown compression method in flate stream.

Am I correct that both of these errors mean an error in the PDF file itself? How would I figure out which file is triggering these? Can I log this to another file (with the filenames) so I can figure out manually how many pages these PDFs have? There are not a huge number of files triggering the error, so it shouldn’t be too hard to look at them manually.

I tried the above find command but used &> to (in theory) send both stdout and stderr to the relevant file, with the filename, but that didn’t work.