Sha256: 4360a3c51f6a6a1db1fcabb4358bd1aff414c7152104c2d593573cc9a0192743

Contents?: true

Size: 442 Bytes

Versions: 17

Compression:

Stored size: 442 Bytes

Contents

#!/usr/bin/env ruby

# coding: utf-8
# Extract metadata only

require 'rubygems'
require 'pdf/reader'

class MetaDataReceiver
  attr_accessor :regular
  attr_accessor :xml

  def metadata(data)
    @regular = data
  end

  def metadata_xml(data)
    @xml = data
  end
end

receiver = MetaDataReceiver.new
pdf = PDF::Reader.file(ARGV.shift, receiver, :pages => false, :metadata => true)
puts receiver.regular.inspect
puts receiver.xml.inspect

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
pdf-reader-0.10.1 examples/metadata.rb
fireinc-pdf-reader-0.11.0 examples/metadata.rb
fireinc-pdf-reader-0.11.0.alpha examples/metadata.rb
pdf-reader-0.11.0.alpha examples/metadata.rb
pdf-reader-0.10.0 examples/metadata.rb
pdf-reader-0.9.3 examples/metadata.rb
pdf-reader-0.9.2 examples/metadata.rb
pdf-reader-0.9.1 examples/metadata.rb
pdf-reader-0.9.0 examples/metadata.rb
pdf-reader-0.8.6 examples/metadata.rb
pdf-reader-0.8.5 examples/metadata.rb
pdf-reader-0.8.4 examples/metadata.rb
pdf-reader-0.8.3 examples/metadata.rb
pdf-reader-0.8.2 examples/metadata.rb
pdf-reader-0.8.1 examples/metadata.rb
pdf-reader-0.8.0 examples/metadata.rb
pdf-reader-0.7.7 examples/metadata.rb