Skip to content

Commit

Permalink
patch(cmd options): add support for Prince's command line options
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim-entin committed Aug 11, 2024
1 parent 559f374 commit e98b011
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/princely/pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def initialize(options={})
:logger => nil,
:server_flag => true,
:media => nil,
:javascript_flag => false
:javascript_flag => false,
:cmd_options => []
}.merge(options)
@executable = options[:path] ? Princely::Executable.new(options[:path]) : options[:executable]
@style_sheets = ''
Expand All @@ -24,6 +25,7 @@ def initialize(options={})
@media = options[:media]
@javascript_flag = options[:javascript_flag]
@timeout = options[:timeout]
@cmd_options = cmd_options
end

# Returns the instance logger or Princely default logger
Expand Down Expand Up @@ -51,7 +53,7 @@ def exe_path
end

def executable_options
options = []
options = @cmd_options
options << "--input=html"
options << "--server" if @server_flag
options << "--log=#{log_file}"
Expand Down

0 comments on commit e98b011

Please sign in to comment.