-
Notifications
You must be signed in to change notification settings - Fork 0
/
image.rb
32 lines (28 loc) · 978 Bytes
/
image.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'rubygems'
require 'prawn'
require 'prawn/core'
require 'prawn/layout'
pdf = Prawn::Document.new(:page_size => 'A4', :layout => 'portrait') do
text "Sandip Ransing", :size => 21, :align => :center
#stroke horizontal_rule
stroke do
rectangle [0,740], 525, 1
end
move_down(20)
text "ROR developer based in India", :size => 32
text "Email: [email protected]", :size => 21
move_down(20)
text "Image", :size => 21
move_down(20)
image 'sandip.png', :position => :center
move_down(20)
text "Scale Image", :size => 21
move_down(20)
image 'sandip.png', :height => 50, :position => :center, :border => 2
move_down(20)
text "Open Remote Image (from my facebook account)", :size => 21
move_down(20)
require "open-uri"
image open("http://t2.gstatic.com/images?q=tbn:kTG6gAKrnou2gM:http://www.facebook.com/profile/pic.php?uid=AAAAAQAQrLXvTWfyY2ANjttV8D1c0QAAAAnDHPFJe0pPFR84iIzXPKro&t=1")
end
pdf.render_file 'sample/image.pdf'