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 33 34 35 36 37 38 39
|
# Examples for embedding images.
require_relative '../example_helper'
Prawn::ManualBuilder::Example.generate('images.pdf', page_size: 'FOLIO') do
package 'images' do |p|
p.section 'Basics' do |s|
s.example 'plain_image'
s.example 'absolute_position'
end
p.section 'Relative Positioning' do |s|
s.example 'horizontal'
s.example 'vertical'
end
p.section 'Size' do |s|
s.example 'width_and_height'
s.example 'scale'
s.example 'fit'
end
p.intro do
prose <<-END
Embedding images on PDF documents is fairly easy. Prawn supports both
JPG and PNG images.
The examples show:
END
list(
'How to add an image to a page',
'How place the image on a specific position',
'How to configure the image dimensions by setting the width and '\
'height or by scaling it'
)
end
end
end
|