Sha256: ad5c67ec167f52bc72aa1c630b0be9fc6b273f2e0f9325a6545295bd78060227
Contents?: true
Size: 470 Bytes
Versions: 9
Compression:
Stored size: 470 Bytes
Contents
module RailsConnector module Fop # # Is raised if the PDF generation fails. # The error message contains the Java error stack trace of the Apache FOP. # class GenerationFailed < RuntimeError; end CMD = 'fop -xml "%s" -xsl "%s" -pdf "%s" 2>&1' def self.generate_pdf(xml, xsl, pdf) output = `#{CMD % [xml, xsl, pdf]}` unless `file -pb "#{pdf}"`.include?('PDF') raise GenerationFailed, output end end end end
Version data entries
9 entries across 9 versions & 1 rubygems