Sha256: 5b060ebc1eb00c2e3188d3581f15875961b549bd2d3031c848c2f46e8f22dc72
Contents?: true
Size: 944 Bytes
Versions: 5
Compression:
Stored size: 944 Bytes
Contents
require_relative "base_convert" require "isodoc" module IsoDoc module Iec # A {Converter} implementation that generates HTML output, and a document # schema encapsulation of the document for validation # class PdfConvert < IsoDoc::XslfoPdfConvert def initialize(options) @libdir = File.dirname(__FILE__) super end def convert(filename, file = nil, debug = false) file = File.read(filename, encoding: "utf-8") if file.nil? docxml, outname_html, dir = convert_init(file, filename, debug) /\.xml$/.match(filename) or filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f| f.write file f.path end FileUtils.rm_rf dir ::Metanorma::Output::XslfoPdf.new.convert( filename, outname_html + ".pdf", File.join(@libdir, "iec.international-standard.xsl")) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems