module HtmlFromPdf

Constants

VERSION

Public Class Methods

convert(pdf_path, html_path = nil, options: {}) click to toggle source
# File lib/html_from_pdf.rb, line 12
def self.convert(pdf_path, html_path = nil, options: {})
  convert_pdf_to_html(pdf_path, html_path, options)
rescue
end
convert!(pdf_path, html_path = nil, options: {}) click to toggle source
# File lib/html_from_pdf.rb, line 17
def self.convert!(pdf_path, html_path = nil, options: {})
  convert_pdf_to_html(pdf_path, html_path, options)
end

Private Class Methods

convert_pdf_to_html(pdf_path, html_path, options) click to toggle source
# File lib/html_from_pdf.rb, line 24
def convert_pdf_to_html(pdf_path, html_path, options)
  pdf_path = HtmlFromPdf::Downloader.download(pdf_path) || pdf_path
  raise HtmlFromPdf::PdfNotFound unless File.exist? pdf_path

  converter = HtmlFromPdf::Converter.new(pdf_path, html_path, options)
  converter.convert
end