Method: Pdf2htmlex#convert

Defined in:
lib/pdf2htmlex.rb

#convert(input_pdf, html_filename = nil, **options) ⇒ Pathname

Convert input PDF file to HTML

Parameters:

  • input_pdf (String, Pathname)

    The path of PDF file

  • html_filename (String, Pathname, NilClass) (defaults to: nil)

    The output HTML filename

  • options (Hash)

    List of pdf2htmlex options

  • [Integer] (Hash)

    a customizable set of options

  • [Float] (Hash)

    a customizable set of options

  • [Boolean, (Hash)

    a customizable set of options

  • [String] (Hash)

    a customizable set of options

Returns:

  • (Pathname)

    The generated HTML file

Raises:

  • (Pdf2htmlex::Error)

    catch errors from pdf2htmlEX into Pdf2htmlex::Error exception



89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/pdf2htmlex.rb', line 89

def convert(input_pdf, html_filename = nil, **options)
  options[:dest_dir] ||= make_tempdir

  output = output_html(options[:dest_dir], html_filename || input_pdf)
  command = normalize_options(options)
  command << input_pdf
  command << output.basename.to_s

  run_command(command)

  output
end