gpt4 book ai didi

ruby-on-rails - 如何在 ruby​​ 中设置 Prawn 的边距?

转载 作者:行者123 更新时间:2023-12-03 01:18:35 28 4
gpt4 key购买 nike

这是我到目前为止所拥有的,但我需要设置边距:

def send_fax 
contact = Contact.find_by_id(self.contact_id)

pdf = Prawn::Document.new
pdf.font "Times-Roman"
pdf.move_down(20)
pdf.text "ATTN: #{contact.first_name} #{contact.last_name}", :size => , :style => :bold
pdf.text "RE: #{self.subject}"
pdf.move_down(20)

pdf.text "#{self.body}"

OutboundMailer.deliver_fax_email(contact, self, pdf)

end

最佳答案

Prawn::Document.new( :margin => [0,0,0,0] )

:margin:    Sets the margin on all sides in points [0.5 inch]
:left_margin: Sets the left margin in points [0.5 inch]
:right_margin: Sets the right margin in points [0.5 inch]
:top_margin: Sets the top margin in points [0.5 inch]
:bottom_margin: Sets the bottom margin in points [0.5 inch]

http://rdoc.info/github/sandal/prawn/master/Prawn/Document

关于ruby-on-rails - 如何在 ruby​​ 中设置 Prawn 的边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4600153/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com