pyguymer3.media.images2pdf

pyguymer3.media.images2pdf(imgs, pdf, /, *, author='My Author', keywords='My Keywords', mode='RGB', optimise=True, progressive=False, quality=95, resolution=300, screenHeight=-1, screenWidth=-1, subject='My Subject', title='My Title')[source]

Convert a sequence of images to a PDF slide pack.

This function makes a PDF slide pack from either a list of PIL Images or a list of file paths.

Parameters:
  • imgs (list of PIL.Image.Image or list of str) – the list of input PIL Images or list of paths to the input images

  • pdf (str) – the path to the output PDF

  • author (str, optional) – The author field in the output PDF metadata

  • keywords (str, optional) – The keywords field in the output PDF metadata

  • mode (str, optional) – the mode of the JPGs in the outout PDF

  • optimise (bool, optional) – optimise the JPGs in the output PDF

  • progressive (bool, optional) – save progressive JPGs in the output PDF

  • quality (int, optional) – the quality of the JPGs in the output PDF

  • resolution (int, optional) – the resolution of the JPGs in the output PDF (has no effect on the JPGs, but the physical size of the PDF is derived from the pixel size of the JPGs)

  • screenHeight (int, optional) – the height of the screen to downscale the input images to fit within, currently only implemented if “imgs” is a list of str (integers less than 100 imply no downscaling)

  • screenWidth (int, optional) – the width of the screen to downscale the input images to fit within, currently only implemented if “imgs” is a list of str (integers less than 100 imply no downscaling)

  • subject (str, optional) – The subject field in the output PDF metadata

  • title (str, optional) – The title field in the output PDF metadata

Notes

Copyright 2017 Thomas Guymer [1]

References