Add multiple pages to new PDF using PIL/Pillow

橙三吉。 提交于 2019-12-24 12:41:37

问题


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

The Pillow docs mention being able to save multiple pages, but I can't find any other docs or code samples that tell you how to add pages to a new PDF.


回答1:


You could try the following:

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

By default, the output format is determined by the file extension. This is documented in the release notes.




回答2:


Doesn't seem like this is currently possible with Pillow, I used reportlab to build a multi-page PDF from scratch:

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



来源:https://stackoverflow.com/questions/34036886/add-multiple-pages-to-new-pdf-using-pil-pillow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!