使用 PIL/Pillow 将多个页面添加到新 PDF

Add multiple pages to new PDF using PIL/Pillow

http://pillow.readthedocs.org/en/3.0.x/handbook/image-file-formats.html#pdf

Pillow 文档提到能够保存多个页面,但我找不到任何其他文档或代码示例来告诉您如何将页面添加到新的 PDF。

您可以尝试以下方法:

im.save('test.pdf', save_all=True)

默认情况下,输出格式由文件扩展名决定。这记录在 release notes.

Pillow 目前似乎无法做到这一点,我使用 reportlab 从头开始​​构建 multi-page PDF:

https://pypi.python.org/pypi/reportlab