Sha256: ae3e301e5f0266a4e45b7209cbbd933de54af6b255b92486e8c0ab0d0e189108
Contents?: true
Size: 720 Bytes
Versions: 35
Compression:
Stored size: 720 Bytes
Contents
# frozen_string_literal: true # # Render a Letter to PDF. Try and get it from the cachefirst # Lean on Letters::HTMLRenderer which already renders the letter to html via # LetterPresenter#content. # module Renalware module Letters class PdfRenderer OPTIONS = { page_size: "A4", footer: { font_size: 8, right: "Page [page] of [topage]" }, encoding: "UTF-8" }.freeze def self.call(letter) unless letter.respond_to?(:to_html) letter = LetterPresenterFactory.new(letter) end PdfLetterCache.fetch(letter) do WickedPdf.new.pdf_from_string(letter.to_html, OPTIONS) end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems