Preflight In Ruby29 Jul 2011
To check a given PDF conforms to a required standard you run a preflight check. There are expensive programs that can preflight, but they’re ….. expensive, and generally hard to script.
I recently released the preflight rubygem for performing preflight checks from ruby. It’s not as full featured as the commercial options, but it’s free and may solve 80% of your problem.
Start by installing the gem
To check a file passes a PDF/X-1a preflight it’s just three lines.
If you need more control over the profile, you can build your own profile.
For a list of available rules, check out the classes in the Preflight::Rules namespace - each class has documentation describing how to use it in a profile.
If the provided rules don’t cover everything you need, you can also write your own.
For more details and examples, check out project on github.