Skip to content

Commit

Permalink
adds
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfessorKazarinoff committed Nov 13, 2019
1 parent 7648196 commit 6e53703
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,4 @@ fabric.properties
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
.vscode/
19 changes: 19 additions & 0 deletions convert_slides.py
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")

0 comments on commit 6e53703

Please sign in to comment.