{"id":18765320,"url":"https://github.com/setasign/setapdf-imageextractor","last_synced_at":"2025-07-04T17:39:13.888Z","repository":{"id":57745273,"uuid":"513908299","full_name":"Setasign/SetaPDF-ImageExtractor","owner":"Setasign","description":"PoC to extract images from PDFs with SetaPDF-Core","archived":false,"fork":false,"pushed_at":"2022-07-26T15:18:48.000Z","size":103,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-16T15:05:47.239Z","etag":null,"topics":["image-extraction","pdf","php","setapdf"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/Setasign.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}},"created_at":"2022-07-14T13:16:20.000Z","updated_at":"2022-07-27T06:20:11.000Z","dependencies_parsed_at":"2022-09-11T09:40:50.367Z","dependency_job_id":null,"html_url":"https://github.com/Setasign/SetaPDF-ImageExtractor","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/Setasign%2FSetaPDF-ImageExtractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2FSetaPDF-ImageExtractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2FSetaPDF-ImageExtractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2FSetaPDF-ImageExtractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Setasign","download_url":"https://codeload.github.com/Setasign/SetaPDF-ImageExtractor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239663500,"owners_count":19676591,"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":["image-extraction","pdf","php","setapdf"],"created_at":"2024-11-07T18:33:33.998Z","updated_at":"2025-02-19T13:24:01.277Z","avatar_url":"https://github.com/Setasign.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SetaPDF-ImageExtractor\nThis package is a proof of concept to extract images from PDFs in pure PHP with the SetaPDF-Core component and an image render module.\nCurrently, not all kinds of images are supported. This is also very dependent on your used image renderer library.\nGD and Imagick are currently implemented. We recommend you to use Imagick as it's more feature complete as GD but may be\na little harder to install.\n\n## Requirements\nThis package is developed and tested on PHP \u003e= 7.4. \n\nYou'll need an active license of the [SetaPDF-Core](https://www.setasign.com/products/setapdf-core/details/) component.\n\nRequirements of the SetaPDF-Core component can be found \n[here](https://manuals.setasign.com/setapdf-core-manual/installation/#index-1).\n\n## Usage\nThis example here extracts all images from the first page of the pdf: \n\n```php\n$document = SetaPDF_Core_Document::loadByFilename('your-pdf-file.pdf');\n$images = \\setasign\\SetaPDF\\ImageExtractor\\ImageExtractor::getImagesByPageNo($document, 1);\nforeach ($images as $imageData) {\n    // if you're using imagick\n    $imagick = \\setasign\\SetaPDF\\ImageExtractor\\ImageExtractor::toImage($imageData, ImageExtractor::IMAGE_RENDERER_IMAGICK);\n    $imagick-\u003esetImageFormat('png');\n    $image = $imagick-\u003egetImageBlob();\n    $imagick-\u003edestroy();\n    echo '\u003cimg src=\"data:image/png;base64,' . base64_encode($image) . '\"/\u003e';\n\n    // if you're using gd use this code instead\n    $gd = ImageExtractor::toImage($imageData, ImageExtractor::IMAGE_RENDERER_GD);\n    ob_start();\n    imagepng($gd);\n    $image = ob_get_clean();\n    imagedestroy($gd);\n    echo '\u003cimg src=\"data:image/png;base64,' . base64_encode($image) . '\"/\u003e';\n}\n```\n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsetasign%2Fsetapdf-imageextractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsetasign%2Fsetapdf-imageextractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsetasign%2Fsetapdf-imageextractor/lists"}