Sha256: a5ac44ad79cf20696fc35833b084624e80b82eeba3289f9e342d5f885b725d31

Contents?: true

Size: 758 Bytes

Versions: 9

Compression:

Stored size: 758 Bytes

Contents

require "metanorma"

module IsoDoc
  class XslfoPdfConvert < ::IsoDoc::Convert

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

    def tmpimagedir_suffix
      "_pdfimages"
    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)
      FileUtils.rm_rf dir
      ::Metanorma::Output::XslfoPdf.new.convert(filename, outname_html + ".pdf", nil)
    end

    def xref_parse(node, out)
      target = /#/.match(node["target"]) ? node["target"].sub(/#/, ".pdf#") :
        "##{node["target"]}"
      out.a(**{ "href": target }) { |l| l << get_linkend(node) }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
isodoc-1.0.25 lib/isodoc/xslfo_convert.rb
isodoc-1.0.24 lib/isodoc/xslfo_convert.rb
isodoc-1.0.23 lib/isodoc/xslfo_convert.rb
isodoc-1.0.22 lib/isodoc/xslfo_convert.rb
isodoc-1.0.21 lib/isodoc/xslfo_convert.rb
isodoc-1.0.20 lib/isodoc/xslfo_convert.rb
isodoc-1.0.19 lib/isodoc/xslfo_convert.rb
isodoc-1.0.18 lib/isodoc/xslfo_convert.rb
isodoc-1.0.17 lib/isodoc/xslfo_convert.rb