Sha256: 015d98153270c80fceceec93389fd8075ea54e4552b8aa12034b446e03d4a744
Contents?: true
Size: 923 Bytes
Versions: 4
Compression:
Stored size: 923 Bytes
Contents
# frozen_string_literal: true require 'isodoc' module IsoDoc module Csa # A {Converter} implementation that generates CSA 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, "csa.standard.xsl")) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems