WolfPPT - headless Docker conversion
How do I fix LibreOffice crashing during PPTX-to-PDF conversion in headless Docker?
If LibreOffice crashes when converting PPTX to PDF in a headless Docker container, first distinguish an office-process failure from a container out-of-memory kill. Give LibreOffice a writable, isolated user profile and check Docker's memory constraints before changing conversion flags. If you want to remove LibreOffice from the conversion path instead, WolfPPT Commercial renders PPTX directly, with its own layout and stated limits.
Check documented failure conditions first
- Check profile permissions. LibreOffice's startup-parameter documentation explicitly requires write access to the user profile directory. Check the effective user inside the container, not just the host directory owner. A read-only home or an unwritable mounted profile violates that requirement.
- Isolate concurrent workers. The Document Foundation's profile documentation says a profile must only be accessed by one LibreOffice process. Use a unique writable directory for each worker, selected with
-env:UserInstallation=file:///tmp/job-profile, using a different directory per job. Do not mount one shared profile for all conversions. - Check whether Docker killed the process. Docker's resource-constraints guide explains out-of-memory killing and hard memory limits. Inspect the container state and logs. If an OOM kill is recorded, adjust memory allocation or concurrency for the workload rather than assuming the PPTX parser crashed. Do not disable OOM protection as a generic fix.
These are documented operating conditions, not a diagnosis of every crash. Capture the LibreOffice version, input deck, stderr, process exit, and container state. Reproduce with one conversion and a fresh writable profile. If only one deck still fails, retain that file as a reproducer rather than repeatedly retrying it and losing the evidence. The documentation does not establish missing fonts or shared memory as the cause of an arbitrary PPTX conversion crash.
Replace the LibreOffice process when that is the goal
WolfPPT Commercial provides wolfppt-harness render-native. It uses WolfPPT's own layout engine, not a subprocess wrapper around LibreOffice, PowerPoint, or a browser. Install the licensed wolfppt-pro add-on and its matching Community package through the authenticated index supplied with your order. Public pip install wolfppt alone does not provide this rendering workflow.
Put pitch.pptx and the deck's font files in the container. The following Python example assumes Calibri regular and bold; change the paths and admit other styles or families as required. The output directory must not already exist, and the command must be on PATH.
import subprocess
from pathlib import Path
# Requires the licensed wolfppt-pro add-on in the container.
# Supply every font family/style used by the source deck.
subprocess.run(
["wolfppt-harness", "render-native",
"--source", "pitch.pptx",
"--output-dir", "pdf-output",
"--format", "pdf",
"--font", "Calibri=/opt/fonts/Calibri.ttf",
"--font", "Calibri:bold=/opt/fonts/Calibrib.ttf"],
check=True,
)
print(Path("pdf-output/deck.pdf"))
print(Path("pdf-output/render-receipt.json"))The result is pdf-output/deck.pdf, plus a receipt binding the source, fonts, options, and output digests. PDF text uses the admitted font files. The renderer stages the outputs and publishes the directory together, refusing an existing destination instead of overwriting it. Handle the nonzero exit from check=True rather than treating every attempted conversion as a delivered PDF.
What it does not do
- It does not fix LibreOffice internally. Replacing its conversion path is a separate decision.
- It does not promise LibreOffice or PowerPoint visual equivalence. Compare representative decks before switching.
- It does not render every PPTX feature. Unsupported visible content can cause an explicit refusal.
- It does not eliminate container memory limits or remove the need to bound concurrent work.
- PDF is not a DPI-sized image. For PNG previews, choose
--format pngand set--dpiinstead.
See PPTX-to-PDF workflows for the separately licensed Wolf Runtime option, or prepare the deck with text updates and chart data updates.
Get WolfPPT Commercial
WolfPPT Commercial is an organization-scoped subscription at $500 per year or $50 per month for one legal organization, not per developer. The public MIT Community package is on public PyPI. WolfPPT Commercial installs the wolfppt-pro add-on from the authenticated WolfPPT package index with a per-purchase credential, issued on the checkout success page after payment and reissued through https://wolfxl.com/recover.
pip install wolfppt-pro --index-url https://packages.wolfxl.com/wolfppt/simple/The public WolfPPT Community release is MIT-licensed and free, including commercial use. WolfPPT Commercial does not change those rights.
Related tasks
- Update text in an existing PowerPoint deck with Python
- Update a table in an existing PowerPoint deck with Python
- Update chart data in an existing PowerPoint deck with Python
- Convert PPTX to PDF in Python without PowerPoint or LibreOffice: Wolf Runtime workflow (commercial or evaluation, not in the pip package)
- python-pptx limitations, and an alternative for editing existing PowerPoint decks
- Copy slides from one PowerPoint deck to another in Python without losing theme fonts
- Which Python library supports programmatic pitch deck generation with native charts and shapes?
- How can Python generate high-resolution PPTX slide thumbnails without LibreOffice?
- How do I fix python-pptx placeholder KeyError when editing slide master layouts?
- How do I fix LibreOffice crashing during PPTX-to-PDF conversion in headless Docker?