{"id":37236484,"url":"https://github.com/carboneio/carbone-sdk-php","last_synced_at":"2026-01-16T04:53:34.231Z","repository":{"id":65222855,"uuid":"373562295","full_name":"carboneio/carbone-sdk-php","owner":"carboneio","description":"PHP SDK to generate documents (PDF DOCX ODT XLSX ODS XML ...) with the Carbone Cloud API ","archived":false,"fork":false,"pushed_at":"2025-12-23T23:57:45.000Z","size":291,"stargazers_count":11,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-14T14:53:13.482Z","etag":null,"topics":["automation","document","docx","docx-generator","pdf","php","reporting","sdk","xlsx"],"latest_commit_sha":null,"homepage":"https://carbone.io/api-reference.html","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/carboneio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","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":"2021-06-03T15:49:59.000Z","updated_at":"2026-01-03T01:12:05.000Z","dependencies_parsed_at":"2025-07-21T14:39:13.896Z","dependency_job_id":null,"html_url":"https://github.com/carboneio/carbone-sdk-php","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"84b91d336cd129bc773a7a39b0f5ad889215b491"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/carboneio/carbone-sdk-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carboneio%2Fcarbone-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carboneio%2Fcarbone-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carboneio%2Fcarbone-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carboneio%2Fcarbone-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carboneio","download_url":"https://codeload.github.com/carboneio/carbone-sdk-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carboneio%2Fcarbone-sdk-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"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","document","docx","docx-generator","pdf","php","reporting","sdk","xlsx"],"created_at":"2026-01-15T04:14:50.346Z","updated_at":"2026-01-15T04:14:51.033Z","avatar_url":"https://github.com/carboneio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Carbone PHP SDK\n\nThis package provides a PHP SDK for the [Carbone.io](https://carbone.io) Cloud API.\n\n![Cover](./carbone-sdk-php.png)\n\n## About Carbone\n\nCarbone is a powerful and easy to use API to generate documents from a template to a PDF. It is based on LibreOffice and can convert any document supported by LibreOffice. It is also possible to convert HTML to PDF. Learn more about [supported files and features](https://carbone.io/documentation.html#supported-files-and-features-list).\n\n## Installation\n\nYou can install the bindings via [Composer](http://getcomposer.org/). Run the following command:\n\n```bash\ncomposer require carboneio/carbone-sdk-php\n```\n\n## Usage\n\n### Carbone instance\n\nUsing the SDK is very easy. You just need to create a new instance of the Carbone class and provide your API key. Get your API key on your Carbone account: https://account.carbone.io/.\n\n```php\nuse Carboneio\\SDK\\Carbone;\n\n$carbone = new Carbone('YOUR_API_KEY', 'https://api.carbone.io/');\n```\n\n### Upload a template\n\nYou can upload a template to Carbone using the `upload` method. This method takes the content of the template as base64. The method returns a `template ID` used to [generate documents](#render-a-template).\n\n```php\n$response = $carbone-\u003etemplates()-\u003eupload($contentBase64);\n\n$templateId = $response-\u003egetTemplateId();\n```\n\nExample to [upload a template](./examples/upload_template.php)\n\n### Render a template\n\nYou can generate a document using the `render` method. This method takes the `template Id` and the data as parameters. A `render ID` is returned and must be used to [download the generated document](#download-a-rendered-template).\n\n```php\n$response = $carbone-\u003erenders()-\u003erender($templateId, $data);\n\n$renderId = $response-\u003egetRenderId();\n```\nExample to [render a template](./examples/render_report.php)\n\n### Download a rendered template\n\nYou can download a rendered template using the `download` method. This method takes the `render ID` as a parameter.\n\n```php\n$response = $carbone-\u003erenders()-\u003edownload($renderId);\n\n// Save the contents of the file yourself on your filesystem\n$content = $response-\u003egetContent();\n```\nExample to [download a rendered document](./examples/download_report.php)\n\n### Delete a template\n\nYou can delete a template using the `delete` method. This method takes the `template Id` as a parameter.\n\n```php\n$response = $carbone-\u003etemplates()-\u003edelete($templateId);\n```\n\nExample to [delete a template](./examples/delete_template.php)\n\n### Download a template\n\nYou can download a template using the `download` method. This method takes the `template Id` as a parameter.\n\n```php\n$response = $carbone-\u003etemplates()-\u003edownload($templateId);\n```\nExample to [download a template](./examples/download_template.php)\n\n### Add custom headers\n\nSet custom headers, such as \"carbone-version\" to select a specific [Carbone version](https://carbone.io/api-reference.html#api-version). By default, the SDK request the version 4 of Carbone.\n\n```php\n$carbone-\u003eheaders()-\u003eset([\n  \"carbone-version\" =\u003e 4,\n  /** Uncomment to delete automatically templates after a specific time */\n  // \"carbone-template-delete-after\" =\u003e 86400, // 86400s = 1 day | https://carbone.io/api-reference.html#template-storage\n  // \"carbone-webhook-url\" =\u003e \"https://my-server\", // https://carbone.io/api-reference.html#api-webhook\n]);\n```\n\n### Get API Status\n\n```php\n$response = $carbone-\u003egetStatus();\n$json = $response-\u003ejson();\n\necho \"Status : \" . $response-\u003estatus() . \"\\n\";\necho \"Success: \" . $json['success'] . \"\\n\";\necho \"Version: \" . $json['version'] . \"\\n\";\necho \"Message: \" . $json['message'] . \"\\n\";\n```\n\n## 🧪 Run tests\n\nFirst install required composer packages:\n```bash\ncomposer install\n```\n\nThen execute tests:\n```bash\ncomposer test\n```\n\n## 👤 History\n\nThe package was originaly made by [MadeByBob](https://github.com/madebybob) and open-sourced the code. The Carbone.io team is now maintaining the SDK and will bring all futur evolutions.\u003cbr\u003e\nOriginal repository:https://github.com/madebybob/carbone-sdk\u003cbr\u003e\nMadeByBob website: https://madebybob.nl/\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\n\nFeel free to check [issues page](https://github.com/carboneio/carbone-sdk-php/issues).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarboneio%2Fcarbone-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarboneio%2Fcarbone-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarboneio%2Fcarbone-sdk-php/lists"}