From e9099419a51b14820eabf5972a522b97936ef906 Mon Sep 17 00:00:00 2001 From: callumhyoung Date: Wed, 10 Sep 2025 14:15:29 -0700 Subject: [PATCH] add code --- report_generator.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 report_generator.py diff --git a/report_generator.py b/report_generator.py new file mode 100644 index 0000000..dd60d6a --- /dev/null +++ b/report_generator.py @@ -0,0 +1,18 @@ +import subprocess + +def generate_report(report_title, content_file): + """Generates a PDF report with a user-supplied title.""" + + + command = f"pandoc {content_file} -o report.pdf --metadata title='{report_title}'" + + + result = subprocess.run(command, shell=True, capture_output=True, text=True) + + if result.returncode == 0: + print("Report generated successfully.") + else: + print("Error:", result.stderr) + +user_title = input("Enter report title: ") +generate_report(user_title, "report_data.md") \ No newline at end of file