Class: PdfOutlineEditor::Commands::LoadCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf_outline_editor/commands/load_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ LoadCommand

Returns a new instance of LoadCommand.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/pdf_outline_editor/commands/load_command.rb', line 8

def initialize(argv)
  @parser = nil

  @input_pdf_path = nil
  @outlines = nil
  @output_pdf_path = nil

  parser.parse!(argv)

  handle_args(argv)
end

Instance Method Details

#runObject



20
21
22
23
24
25
# File 'lib/pdf_outline_editor/commands/load_command.rb', line 20

def run
  Loader.open(@input_pdf_path) do |loader|
    loader.load(@outlines)
    loader.save(@output_pdf_path)
  end
end