diff --git a/Dockerfile.allinone b/Dockerfile.allinone index 7f9f18806..46d670961 100644 --- a/Dockerfile.allinone +++ b/Dockerfile.allinone @@ -121,6 +121,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libgbm1 \ libcairo2 \ libpango-1.0-0 \ + # ============================ + # Report export (Pandoc + WeasyPrint runtime libs) + # ============================ + pandoc \ + libpangoft2-1.0-0 \ + libharfbuzz0b \ + libharfbuzz-subset0 \ && rm -rf /var/lib/apt/lists/* # Install Node.js 20.x (for running frontend) diff --git a/surfsense_backend/Dockerfile b/surfsense_backend/Dockerfile index 446479ece..e33a962f8 100644 --- a/surfsense_backend/Dockerfile +++ b/surfsense_backend/Dockerfile @@ -20,6 +20,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libxrender1 \ dos2unix \ git \ + pandoc \ + libpango-1.0-0 \ + libpangoft2-1.0-0 \ + libharfbuzz-subset0 \ && rm -rf /var/lib/apt/lists/* # Update certificates and install SSL tools diff --git a/surfsense_backend/app/routes/reports_routes.py b/surfsense_backend/app/routes/reports_routes.py index b4ee0e889..25764d88d 100644 --- a/surfsense_backend/app/routes/reports_routes.py +++ b/surfsense_backend/app/routes/reports_routes.py @@ -180,7 +180,7 @@ async def export_report( # thread executor to avoid blocking the async event loop. extra_args = ["--standalone"] if format == ExportFormat.PDF: - extra_args.append("--pdf-engine=wkhtmltopdf") + extra_args.append("--pdf-engine=weasyprint") loop = asyncio.get_running_loop() output = await loop.run_in_executor( diff --git a/surfsense_backend/pyproject.toml b/surfsense_backend/pyproject.toml index 2abc07b5e..38da661b3 100644 --- a/surfsense_backend/pyproject.toml +++ b/surfsense_backend/pyproject.toml @@ -64,6 +64,7 @@ dependencies = [ "langchain-unstructured>=1.0.1", "slowapi>=0.1.9", "pypandoc>=1.16.2", + "weasyprint>=68.1", ] [dependency-groups]