Created
March 23, 2015 12:26
-
-
Save KitaitiMakoto/e78f4b11fff73d8ece48 to your computer and use it in GitHub Desktop.
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
Encoding.default_external = 'UTF-8' | |
Encoding.default_internal = 'UTF-8' | |
require 'poppler' | |
path = ARGV.shift | |
unless path | |
$stderr.puts 'Specify PDF file' | |
abort | |
end | |
pdf = Poppler::Document.new(File.read(path)) | |
0.upto(pdf.size - 1) do |i| | |
puts pdf[i].get_text | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment