#!/usr/pkg/bin/ruby33

require 'rubygems'

$LOAD_PATH.unshift(File.dirname(__FILE__) + "/../lib")

require 'pdf/reader'

receiver = PDF::Reader::PrintReceiver.new

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
  puts "********************************"
  puts "page #{page.number}"
  puts page.attributes.inspect
  puts "********************************"
  page.walk(receiver)
end
