slideshare-to-pdf
slideshare-to-pdf copied to clipboard
Support Python 3 and Fix Slide Order
@angonyfox thanks for the updates! Just a couple things:
We could improve the leading 0s logic by calculating the number of zeros based on the number of slides. Which will cover any number of slides from the 10s to the 1000s.
# ...
# calculate number of digits
# where if slides length = 1234; then number_digits = 4
number_digits = len(str(images))
# format slide name to account for number of digits
# where if number_digits=3; then slide_name = 'slide-{:03}.jpg'
slide_name = 'slide-{{:0{}}}.jpg'.format(number_digits)
for i, image in enumerate(images, start=1):
# form slides data
remote_slide = image[slide_resolution]
local_slide = os.path.join(dir_tmp, slide_name.format(i))
#...
It'd be good to update the bootstrap.sh file as well. I noticed that Python3 requires python3-lxml
but I wasn't able to find the ImageMagick version you used. How did you install it?