Sha256: 2261c646e587d2a896021936719c250098d257fb500287216ba579cb5420728c

Contents?: true

Size: 502 Bytes

Versions: 1

Compression:

Stored size: 502 Bytes

Contents

module Metanorma
  module Output
    class Pdf < Base

      def convert(url_path, output_path)
        file_url = url_path
        file_url = "file://#{url_path}" if %r{^/}.match file_url
        file_url = "file://#{Dir.pwd}/#{url_path}" unless %r{^file://}.match file_url
        pdfjs = File.join(File.dirname(__FILE__), '../../../bin/metanorma-pdf.js')
        ENV['NODE_PATH'] ||= `npm root --quiet -g`.strip
        system "node #{pdfjs} #{file_url} #{output_path}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
metanorma-0.3.12 lib/metanorma/output/pdf.rb