diff --git a/scripts/generate_report.py b/scripts/generate_report.py index da7a647..7b900fc 100755 --- a/scripts/generate_report.py +++ b/scripts/generate_report.py @@ -4,7 +4,6 @@ from pathlib import Path from tempfile import NamedTemporaryFile as NTF from typing import Optional -import pdfkit from jinja2 import Environment, FileSystemLoader @@ -57,8 +56,6 @@ def __init__(self, summaryd: dict, "header-spacing": "5", "footer-spacing": "4", - "enable-local-file-access": True, - "load-error-handling": "ignore", } if header_line: pdfkit_opts["header-line"] = "" @@ -190,6 +187,7 @@ def write(self, html, pdf) -> None: fout.write(cov_txt) fout.write(con_txt) if pdf: + import pdfkit pdfkit.from_string(con_txt, pdf, options=self.pdfkit_opts, css=self.css_fname, toc=toc, cover=cov_fh.name, cover_first=True)