{"id":50564108,"url":"https://github.com/zainibeats/image-pdf-tools","last_synced_at":"2026-06-04T13:01:30.168Z","repository":{"id":362259644,"uuid":"1256854723","full_name":"zainibeats/image-pdf-tools","owner":"zainibeats","description":"Python tools for turning images into a grid and appending it to the end of a PDF","archived":false,"fork":false,"pushed_at":"2026-06-03T09:38:10.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-03T11:18:20.405Z","etag":null,"topics":["automation","heic","image-processing","pdf","python","reciepts"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zainibeats.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-02T06:28:59.000Z","updated_at":"2026-06-02T06:39:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zainibeats/image-pdf-tools","commit_stats":null,"previous_names":["zainibeats/image-pdf-tools"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zainibeats/image-pdf-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zainibeats%2Fimage-pdf-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zainibeats%2Fimage-pdf-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zainibeats%2Fimage-pdf-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zainibeats%2Fimage-pdf-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zainibeats","download_url":"https://codeload.github.com/zainibeats/image-pdf-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zainibeats%2Fimage-pdf-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33905359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","heic","image-processing","pdf","python","reciepts"],"created_at":"2026-06-04T13:01:28.716Z","updated_at":"2026-06-04T13:01:30.162Z","avatar_url":"https://github.com/zainibeats.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image PDF Tools\n\nSmall Python tools for preparing image-based PDF attachments. Each script can be\nused on its own, but they also work well together for weekly receipt workflows:\ncollect receipt images, turn them into one grid image, then attach that image to\nthe end of an expense report in PDF format.\n\nOriginal images and PDFs are always preserved.\n\n## Tools\n\n- `make-image-grid.py`: combines HEIC, HEIF, JPG, JPEG, and PNG images into one\n  balanced JPG grid. Default image limit is 40. \n- `append-image-page.py`: appends a JPG/JPEG image as a US Letter page at the\n  end of an existing PDF. Default input PDF limit is 10 pages. \n\n## Dependencies\n\n- Python 3.10+\n- `Pillow`\n- `pillow-heif`\n- `pypdf[crypto]`\n\n## Install\n\nInstall dependencies in a standard Python virtual environment.\n\n**Windows PowerShell:**\n\n```powershell\ncd path\\to\\image-pdf-tools\npython -m venv .venv\n.\\.venv\\Scripts\\Activate.ps1\npython -m pip install -r requirements.txt\n```\n\n_If Windows blocks the `Activate.ps1` step, enable running local PowerShell\nscripts first. Open Windows Settings, search for `PowerShell`, and turn on the\ndeveloper setting that allows local PowerShell scripts to run without signing.\nThen close and reopen PowerShell and run the commands above again._\n\n**macOS / Linux:**\n\n```bash\ncd /path/to/image-pdf-tools\npython3 -m venv .venv\nsource .venv/bin/activate\npython -m pip install -r requirements.txt\n```\n\n## Basic Workflow\n\nCreate a grid from a folder of images:\n\n```bash\npython make-image-grid.py ~/Pictures/images\n```\n\nThis writes `image-grid.jpg` inside the input folder by default.\n\nAppend that image to an existing PDF:\n\n```bash\npython append-image-page.py ~/Pictures/images/image-grid.jpg --pdf ~/Downloads/input.pdf\n```\n\nThis writes a PDF next to the image by default:\n\n```text\n~/Pictures/images/image-grid.pdf\n```\n\n## Examples\n\n**Image Grid:**\n\n```bash\n# Choosing the grid output name and path\npython make-image-grid.py ~/Pictures/images -o ~/Desktop/image-grid.jpg\n\n# Raise the batch limit for a larger image set:\npython make-image-grid.py ~/Pictures/images --max-images 60\n```\n\n**Append Image to PDF:**\n\n```bash\n# Choosing the final PDF output name and path\npython append-image-page.py ~/Desktop/image-grid.jpg --pdf ~/Downloads/input.pdf -o ~/Desktop/final.pdf\n\n# Raise PDF page limit\npython append-image-page.py ~/Desktop/image-grid.jpg --pdf ~/Downloads/input.pdf --max-pdf-pages 20\n```\n\n_Existing output files are not replaced unless `--overwrite` is passed._\n\n\u003e **Note**: The append script can handle unencrypted PDFs and owner-restricted PDFs that\nopen with an empty password. PDFs that require a user password are not\nsupported.\n\n## Behavior\n\n- `make-image-grid.py` accepts `.heic`, `.heif`, `.jpg`, `.jpeg`, and `.png` images up to the default safety limit of 40 images.\n- `make-image-grid.py` only scans files directly inside the input folder. Subfolders are ignored.\n- Original input images are left untouched.\n- The image grid is always written as JPG. The grid uses a white background and balanced rows/columns.\n- With 2 images, the grid is 2 rows by 1 column, so the output is portrait-oriented.\n- `append-image-page.py` keeps the image aspect ratio and centers it on a white\n  US Letter page.\n- The scripts fail when inputs exceed configured safety limits. Use\n  `--max-images`, `--max-image-pixels`, `--max-output-pixels`, or\n  `--max-pdf-pages` to raise a limit for larger inputs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzainibeats%2Fimage-pdf-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzainibeats%2Fimage-pdf-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzainibeats%2Fimage-pdf-tools/lists"}