{"id":49585477,"url":"https://github.com/anarkrypto/pdf-to-img","last_synced_at":"2026-05-03T22:06:52.223Z","repository":{"id":218295648,"uuid":"732346191","full_name":"anarkrypto/pdf-to-img","owner":"anarkrypto","description":"Convert PDF to JPG or PNG","archived":false,"fork":false,"pushed_at":"2024-09-23T16:32:13.000Z","size":162,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-19T14:11:09.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anarkrypto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-12-16T11:23:48.000Z","updated_at":"2024-09-23T16:32:16.000Z","dependencies_parsed_at":"2024-01-21T03:20:00.128Z","dependency_job_id":"ff3e724f-7ec5-454b-80f7-3dd3b7a4c85c","html_url":"https://github.com/anarkrypto/pdf-to-img","commit_stats":null,"previous_names":["anarkrypto/pdf-to-img"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anarkrypto/pdf-to-img","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarkrypto%2Fpdf-to-img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarkrypto%2Fpdf-to-img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarkrypto%2Fpdf-to-img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarkrypto%2Fpdf-to-img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anarkrypto","download_url":"https://codeload.github.com/anarkrypto/pdf-to-img/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarkrypto%2Fpdf-to-img/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32586245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-05-03T22:06:52.131Z","updated_at":"2026-05-03T22:06:52.189Z","avatar_url":"https://github.com/anarkrypto.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PDF-TO-IMG\n\nConvert PDF to JPG, PNG\n\n![PDF-TO-IMG](https://github.com/anarkrypto/pdf-to-img/assets/32111208/6652981e-7c3c-4d96-85fa-9c8b26669b13)\n\n## Overview\nThis project provides a seamless, robust and scalable solution for converting PDF documents into images using customizable parameters such as quality, DPI, and image format.\n\nIt's built using **Node.js**, **MuPDF** for conversion, **RabbitMQ** for queue management, and **Docker** for containerization.\n\n## Workflow\n1. Client Request: The client sends a POST request to the API with the PDF URL, Webhook url and conversion parameters.\n2. Queue Processing: The request is queued in RabbitMQ for asynchronous processing, ensuring efficient resource utilization.\n3. PDF Download: The project fetches the PDF from the specified URL.\n4. Identification: The PDF file is checked to ensure format compatibility and detect the number of pages\n5. Conversion: Each PDF page is converted into image using MuPDF, according to the provided parameters, using all available CPU threads.\n6. Upload: The resulting images are uploaded to an S3 bucket for secure and scalable storage.\n7. Webhook Notification: The specified webhook URL is invoked, notifying the client of the completion of the conversion process.\n\n## Running locally:\n\n1. Cutomize your environments:\n```\ncp example.env .env\n```\n\n2. Run the container. You can use docker compose: \n```bash\ndocker compose up\n```\n\n3. Send your requests to\n```\nhttp://localhost:3000/convert\n```\n\n## API Usage\n\n### Endpoint\n\n```\nPOST /convert\n```\n\n### Request Body\n\nOptional params:\n- format: jpg or png. Default is jpg\n- quality: 1 to 100. Default is 100. Only for jpg format\n- dpi: 1 to 600. Default is 300\n\n```json\n{\n  \"url\": \"https://example.com/path/to/document.pdf\",\n  \"format\": \"jpg\",\n  \"quality\": 100,\n  \"dpi\": 300,\n  \"webhook\": \"https://client-webhook.com/notify\"\n}\n```\n\n### Response Body\n\n```json\n{\n  \"success\": true,\n  \"convertionId\": \"d7f73e86-a55c-4b81-8995-4d9a9f0cbe1b\"\n}\n```\n\n### Webhook\n\n```json\n{\n  \"success\": true,\n  \"convertionId\": \"d7f73e86-a55c-4b81-8995-4d9a9f0cbe1b\",\n  \"url\": \"https://example.com/path/to/document.pdf\",\n  \"format\": \"jpg\",\n  \"quality\": 100,\n  \"dpi\": 300,\n  \"webhook\": \"https://client-webhook.com/notify\",\n  \"pages\": [\n    {\n      \"url\": \"https://my-bucket.s3.sa-east-1.amazonaws.com/pdfs/d7f73e86-a55c-4b81-8995-4d9a9f0cbe1b/0.jpg\",\n      \"page\": 1,\n      \"width\": 612,\n      \"height\": 792\n    },\n    {\n      \"url\": \"https://my-bucket.s3.sa-east-1.amazonaws.com/pdfs/d7f73e86-a55c-4b81-8995-4d9a9f0cbe1b/1.jpg\",\n      \"page\": 2,\n      \"width\": 612,\n      \"height\": 792\n    }\n  ]\n}\n```\n\n## Deployment\nThe entire project can be easily deployed using Docker, ensuring consistency across different environments.\n\n## License\nThis project is licensed under the MIT License.\n\n## Contributing\nWe welcome contributions! Please check out our [Contribution Guidelines](./CONTRIBUTING.md) for more details.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanarkrypto%2Fpdf-to-img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanarkrypto%2Fpdf-to-img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanarkrypto%2Fpdf-to-img/lists"}