class Rodolfo::Reader

Reads a PDF info and metadata

Public Class Methods

new(pdf) click to toggle source
# File lib/rodolfo/reader.rb, line 8
def initialize(pdf)
  @reader = PDF::Reader.new pdf
end

Public Instance Methods

to_h() click to toggle source
# File lib/rodolfo/reader.rb, line 12
def to_h
  {
    PdfVersion: @reader.pdf_version,
    Info: @reader.info,
    Meta: @reader.metadata,
    Pages: @reader.page_count
  }
end
to_json() click to toggle source
# File lib/rodolfo/reader.rb, line 21
def to_json
  JSON.pretty_generate to_h
end