This Python script scans a specified directory for PDF files and processes each one to generate and organize thumbnails to be used in the S3 previews.
For each PDF file in the given folder, the script:
- Creates a subfolder named after the PDF file (excluding the
.pdf
extension). - Generates a thumbnail of the first page of the PDF.
- Saves both the original PDF and the thumbnail inside the new subfolder.
- Organizes files for easier browsing, display, or archiving and to uploaded into the S3.