class DragonflyPdf::Processors::Stamp

Public Instance Methods

call(content, stamp_pdf, _options = {}) click to toggle source
# File lib/dragonfly_pdf/processors/stamp.rb, line 4
def call(content, stamp_pdf, _options = {})
  raise UnsupportedFormat unless content.ext
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)

  content.shell_update(ext: 'pdf') do |old_path, new_path|
    "#{pdftk_command} \"#{old_path}\" stamp \"#{stamp_pdf.path}\" output \"#{new_path}\""
  end
end

Private Instance Methods

pdftk_command() click to toggle source
# File lib/dragonfly_pdf/processors/stamp.rb, line 15
def pdftk_command
  'pdftk'
end