Sha256: 6e07369e7c6563afe083cf9662c33a241d893dabe02f42c5832c200660d869fe

Contents?: true

Size: 561 Bytes

Versions: 24

Compression:

Stored size: 561 Bytes

Contents

module PDF
  class Inspector
    class Page < Inspector
      attr_reader :pages
      
      def initialize
        @pages = []
      end

      def begin_page(params)
        @pages << {:size => params[:MediaBox][-2..-1], :strings => []}
      end                       

      def show_text(*params)
        @pages.last[:strings] << params[0]
      end

      def show_text_with_positioning(*params)      
        # ignore kerning information
        @pages.last[:strings] << params[0].reject { |e| Numeric === e }.join
      end
      
    end   
  end
end

Version data entries

24 entries across 24 versions & 10 rubygems

Version Path
pdf-inspector-1.0.2 lib/pdf/inspector/page.rb
pdf-inspector-1.0.1 lib/pdf/inspector/page.rb
pdf-inspector-1.0.0 lib/pdf/inspector/page.rb
yellowlab-pdf-inspector-1.0.0 lib/pdf/inspector/page.rb
davebenvenuti-prawn-0.11.1.pre vendor/pdf-inspector/lib/pdf/inspector/page.rb
piglop-prawn-0.10.2.3 vendor/pdf-inspector/lib/pdf/inspector/page.rb
piglop-prawn-0.10.2.2 vendor/pdf-inspector/lib/pdf/inspector/page.rb
piglop-prawn-0.10.2.1 vendor/pdf-inspector/lib/pdf/inspector/page.rb
prawn-0.11.1.pre vendor/pdf-inspector/lib/pdf/inspector/page.rb
goodwill-prawn-edge-0.10.0 vendor/pdf-inspector/lib/pdf/inspector/page.rb
alphasights-prawn-0.10.4 vendor/pdf-inspector/lib/pdf/inspector/page.rb
alphasights-prawn-0.10.3 vendor/pdf-inspector/lib/pdf/inspector/page.rb
alphasights-prawn-0.10.2 vendor/pdf-inspector/lib/pdf/inspector/page.rb
alphasights-prawn-0.10.1 vendor/pdf-inspector/lib/pdf/inspector/page.rb
prawn-core-0.8.4 vendor/pdf-inspector/lib/pdf/inspector/page.rb
prawn-graph-0.0.2 vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/page.rb
prawn-graph-0.0.1 vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/page.rb
prawn-core-0.7.2 vendor/pdf-inspector/lib/pdf/inspector/page.rb
prawn-core-0.7.1 vendor/pdf-inspector/lib/pdf/inspector/page.rb
prawn-layout-0.3.2 vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/page.rb