{"id":19059534,"url":"https://github.com/vaibhavpandeyvpz/php-rsvg","last_synced_at":"2025-04-24T06:18:59.612Z","repository":{"id":238084491,"uuid":"795836568","full_name":"vaibhavpandeyvpz/php-rsvg","owner":"vaibhavpandeyvpz","description":"PHP extension based on RSVG library to quickly convert SVG files into EPS, PDF, PNG and SVG again.","archived":false,"fork":false,"pushed_at":"2024-05-06T12:52:57.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-24T06:18:54.441Z","etag":null,"topics":["c","cairo","pdf","php","phpize","png","rsvg"],"latest_commit_sha":null,"homepage":"https://vaibhavpandey.com/","language":"PHP","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/vaibhavpandeyvpz.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}},"created_at":"2024-05-04T07:44:43.000Z","updated_at":"2024-05-07T12:31:33.000Z","dependencies_parsed_at":"2024-05-04T08:42:15.430Z","dependency_job_id":null,"html_url":"https://github.com/vaibhavpandeyvpz/php-rsvg","commit_stats":null,"previous_names":["vaibhavpandeyvpz/php-rsvg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavpandeyvpz%2Fphp-rsvg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavpandeyvpz%2Fphp-rsvg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavpandeyvpz%2Fphp-rsvg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavpandeyvpz%2Fphp-rsvg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaibhavpandeyvpz","download_url":"https://codeload.github.com/vaibhavpandeyvpz/php-rsvg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250573420,"owners_count":21452359,"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":["c","cairo","pdf","php","phpize","png","rsvg"],"created_at":"2024-11-09T00:10:28.056Z","updated_at":"2025-04-24T06:18:59.593Z","avatar_url":"https://github.com/vaibhavpandeyvpz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-rsvg\n\n[PHP](https://www.php.net/) extension based on [RSVG](https://gitlab.gnome.org/GNOME/librsvg) library to quickly convert SVG files into EPS, PDF, PNG and SVG again.\n\n## Requirements\n\n* [PHP](https://www.php.net/) 7.x or 8.x\n* [cairo](https://www.cairographics.org/) (tested with 1.18.0)\n* [librsvg](https://gitlab.gnome.org/GNOME/librsvg) (tested with 2.58.0)\n\n## Installation\n\nTo build and install the module, clone the project and run below command:\n\n```shell\nphpize\n./configure\nmake\nmake install\n```\n\nThen enable the extension in your `php.ini`\n\n```shell\nextension=rsvg.so\n```\n\nTo try out the extension, you can run the following command\n\n```shell\nphp -a -d extension=modules/rsvg.so\n```\n\n## Usage\n\nOnce loaded, you can use below functions to process SVG files:\n\n```php\n\u003c?php\n\n// read SVG file contents\n$svg_contents = file_get_contents('qrcode.svg');\n\n// convert from SVG to PNG\n$png_contents = rsvg_convert($svg_contents, 'png', '#ffffff'); // can also pass 'eps', 'pdf' or 'svg'\n\n// can also convert b/w files directly\nrsvg_convert_file('qrcode.svg', 'qrcode.png', 'png', '#ffffff');\n```\n\nIn above examples, `#ffffff` is the background color to be used for output.\nTo output an image with transparent background, supply an empty string i.e., `''`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhavpandeyvpz%2Fphp-rsvg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaibhavpandeyvpz%2Fphp-rsvg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhavpandeyvpz%2Fphp-rsvg/lists"}