Sha256: 20c6be871f52ce8813ee82e0bb2c226792cba5e3d5d3053cd6970a3260b9a88a

Contents?: true

Size: 922 Bytes

Versions: 1

Compression:

Stored size: 922 Bytes

Contents

# encoding: UTF-8
require 'safe_shell'

module Grim
  # Default resize output width, any positive integer
  WIDTH = 1024

  # Default image quality, 1 to 100
  QUALITY = 90

  # Default density, any positive integer
  DENSITY = 300

  # Default exception class for Grim.
  class Exception < ::StandardError
  end

  # Exception that is raised if pdf is not found.
  class PdfNotFound < Grim::Exception
  end

  # Exception that is raised if pdf does not have page
  class PageNotFound < Grim::Exception
  end

  # Exception that is raised if an empty path is passed to Grim::Page#save
  class PathMissing < Grim::Exception
  end

  # Creates and returns a new instance of Grim::Pdf
  #
  # path - a path string or object
  #
  # For example:
  #
  #   pdf = Grim.reap(/path/to/pdf)
  #
  # Returns an instance of Grim::Pdf
  #
  def self.reap(path)
    Grim::Pdf.new(path)
  end
end

require 'grim/pdf'
require 'grim/page'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grim-0.2.3 lib/grim.rb