Sha256: 45073ad649512e36b684468b73cd166bed2f88a8045967ed4ac00b5f961c4e12
Contents?: true
Size: 950 Bytes
Versions: 3
Compression:
Stored size: 950 Bytes
Contents
# # Composer - Mask Mode # # This example shows how to use the style property 'mask_mode' to achieve # certain effects like overlaying boxes on each other or using multiple # horizontal alignments on one line. # # Usage: # : `ruby composer_mask_mode.rb` # require 'hexapdf' HexaPDF::Composer.create('composer_mask_mode.pdf') do |composer| box = composer.image(File.join(__dir__, 'machupicchu.jpg'), border: {width: 1}, mask_mode: :none) composer.text('Text overlaid over image', height: box.height, text_align: :center, font_size: 50, text_valign: :center, text_rendering_mode: :fill_stroke, fill_color: 'white', stroke_color: 'hp-blue', margin: [0, 0, 10]) composer.column(columns: 1, style: {border: {width: 1}, padding: 10}) do |col| col.text('Center', mask_mode: :box, align: :center) col.text('Left', mask_mode: :fill_horizontal) col.text('Right', align: :right) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
hexapdf-1.2.0 | examples/028-composer_mask_mode.rb |
hexapdf-1.1.1 | examples/028-composer_mask_mode.rb |
hexapdf-1.1.0 | examples/028-composer_mask_mode.rb |