Sha256: 09f93a6e49f2608ad991814f7ab8246fdcbb6d61a0a7eb7697423c8502b1b3eb

Contents?: true

Size: 535 Bytes

Versions: 3

Compression:

Stored size: 535 Bytes

Contents

module Metanorma
  module Output
    class Pdf < Base

      def convert(url_path, output_path)
        file_url = "file://#{Dir.pwd}/#{url_path}"
        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}"
        #Phantomjs.path
        #pdfjs = File.join(File.dirname(__FILE__), "../../../bin/rasterize.js")
        #Phantomjs.run(pdfjs, file_url, output_path, "A4")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metanorma-0.3.5 lib/metanorma/output/pdf.rb
metanorma-0.3.4 lib/metanorma/output/pdf.rb
metanorma-0.3.3 lib/metanorma/output/pdf.rb