Sha256: c199611c35869ab76d00f53d053027531d03cc89c3a9a0b858e77010008912a4
Contents?: true
Size: 941 Bytes
Versions: 19
Compression:
Stored size: 941 Bytes
Contents
# # Frame - 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 frame_mask_mode.rb` # require 'hexapdf' HexaPDF::Composer.create('frame_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
19 entries across 19 versions & 1 rubygems