Sha256: 8cb7733d3150d902587b64291e6ab6bcc8598a1cbc259b34061d5bed612abd0b
Contents?: true
Size: 1.31 KB
Versions: 24
Compression:
Stored size: 1.31 KB
Contents
require_relative "html_function/comments" require_relative "html_function/footnotes" require_relative "html_function/html" require "metanorma" module IsoDoc class PdfConvert < ::IsoDoc::Convert include HtmlFunction::Comments include HtmlFunction::Footnotes include HtmlFunction::Html def initialize(options) @standardstylesheet = nil super @format = :pdf @suffix = "pdf" @scripts = @scripts_pdf if @scripts_pdf @maxwidth = 500 @maxheight = 800 end def tmpimagedir_suffix "_pdfimages" end def convert(input_filename, file = nil, debug = false, output_filename = nil) file = File.read(input_filename, encoding: "utf-8") if file.nil? @openmathdelim, @closemathdelim = extract_delims(file) docxml, filename, dir = convert_init(file, input_filename, debug) result = convert1(docxml, filename, dir) return result if debug postprocess(result, "#{filename}.tmp.html", dir) FileUtils.rm_rf dir ::Metanorma::Output::Pdf.new.convert( "#{filename}.tmp.html", output_filename || "#{filename}.#{@suffix}", ) FileUtils.rm_rf ["#{filename}.tmp.html", tmpimagedir] end def xref_parse(node, out) out.a(**{ "href": target_pdf(node) }) { |l| l << get_linkend(node) } end end end
Version data entries
24 entries across 24 versions & 1 rubygems