blob: 1b52681aa4de5936856464f87505d2c9eaf7d832 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# kj-slidepacker
> to be used with exports from [sent-web](https://sent-web.site), LaTeX Beamer, or any other source of PDF presentations.
converts a `.pdf` presentation into a "fake" `.pptx` by rendering each page as an image and pasting it onto a blank slide.
output slides are **not editable**, this is intentional.
the goal is just to get a pdf into pptx format for corporate compliance purposes (e.g., when someone absolutely **NEEDS** a `.pptx` and would go crazy if the file is not sent with an extension that says **• P P T X**).
https://github.com/user-attachments/assets/649b6259-9c86-49fd-bba5-4431f051e82a
## deps
- python 3.13+ (probably works on older versions but not tested)
- [pymupdf](https://pypi.org/project/pymupdf/)
- [python-pptx](https://pypi.org/project/python-pptx/)
## install
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## usage
```sh
# output defaults to the same stem as the input
./src/slidepacker deck.pdf
# specify output path
./src/slidepacker deck.pdf out.pptx
# set render resolution (default: 150 dpi)
./src/slidepacker deck.pdf --dpi 200
```
## as a libr
```python
import sys
sys.path.insert(0, "path/to/kj-slidepacker/src")
import slidepacker
slidepacker.pack("deck.pdf", "deck.pptx", dpi=200)
```
## license
0BSD - see [LICENSE](LICENSE)
|