Sha256: 3935dbbcfd5bc7cd5a4008cfaee8fec8fad02d11d0cc527cdf0e27ee9e926f6b
Contents?: true
Size: 1.3 KB
Versions: 17
Compression:
Stored size: 1.3 KB
Contents
module Lipsiadmin module View module Helpers # This helper is necessary for when we generate some PDF # remember that basically pdf are standard html pages # and we use PD4ML for convert it in PDF. # # So for example is necessary have an header for all pdf page # and a footer. # # Here you can find helpers for do that. # module PdfHelper # Return the pd4ml header tag block def pdf_header(&block) html = <<-HTML <pd4ml:page.header> <div style="padding:0px 0px 100px 0px"> #{capture(&block)} </div> </pd4ml:page.header> HTML concat(html) end # Return the pd4ml footer tag block def pdf_footer(&block) html = <<-HTML <pd4ml:page.footer> #{capture(&block) if block_given?} <div style="text-align:right;padding-top:10px">#{I18n.t("backend.general.page")} $[page] #{I18n.t("backend.general.of")} $[total]</div> </pd4ml:page.footer> HTML block_given? ? concat(html) : html end # Return the pd4ml page break tag def pdf_page_break "<pd4ml:page.break>" end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems