0
我使用pdfkit從紅寶石中的html生成pdf。我能夠生成pdf,但pdf上的呈現文本具有不均勻間隔的一些字符,儘管html呈現是完美的。PDKKit html rendering
def self.generate_invoice
content = File.read("#{Rails.root}/engines/restaurant_service/app/views/restaurant_service/settlement_mailer/settlement_invoice.html.erb")
template = ERB.new(content)
set_margin = 0.1.to_s
kit = PDFKit.new(template.result(binding), :page_size => 'Letter',:margin_top => set_margin+'in', :margin_right => set_margin+'in', :margin_bottom => set_margin+'in', :margin_left => set_margin+'in')
kit.to_file(file_path)
end
@zooney工作嗎? –