Python3 image (jpg, bmp, png) to PDF

1. Environment introduction

  • python3.x and above
  • Python dependencies: reportlab, PIL

2. Features

  • Convert images to PDF, suitable for batch conversion. such as comics. Image documents, etc.
  • The image size is automatically processed, and it is suitable for terminals such as kindle, iphone, and ipad.
  • Support multiple file path retrieval for conversion.
  • Support jpg, png, bmp
  • Supports sorting of complex file names

2.1 Converting the directory structure

The files to be converted need to be placed in the folder to be converted in advance

|--wait
        |--imageDir-1
               |--1.jpg
               |--2.jpg
               |--......jpg
        |--imageDir-2
               |--1.jpg
               |--2.jpg
               |--......jpg
        |--....

Interested friends can download and use the project GitHub address

Advertising column: welcome to follow my personal blog

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325024435&siteId=291194637