This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Filename: pdf_to_png.py | |
| # Summary: Converts specified or all PDF pages to PNG images on macOS, extracting the first non-empty text line as the title for filenames. | |
| # Filenames are structured as <file-name>_pg-<page-number>_<slide-title>.png for better sorting by page number. | |
| # Page numbers are padded with leading zeros based on the total number of pages. | |
| # Usage: | |
| # - Convert all pages: python pdf_to_png.py input.pdf | |
| # - Convert a range (e.g., pages 3-7): python pdf_to_png.py input.pdf --pages 3-7 | |
| # - Convert specific pages (e.g., pages 1,3,5): python pdf_to_png.py input.pdf --pages 1,3,5 | |
| # Dependencies: | |
| # - pdf2image: Install via `pip install pdf2image` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # --- MIT License --- | |
| # | |
| # Copyright (c) 2025 [Jon Robbins] | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights |
OlderNewer