Sha256: 8b51fd062213acc10e31c4b97d61e941d1cae104d5820fcbe65cdd0dfa5bac3e
Contents?: true
Size: 672 Bytes
Versions: 12
Compression:
Stored size: 672 Bytes
Contents
#!/usr/bin/env ruby # coding: utf-8 $:.unshift(File.dirname(__FILE__) + "/../lib") require 'pdf/wrapper' @pdf = PDF::Wrapper.new("translate.pdf", :paper => :A4) def captioned_image(filename, caption, x, y) @pdf.translate(x, y) do @pdf.image(filename, :top => 0, :left => 0, :height => 100, :width => 100, :proportional => true) @pdf.text("Image Caption", :top => 110, :left => 0) end end captioned_image(File.dirname(__FILE__) + "/../specs/data/orc.svg", "One", 100, 100) captioned_image(File.dirname(__FILE__) + "/../specs/data/orc.svg", "Two", 250, 300) captioned_image(File.dirname(__FILE__) + "/../specs/data/orc.svg", "Three", 400, 500) @pdf.finish
Version data entries
12 entries across 12 versions & 1 rubygems