Skip to content

Commit

Permalink
use only basename for tempname of PDF: metanorma/metanorma-ogc#522
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Apr 6, 2023
1 parent 341133f commit 6af80c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/isodoc/xslfo_convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def pdf_options(_docxml)
def convert(input_filename, file = nil, debug = false,
output_filename = nil)
file = File.read(input_filename, encoding: "utf-8") if file.nil?
input_filename, docxml, filename = input_xml_path(input_filename,
input_file, docxml, filename = input_xml_path(input_filename,
file, debug)
::Metanorma::Output::XslfoPdf.new.convert(
input_filename,
filename,
output_filename || "#{filename}.#{@suffix}",
File.join(@libdir, pdf_stylesheet(docxml)),
pdf_options(docxml),
Expand All @@ -73,11 +73,11 @@ def input_xml_path(input_filename, xml_file, debug)
input_filename = Tempfile.open([File.basename(filename), ".xml"],
encoding: "utf-8") do |f|
f.write xml_file
f.path
f
end
FileUtils.rm_rf dir

[input_filename, docxml, filename]
[input_filename, docxml, input_filename.path]
end
end
end

0 comments on commit 6af80c4

Please sign in to comment.