Skip to main content

Convert PPTX to PDF using LibreOffice headless mode with safe parallel conversion

Project description

fast-pptx-pdf

PyPI version Python versions License: MIT CI

Convert PPTX files to PDF using LibreOffice in headless mode, with safe parallel conversion via per-worker profiles.

  • Simple API: convert_file(path) and convert_folder(path, workers=8).
  • CLI: fast-pptx-pdf file.pptx or fast-pptx-pdf folder/ --workers 8.
  • No profile locking: Each worker uses its own LibreOffice profile in a temp directory.
  • Robust: Timeouts, optional retries, and clear errors.

Python cannot natively render PowerPoint files; this library uses the LibreOffice command-line interface. COM automation (Windows) is not thread-safe; LibreOffice headless runs one process per conversion and is suitable for parallelism when each process has a separate profile.

Requirements

  • Python 3.8+
  • LibreOffice installed and on PATH, or set FAST_PPTX_PDF_LIBREOFFICE to the path to soffice (or its program directory).

Installing LibreOffice

  • Windows: Download the installer, or use winget install TheDocumentFoundation.LibreOffice.
  • Linux: e.g. sudo apt install libreoffice (Debian/Ubuntu) or your distribution’s package.

Install

pip install fast-pptx-pdf

Usage

Python API

from fast_pptx_pdf import convert_file, convert_folder

# Single file (output PDF next to the PPTX by default)
pdf_path = convert_file("slides/presentation.pptx")
# Optional: output directory, timeout, retries
pdf_path = convert_file("deck.pptx", output_dir="pdfs/", timeout=60, retries=1)

# Folder: convert all .pptx in parallel (workers default: min(cpu_count, number of files))
successes, failures = convert_folder("slides/")
successes, failures = convert_folder("slides/", workers=8, continue_on_error=True)

CLI

# Single file
fast-pptx-pdf presentation.pptx

# Folder (default workers)
fast-pptx-pdf slides/

# Folder with 8 workers
fast-pptx-pdf slides/ --workers 8

# Optional: timeout, retries, LibreOffice path, continue on error
fast-pptx-pdf slides/ --workers 4 --timeout 60 --retries 1 --continue-on-error
fast-pptx-pdf file.pptx --libreoffice "C:\Program Files\LibreOffice\program\soffice.exe"

Configuration

  • LibreOffice path: Set the environment variable FAST_PPTX_PDF_LIBREOFFICE to the full path to soffice or to the LibreOffice program directory. The library also searches PATH and common install locations (e.g. Windows Program Files, Linux /usr/bin/soffice).
  • Workers: For convert_folder, if workers is not set, it uses min(cpu_count, number_of_pptx_files).

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_pptx_pdf-0.1.4.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_pptx_pdf-0.1.4-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file fast_pptx_pdf-0.1.4.tar.gz.

File metadata

  • Download URL: fast_pptx_pdf-0.1.4.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fast_pptx_pdf-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a36819ce3e24bd6666a755d243cb031b74c16ec17423e630945a5fda96210a9a
MD5 85a573284794005c3aece0240ba863e6
BLAKE2b-256 e35309922586f49681289bce7a5daed3cdbcbd83da7e751962396331e6ed5c08

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_pptx_pdf-0.1.4.tar.gz:

Publisher: ci.yml on jatizon/fast-pptx-pdf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fast_pptx_pdf-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: fast_pptx_pdf-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fast_pptx_pdf-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 89bee9daf023a7a9e2d3530f7fa50beea70b19bd130f0a9759f93303a5cf366b
MD5 2f41900fabcdea7046288eb9bc8a85ad
BLAKE2b-256 94a6bd20a3e0e8f00de6fa0859f7a4b94e4ad3833dc8f2521e4242d2f8a6f5f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_pptx_pdf-0.1.4-py3-none-any.whl:

Publisher: ci.yml on jatizon/fast-pptx-pdf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page