diff --git a/helpers/docx2pdf.py b/helpers/docx2pdf.py index 1b6ca31..2276600 100644 --- a/helpers/docx2pdf.py +++ b/helpers/docx2pdf.py @@ -2,11 +2,11 @@ class Converter(): def docx2pdf(file_name): - docx_file = "./results/" + file_name + ".docx" + docx_file = "./results/%d.csv" % file_name os.system('soffice --headless --norestore --writer --convert-to pdf ./%s --outdir %s' % (docx_file, "./reports")) os.remove(docx_file) - return "./reports/" + file_name + ".pdf" + return "./reports/%s.pdf" % docx_file def docx2preview(file_name): os.system('soffice --headless --norestore --writer --convert-to pdf %s --outdir %s' % (file_name, "./templates")) diff --git a/helpers/render.py b/helpers/render.py index 8e9bf29..6575273 100644 --- a/helpers/render.py +++ b/helpers/render.py @@ -7,4 +7,4 @@ def render(body, filename): item["idx"] = idx body.Data[idx] = item template.render(body) - template.save("./results/%s.docx" % filename) + template.save("./results/%d.docx" % filename)