There actually was a problem with the input PDFs: if they were not in the working directory, the script was crashing. Also, the output pages were not in the correct order (the order in which the user gave the PDFs). Finally, the script was retuning 0 even if no page matched the patterns (the exit status is useful when using the command inside another script).

I made all those fixes and heavily commented the script (for those who want to learn Shell scripting): http://dcc.ufmg.br/~lcerf/en/utilities.html#pdf-page-grep

Reply via email to