Sha256: 7b76a90f441f2063a7e7608cb85162e862b29e85b7ea3c6d28490b8ad947e8bc

Contents?: true

Size: 781 Bytes

Versions: 4

Compression:

Stored size: 781 Bytes

Contents

=begin
* **Install**: Ruby-Gnome
=end
module Poppler 

=begin
Additional Method List
---------------------
* \#npages: _alias from size_
=end
class Document
	alias npages size
	# get width height
	def wh; self[0].size end
	# get width
	def w; wh[0] end
	# get height
	def h; wh[1] end
end # class Document

=begin
Additional Method List
----------------------
* \#wh: _alias from size_
=end
class Page
	alias wh size
	# get width
	def w; size[0] end
	# get height
	def h; size[1] end

	# used when 'cairo' is installed
	#
	# @return [Cairo::Context]
	def cairo_context
		require "cairo"
		require_relative "cairo"
		surface = Cairo::ImageSurface.new(*self.wh)
		ctx = Cairo::Context.new(surface)
		render(ctx)
		ctx
	end # def cairo_context

end # class Page

end # module Poppler

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tagen-0.2.1 lib/tagen/poppler.rb
tagen-0.2.0 lib/tagen/poppler.rb
tagen-0.1.1 lib/tagen/poppler.rb
tagen-0.1.0 lib/tagen/poppler.rb