Module: Pdfrb::CLI::Uwatermark

Defined in:
lib/pdfrb/cli/watermark.rb

Class Method Summary collapse

Class Method Details

.call(path, **opts) {|doc| ... } ⇒ Object

Yields:

  • (doc)


8
9
10
11
12
13
14
15
# File 'lib/pdfrb/cli/watermark.rb', line 8

def call(path, **opts)
  doc = Pdfrb::Document.open(path)
  yield doc if block_given?
  output = opts[:output] || path
  doc.write(output)
  puts "Processed: #{output}"
  true
end