#!/usr/pkg/bin/ruby34

require 'rubygems'
require 'pdf/reader'

if ARGV.empty?
  browser = PDF::Reader.new(StringIO.new(ARGF.read))
else
  browser = PDF::Reader.new(ARGV[0])
end
browser.pages.each do |page|
  puts page.text
end
