Ask A Question

Notifications

You’re not receiving notifications from this thread.

Align Images with Text

rikidev asked in Ruby

Hi I'm doing a report with ruby ​​prawn, the code below shows two images on video, the fact is that the two images are not aligned, so the image c is displayed much lower, my question is how do I align the two images at the same height?

Image of report: [https://imgur.com/a/dBtLKIG]

Code:

#Images
c=Dir.pwd+"/c.jpg"

#Report
Prawn::Document.generate("rapportino.pdf") do
float { text "Il Tecnico:", :align => :left}
  text "Il Cliente:", :align => :right
  move_down 8
  image c,  :width=>130, :height=>70, :position => :left
  image c,  :width=>130, :height=>70,:position => :right
end
Reply

have you tried using prawn tables ?

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 73,723+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.