Convert PPTX to PDF using LibreOffice headless mode with safe parallel conversion
Project description
fast-pptx-pdf
Convert PPTX files to PDF using LibreOffice in headless mode, with safe parallel conversion via per-worker profiles.
- Simple API:
convert_file(path)andconvert_folder(path, workers=8). - CLI:
fast-pptx-pdf file.pptxorfast-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 setFAST_PPTX_PDF_LIBREOFFICEto the path tosoffice(or itsprogramdirectory).
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_LIBREOFFICEto the full path tosofficeor to the LibreOfficeprogramdirectory. The library also searchesPATHand common install locations (e.g. WindowsProgram Files, Linux/usr/bin/soffice). - Workers: For
convert_folder, ifworkersis not set, it usesmin(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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_pptx_pdf-0.1.3.tar.gz.
File metadata
- Download URL: fast_pptx_pdf-0.1.3.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45bab7ae70c76f36651450c0d5975fbb661e2f83407d5f7600fd885596623130
|
|
| MD5 |
75fd86822b15b543e99a5fd3f39b74f2
|
|
| BLAKE2b-256 |
1f8b54e236e29ec2cd1cbcd3c7a5611e31dfeb28aaaefd596d2c5060e98ae5fc
|
Provenance
The following attestation bundles were made for fast_pptx_pdf-0.1.3.tar.gz:
Publisher:
ci.yml on jatizon/fast-pptx-pdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fast_pptx_pdf-0.1.3.tar.gz -
Subject digest:
45bab7ae70c76f36651450c0d5975fbb661e2f83407d5f7600fd885596623130 - Sigstore transparency entry: 1109290359
- Sigstore integration time:
-
Permalink:
jatizon/fast-pptx-pdf@889fda9f3ecd2b840b930fd202370018dd54a9ef -
Branch / Tag:
refs/heads/master - Owner: https://github.com/jatizon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@889fda9f3ecd2b840b930fd202370018dd54a9ef -
Trigger Event:
push
-
Statement type:
File details
Details for the file fast_pptx_pdf-0.1.3-py3-none-any.whl.
File metadata
- Download URL: fast_pptx_pdf-0.1.3-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c1a68a9856680e45e9d95f2a4f68f24121cf7b6bf5ada6c38edc5394c334bef
|
|
| MD5 |
2f9b8824d3d2a281d3b0b2bab1c730f8
|
|
| BLAKE2b-256 |
aae56baeaff978c8a4857761cea469050b57912b7497ac78df3bb4b79dc9836a
|
Provenance
The following attestation bundles were made for fast_pptx_pdf-0.1.3-py3-none-any.whl:
Publisher:
ci.yml on jatizon/fast-pptx-pdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fast_pptx_pdf-0.1.3-py3-none-any.whl -
Subject digest:
7c1a68a9856680e45e9d95f2a4f68f24121cf7b6bf5ada6c38edc5394c334bef - Sigstore transparency entry: 1109290363
- Sigstore integration time:
-
Permalink:
jatizon/fast-pptx-pdf@889fda9f3ecd2b840b930fd202370018dd54a9ef -
Branch / Tag:
refs/heads/master - Owner: https://github.com/jatizon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@889fda9f3ecd2b840b930fd202370018dd54a9ef -
Trigger Event:
push
-
Statement type: