Class: DragonflyPdf::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/dragonfly_pdf/plugin.rb

Instance Method Summary collapse

Instance Method Details

#call(app, _opts = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/dragonfly_pdf/plugin.rb', line 14

def call(app, _opts = {})
  app.add_analyser :pdf_properties, Analysers::PdfProperties.new

  %w[ page_count
      page_numbers
      page_dimensions
      page_rotations
      aspect_ratios
  ].each do |name|
    app.add_analyser(name) { |c| c.analyse(:pdf_properties)[name] }
  end

  app.add_processor :append, Processors::Append.new
  app.add_processor :convert, Processors::Convert.new
  app.add_processor :page, Processors::Page.new
  app.add_processor :remove_password, Processors::RemovePassword.new
  app.add_processor :rotate, Processors::Rotate.new
  app.add_processor :stamp, Processors::Stamp.new
  app.add_processor :subset_fonts, Processors::SubsetFonts.new
  app.add_processor :page_thumb, Processors::PageThumb.new

  app.define(:encode) { convert }
end