20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/libis/format/tool/fop_pdf.rb', line 20
def run(xml, target, options = [])
if OS.java?
end
timeout = Libis::Format::Config[:timeouts][:fop]
result = Libis::Tools::Command.run(
Libis::Format::Config[:java_cmd],
"-Dfop.home=#{File.dirname(Libis::Format::Config[:fop_jar])}",
'-jar', Libis::Format::Config[:fop_jar],
'-fo', xml,
'-pdf', target,
timeout: timeout,
kill_after: timeout * 2
)
raise RuntimeError, "#{self.class} took too long (> #{timeout} seconds) to complete" if result[:timeout]
raise RuntimeError, "#{self.class} errors: #{result[:err].join("\n")}" unless result[:status] == 0
end
|