Module: Dorsale::Alexandrie::Prawn

Included in:
BillingMachine::InvoiceSingleVatPdf
Defined in:
lib/dorsale/alexandrie/prawn.rb

Instance Method Summary collapse

Instance Method Details

#render_with_attachmentsObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/dorsale/alexandrie/prawn.rb', line 4

def render_with_attachments
  final_pdf = ::CombinePDF.parse(self.render)

  @main_document.attachments.each do |attachment|
    next unless File.extname(attachment.file.path) == ".pdf"

    final_pdf << ::CombinePDF.load(attachment.file.path)
  end

  final_pdf.to_pdf
end