Created
July 28, 2015 22:32
-
-
Save backwardm/96427244cd6cc4c37ee9 to your computer and use it in GitHub Desktop.
Counting PDF pages with pdf-reader gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'pdf-reader' | |
Dir.glob("/Users/mike/Desktop/zip/**/*").each do |pdf| | |
next if pdf == '.' or pdf == '..' or pdf == '.DS_Store' | |
if File.file?(pdf) | |
reader = PDF::Reader.new(pdf) | |
puts (pdf + "," + reader.page_count.to_s) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment