I’m creating a program in Ruby to analyze several GB of pdf’s and I only need two data:
- Validate the pdf file, return “error” if the pdf is corrupted
- Number of pages the pdf has
Is it possible to use Sumatra for this? For example Ruby using cmd calls Sumatra.exe asking it to return two pieces of data and Sumatra responds True/995.
I have used some gems but the strategies they apply for page counting is literally counting one at a time, which is slow, and what’s worse I haven’t found any reliable gems that validate pdf, some do but they do it wrong.
If Sumatra doesn’t work for this, do you know any API that I can use?