-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpresentation_to_jpeg_converter_examples.py
More file actions
55 lines (41 loc) · 1.93 KB
/
presentation_to_jpeg_converter_examples.py
File metadata and controls
55 lines (41 loc) · 1.93 KB
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
53
54
55
import slidize
# Basic conversion from a presentation file to JPEG images
def convert_basic():
slidize.PresentationToJpegConverter.process("presentation.pptx", "slide.jpg")
# Conversion with custom image dimensions
def convert_with_custom_dimensions():
options = slidize.ImageConverterOptions()
options.image_width = 1024
options.image_height = 768
slidize.PresentationToJpegConverter.process("presentation.pptx", "slide.jpg", options)
# Scaling images by a factor
def convert_with_image_scaling():
options = slidize.ImageConverterOptions()
options.image_scale = 1.5
slidize.PresentationToJpegConverter.process("presentation.pptx", "slide.jpg", options)
# Setting a default font for text rendering
def convert_with_default_font():
options = slidize.ImageConverterOptions()
options.default_regular_font = "Arial"
slidize.PresentationToJpegConverter.process("presentation.pptx", "slide.jpg", options)
# Including speaker notes in the output images
def convert_with_speaker_notes():
slides_view_options = slidize.NotesCommentsViewOptions()
slides_view_options.notes_position = slidize.NotesPositions.BOTTOM_FULL
options = slidize.ImageConverterOptions()
options.slides_view_options = slides_view_options
slidize.PresentationToJpegConverter.process("presentation.pptx", "slide.jpg", options)
# Including comments in the output images
def convert_with_comments():
slides_view_options = slidize.NotesCommentsViewOptions()
slides_view_options.comments_position = slidize.CommentsPositions.RIGHT
options = slidize.ImageConverterOptions()
options.slides_view_options = slides_view_options
slidize.PresentationToJpegConverter.process("presentation.pptx", "slide.jpg", options)
if __name__ == "__main__":
convert_basic()
convert_with_custom_dimensions()
convert_with_image_scaling()
convert_with_default_font()
convert_with_speaker_notes()
convert_with_comments()