Skip to content

Commit

Permalink
fix fallback PDF output filename, to ensure it is in same directory a…
Browse files Browse the repository at this point in the history
…s input XML filename: metanorma/metanorma-ogc#522
  • Loading branch information
opoudjis committed Apr 8, 2023
1 parent fef7ad0 commit 6619b9e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/isodoc/xslfo_convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ def pdf_options(_docxml)
ret.merge(@pdf_cmd_options)
end

# input_file: keep-alive tempfile
def convert(input_filename, file = nil, debug = false,
output_filename = nil)
file = File.read(input_filename, encoding: "utf-8") if file.nil?
input_file, docxml, filename = input_xml_path(input_filename,
file, debug)
input_file, docxml, filename =
input_xml_path(input_filename, file, debug)
::Metanorma::Output::XslfoPdf.new.convert(
filename,
output_filename || "#{filename}.#{@suffix}",
output_filename || File.join(File.dirname(input_filename),
"#{filename}.#{@suffix}"),
File.join(@libdir, pdf_stylesheet(docxml)),
pdf_options(docxml),
)
Expand Down

0 comments on commit 6619b9e

Please sign in to comment.