python-pptx2 3.1.0__py3-none-any.whl → 3.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pptx2/__init__.py +1 -1
- pptx2/render.py +17 -1
- {python_pptx2-3.1.0.dist-info → python_pptx2-3.1.1.dist-info}/METADATA +1 -1
- {python_pptx2-3.1.0.dist-info → python_pptx2-3.1.1.dist-info}/RECORD +8 -8
- {python_pptx2-3.1.0.dist-info → python_pptx2-3.1.1.dist-info}/WHEEL +0 -0
- {python_pptx2-3.1.0.dist-info → python_pptx2-3.1.1.dist-info}/entry_points.txt +0 -0
- {python_pptx2-3.1.0.dist-info → python_pptx2-3.1.1.dist-info}/licenses/LICENSE +0 -0
- {python_pptx2-3.1.0.dist-info → python_pptx2-3.1.1.dist-info}/top_level.txt +0 -0
pptx2/__init__.py
CHANGED
pptx2/render.py
CHANGED
|
@@ -324,6 +324,17 @@ def _render_via_pdf(
|
|
|
324
324
|
pass
|
|
325
325
|
|
|
326
326
|
|
|
327
|
+
def _pdf_splitter_available() -> bool:
|
|
328
|
+
"""True when the PDF→PNG step can run (Poppler's pdftoppm or pypdfium2)."""
|
|
329
|
+
if shutil.which("pdftoppm") is not None:
|
|
330
|
+
return True
|
|
331
|
+
try:
|
|
332
|
+
import pypdfium2 # type: ignore[import-not-found] # noqa: F401
|
|
333
|
+
except ImportError:
|
|
334
|
+
return False
|
|
335
|
+
return True
|
|
336
|
+
|
|
337
|
+
|
|
327
338
|
def _pdf_to_pngs(pdf_path: Path, out_dir: Path, *, dpi: int) -> List[Path]:
|
|
328
339
|
"""Split a PDF into one PNG per page in *out_dir* and return the paths.
|
|
329
340
|
|
|
@@ -615,13 +626,18 @@ def render_contact_sheet(
|
|
|
615
626
|
|
|
616
627
|
work_dir = Path(tempfile.mkdtemp(prefix="pptx-sheet-"))
|
|
617
628
|
try:
|
|
629
|
+
# Stock LibreOffice 7+ writes only the first slide through the PNG
|
|
630
|
+
# filter, so for a multi-slide deck "auto" pays for a wasted soffice
|
|
631
|
+
# start before falling back to PDF. Go straight to PDF whenever a
|
|
632
|
+
# page splitter is available; "auto" remains the portable fallback.
|
|
633
|
+
strategy = "pdf" if _pdf_splitter_available() else "auto"
|
|
618
634
|
paths = render_slide_thumbnails(
|
|
619
635
|
prs,
|
|
620
636
|
out_dir=work_dir,
|
|
621
637
|
slide_indexes=slides,
|
|
622
638
|
soffice_bin=soffice_bin,
|
|
623
639
|
timeout=timeout,
|
|
624
|
-
strategy=
|
|
640
|
+
strategy=strategy,
|
|
625
641
|
dpi=dpi,
|
|
626
642
|
)
|
|
627
643
|
if not paths:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
paper_pptx_doctor/__init__.py,sha256=9TkaU83C5uRjJ7Lus7i712MXlKTtLRzdCPbiGm4liSM,4608
|
|
2
2
|
paper_pptx_doctor/__main__.py,sha256=dGjuKS3nWA92DWSVUYzYaL-eB6FySHmZG-mEiFs3l6M,116
|
|
3
|
-
pptx2/__init__.py,sha256=
|
|
3
|
+
pptx2/__init__.py,sha256=yhOeDWJ60JwZDrkK3pKHrigMPUKrJuL_85uR9TYditM,4484
|
|
4
4
|
pptx2/_agent_friendly.py,sha256=wYh9LmVuZMVlwOxzyd1mw0NmtPKQ2cTC21Y1Ww8ehO8,8834
|
|
5
5
|
pptx2/_color.py,sha256=u7L9h98k05RaPX3ufJKA-BXqVl-LHc3SXHqPJPT7WpM,3033
|
|
6
6
|
pptx2/_ownership.py,sha256=hN1_aC9dW7KPvwyGyG_k_DZKJBAdEjKboPoc9kKypEM,2694
|
|
@@ -34,7 +34,7 @@ pptx2/package.py,sha256=6aleVhIaycPHvTovyWJAhPE2qZ-PympVwf2Ei1XFGTE,35830
|
|
|
34
34
|
pptx2/presentation.py,sha256=DaSfFF7_0KefJmi8GhG3cJNE3nBX5_kHeWP02irRfLA,26211
|
|
35
35
|
pptx2/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
36
|
pptx2/rebind.py,sha256=O5YTKyMe8_f3CjDLXVEqAAnM5IXd3rMfzoaSio4jRc4,22689
|
|
37
|
-
pptx2/render.py,sha256=
|
|
37
|
+
pptx2/render.py,sha256=kK648o1UrflDXAUZ-LxoaPTVfpwLRa5EvNDQcVkBbY4,25725
|
|
38
38
|
pptx2/section.py,sha256=cYCPsqoez1e65qPOuQ_HiefazxBiI61FVe4qOJVWPr8,10975
|
|
39
39
|
pptx2/shared.py,sha256=K9bFdh4yjjOwuH1CO1vKxFwR4K2z-6VhLgopHEh0deQ,2749
|
|
40
40
|
pptx2/slide.py,sha256=xRbIyWLOpSEM9Ikp2La5sDhIqf80Yu7GRIJkQsF6TZQ,74677
|
|
@@ -190,9 +190,9 @@ pptx2/text/bullet.py,sha256=XvpKva7EE4YE33t4f1tkIErB1wL9swzgiyUPbMi9K4s,10682
|
|
|
190
190
|
pptx2/text/fonts.py,sha256=ECa9HuBfeTqOi-uJTz_bu7eurC7e1_64RTwDatxmkpk,16498
|
|
191
191
|
pptx2/text/layout.py,sha256=k8bqod6GyshHJtfoqFtH9W-eHTI43IB0e6SLT1ibSUU,12815
|
|
192
192
|
pptx2/text/text.py,sha256=9bumXWy5_Qo9esJQcYjMH0vSu8_g0gZR2V6wXVXQwjI,67426
|
|
193
|
-
python_pptx2-3.1.
|
|
194
|
-
python_pptx2-3.1.
|
|
195
|
-
python_pptx2-3.1.
|
|
196
|
-
python_pptx2-3.1.
|
|
197
|
-
python_pptx2-3.1.
|
|
198
|
-
python_pptx2-3.1.
|
|
193
|
+
python_pptx2-3.1.1.dist-info/licenses/LICENSE,sha256=hLdud18ZPS9iSG3kBCBLiGYzj4A6zedCHiDejIDBXNg,1230
|
|
194
|
+
python_pptx2-3.1.1.dist-info/METADATA,sha256=xlEwGimcT--e7cgdREPguK7gESrKV-WILqzIE7sbViQ,14374
|
|
195
|
+
python_pptx2-3.1.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
196
|
+
python_pptx2-3.1.1.dist-info/entry_points.txt,sha256=5Yzp5M6gLWKRPuNh2YbHWrMH7RidJi18lhAePTbsXs8,148
|
|
197
|
+
python_pptx2-3.1.1.dist-info/top_level.txt,sha256=5yzvoFwKPreEAzXDv7bsFeHyTEZpkw_HrFtA64bWL0w,24
|
|
198
|
+
python_pptx2-3.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|