Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Looking for a command line tool for Windows / linux environment that can check a PDF file for any errors (not for repairing).

share|improve this question

migrated from stackoverflow.com Oct 8 '10 at 12:54

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

Well, I'm not sure about that, but i think that ghostscript can be of use. It works with PS and with PDF, and I heard that it is very strict.

share|improve this answer
add comment

One thing I use on Linux is pdfinfo, which comes with the poppler package.

For normal PDF files, it gives me about 15 lines of information on the file. For the broken PDF files I have, or non-PDF files, it spits out errors before giving the 15 lines of information, if any. I can pipe the output to a "grep ^Error" if I just want the errors. Or if I so wanted I could just modify the source code to just output errors.

share|improve this answer
add comment

With Ghostscript on Windows use:

gswin32c.exe ^
   -o nul ^
   -sDEVICE=nullpage ^
    c:/path/to/input.pdf

On Linux use:

gs \
   -o /dev/null \
   -sDEVICE=nullpage \
    c:/path/to/input.pdf

All errors or warnings encountered by Ghostscript it will print to stdout/stderr.

It will NOT convert your original file, just report what would happen if you actually did a real conversion. This serves a quite good chcker... just as you wanted it. Just use the latest Ghostscript version (current one is 9.02).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.