-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7648196
commit 6e53703
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,3 +179,4 @@ fabric.properties | |
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
*.code-workspace | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# convert_slides.py | ||
""" | ||
A Python script to convert a multi-page PDF to a directory of images | ||
Uses the pdf2image package | ||
""" | ||
|
||
from pdf2image import convert_from_path | ||
|
||
from pdf2image.exceptions import ( | ||
PDFInfoNotInstalledError, | ||
PDFPageCountError, | ||
PDFSyntaxError | ||
) | ||
|
||
images = convert_from_path('PeterKazarinoff_PyDataPDX_2019-11.pdf') | ||
|
||
for i, image in enumerate(images): | ||
fname = 'image'+str(i)+'.png' | ||
image.save(fname, "PNG") |