Sha256: 5aa35c0a58051208cf4f499ea45b2915e4b7df499ddb88031df6cb35087d65ee

Contents?: true

Size: 967 Bytes

Versions: 1

Compression:

Stored size: 967 Bytes

Contents

require_relative "html_function/comments.rb"
require_relative "html_function/footnotes.rb"
require_relative "html_function/html.rb"

module IsoDoc
  class PdfConvert < ::IsoDoc::Convert

    include HtmlFunction::Comments
    include HtmlFunction::Footnotes
    include HtmlFunction::Html

    def initialize(options)
      super
      @tmpimagedir = "_pdfimages"
            @maxwidth = 500
      @maxheight = 800
    end

    def convert(filename, file = nil, debug = false)
      file = File.read(filename, encoding: "utf-8") if file.nil?
      @openmathdelim, @closemathdelim = extract_delims(file)
      docxml, outname_html, dir = convert_init(file, filename, debug)
      result = convert1(docxml, filename, dir)
      return result if debug
      postprocess(result, filename, dir)
      system "rm -fr #{dir}"
      Metanorma::Output::Pdf.new.convert(filename + ".html", filename)
      system "rm -r #{filename + '.html'} #{@tmpimagedir}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
isodoc-0.8.4 lib/isodoc/pdf_convert.rb