{"id":19607259,"url":"https://github.com/robocorp/example-pdf-to-image","last_synced_at":"2025-05-13T00:47:12.197Z","repository":{"id":103903295,"uuid":"369165260","full_name":"robocorp/example-pdf-to-image","owner":"robocorp","description":"This robot converts PDF files to PNG images using Python. ","archived":false,"fork":false,"pushed_at":"2024-01-02T17:21:02.000Z","size":669,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-13T00:47:03.238Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robocorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-05-20T10:13:24.000Z","updated_at":"2024-12-25T12:51:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf1686af-95a6-4ca8-9f79-91a50b69d7b0","html_url":"https://github.com/robocorp/example-pdf-to-image","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-pdf-to-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-pdf-to-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-pdf-to-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-pdf-to-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robocorp","download_url":"https://codeload.github.com/robocorp/example-pdf-to-image/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850874,"owners_count":21973671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-11T10:09:37.387Z","updated_at":"2025-05-13T00:47:12.178Z","avatar_url":"https://github.com/robocorp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convert PDF files to PNG images\n\nThis robot converts [PDF](https://en.wikipedia.org/wiki/PDF) files to [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) images using Python. This is useful when you want to use [OCR (Optical Character Recognition)](https://en.wikipedia.org/wiki/Optical_character_recognition) and image recognition services to extract data from your documents.\n\nThere are two example PDF files:\n\n- A single-page `example-invoice.pdf`\n- A multipage `example-multipage.pdf`\n\nThe `pdf2image` library generates one image per PDF document page:\n\n```bash\nexample-invoice.pdf-0.png\nexample-multipage.pdf-0.png\nexample-multipage.pdf-1.png\nexample-multipage.pdf-2.png\nexample-multipage.pdf-3.png\nexample-multipage.pdf-4.png\nexample-multipage.pdf-5.png\nexample-multipage.pdf-6.png\nexample-multipage.pdf-7.png\nexample-multipage.pdf-8.png\n```\n\n## Dependencies\n\n`conda.yaml`:\n\n```yaml\nchannels:\n  - conda-forge\n\ndependencies:\n  - python=3.7.5\n  - poppler=21.03.0\n  - pdf2image=1.15.1\n```\n\n## The robot\n\n`task.py`:\n\n```py\nfrom pdf2image import convert_from_path\n\n\ndef convert_pdf_to_images(pdf_path):\n    images = convert_from_path(pdf_path)\n    for index, image in enumerate(images):\n        image.save(f'output/{pdf_path}-{index}.png')\n\n\ndef task():\n    convert_pdf_to_images('example-invoice.pdf')\n    convert_pdf_to_images('example-multipage.pdf')\n\n\nif __name__ == \"__main__\":\n    task()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-pdf-to-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobocorp%2Fexample-pdf-to-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-pdf-to-image/lists"}