Skip to main content

Align Images with Text

Ruby • Asked by rikidev

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

have you tried using prawn tables ?


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.