Parent

Included Modules

Class/Module Index [+]

Quicksearch

Rabbit::ImageManipulable::PDF

Public Class Methods

match?(filename) click to toggle source
# File lib/rabbit/image/pdf.rb, line 15
def match?(filename)
  return true if File.extname(filename) == ".pdf"

  File.open(filename) do |file|
    line = file.gets
    return false if line.nil?

    begin
      /\A%PDF-1\.\d\z/ =~ line.chomp
    rescue ArgumentError
      false
    end
  end
end

Public Instance Methods

draw(canvas, x, y, params={}) click to toggle source
# File lib/rabbit/image/pdf.rb, line 31
def draw(canvas, x, y, params={})
  if @document and canvas.poppler_available?
    default_params = {
      :width => width,
      :height => height,
    }
    canvas.draw_poppler_page(page, x, y, default_params.merge(params))
  else
    super
  end
end
pixbuf() click to toggle source
# File lib/rabbit/image/pdf.rb, line 43
def pixbuf
  @pixbuf ||= to_pixbuf
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.