Sha256: e52dd151f224c39a804fd9353798e1f84288e054af03c6ac5e4af6850b18da68
Contents?: true
Size: 1.18 KB
Versions: 17
Compression:
Stored size: 1.18 KB
Contents
# coding: utf-8 class PDF::Reader # DEPRECATED: this class was deprecated in version 0.11.0 and will # eventually be removed # class MetadataStrategy < AbstractStrategy # :nodoc: def self.to_sym :metadata end def process return false unless options[:metadata] # may be useful to some people callback(:pdf_version, ohash.pdf_version) # ye olde metadata callback(:metadata, [decoded_info]) if info? # new style xml metadata callback(:xml_metadata, [xml_metadata]) if xml_metadata? # page count if pages? count = ohash.object(pages[:Count]) callback(:page_count, count.to_i) end end private def xml_metadata return @xml_metadata if defined?(@xml_metadata) if root[:Metadata].nil? @xml_metadata = nil else string = ohash.object(root[:Metadata]).unfiltered_data string.force_encoding("utf-8") if string.respond_to?(:force_encoding) @xml_metadata = string end end def xml_metadata? xml_metadata ? true : false end def decoded_info @decoded_info ||= decode_strings(info) end end end
Version data entries
17 entries across 17 versions & 3 rubygems