{"id":20583738,"url":"https://github.com/mzur/invoiscript","last_synced_at":"2025-04-14T20:32:29.410Z","repository":{"id":57046149,"uuid":"375788398","full_name":"mzur/InvoiScript","owner":"mzur","description":"Generate simple PDF invoices with PHP","archived":false,"fork":false,"pushed_at":"2025-01-14T08:12:09.000Z","size":227,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T08:51:11.018Z","etag":null,"topics":["invoice","invoice-pdf","php"],"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/mzur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"https://www.paypal.me/mzur/5eur"}},"created_at":"2021-06-10T18:08:58.000Z","updated_at":"2025-03-13T10:10:38.000Z","dependencies_parsed_at":"2022-08-24T03:40:22.132Z","dependency_job_id":null,"html_url":"https://github.com/mzur/InvoiScript","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzur%2FInvoiScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzur%2FInvoiScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzur%2FInvoiScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzur%2FInvoiScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mzur","download_url":"https://codeload.github.com/mzur/InvoiScript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248955917,"owners_count":21189257,"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":["invoice","invoice-pdf","php"],"created_at":"2024-11-16T06:43:31.349Z","updated_at":"2025-04-14T20:32:29.389Z","avatar_url":"https://github.com/mzur.png","language":"PHP","funding_links":["https://www.paypal.me/mzur/5eur"],"categories":[],"sub_categories":[],"readme":"# InvoiScript\n\nGenerate simple PDF invoices with PHP.\n\n## Installation\n\nRun:\n```bash\ncomposer require mzur/invoiscript\n```\n\n## Usage\n\n### Example\n\n```php\nuse Mzur\\InvoiScript\\Invoice;\n\nrequire_once(__DIR__.'/vendor/autoload.php');\n\n$content = [\n   'title' =\u003e 'Invoice No. 1',\n   'beforeInfo' =\u003e [\n      '\u003cb\u003eDate:\u003c/b\u003e',\n      'June 10, 2021',\n   ],\n   'afterInfo' =\u003e [\n      'All prices in EUR.',\n      '',\n      'This invoice is due on \u003cb\u003eJune 20, 2021\u003c/b\u003e.',\n   ],\n   'clientAddress' =\u003e [\n      'Jane Doe',\n      'Example Street 42',\n      '1337 Demo City',\n   ],\n   'entries' =\u003e [\n      [\n         'description' =\u003e 'Hot air',\n         'quantity' =\u003e 11,\n         'price' =\u003e 8,\n      ],\n      [\n         'description' =\u003e 'Something cool',\n         'quantity' =\u003e 5,\n         'price' =\u003e 20,\n      ],\n   ],\n];\n\n$pdf = new Invoice($content);\n$pdf-\u003egenerate('invoice.pdf');\n```\n\nThis generates the following PDF:\n\n\u003ca href=\"example/example.pdf\"\u003e\u003cimg src=\"example/example.png\"\u003e\u003c/a\u003e\n\n### Styling\n\nContent in `title`, `beforeInfo` and `afterInfo` can be styled with basic HTML-like tags. Example:\n\n```php\n$content = [\n   'title' =\u003e 'Invoice No. \u003cb\u003e1\u003c/b\u003e',\n   'beforeInfo' =\u003e [\n      '\u003ci\u003eDate:\u003c/i\u003e',\n      '\u003cu\u003eJune 10, 2021\u003c/u\u003e',\n   ],\n   //...\n];\n```\n\nAvailable tags:\n\n- `\u003cb\u003e\u003c/b\u003e`: Bold\n- `\u003ci\u003e\u003c/i\u003e`: Italic\n- `\u003cu\u003e\u003c/u\u003e`: Underlined\n\nSee the [layout section](#layout) for customization of font and font sizes.\n\n### Template\n\nSet a template file:\n\n```php\n$pdf = new Invoice($content);\n$pdf-\u003esetTemplate(__DIR__.'/template.pdf');\n```\n\nThe template can have multiple pages, which will be used for the matching pages of the invoice. If the invoice has more pages than the template, the last page of the template will be repeated.\n\n### Language\n\nSet the language:\n\n```php\n$pdf = new Invoice($content);\n$pdf-\u003esetLanguage('de');\n```\n\nAvailable languages are `en` and `de`. Default is `en`.\n\n### Variables\n\nVariables can be used in `title`, `beforeInfo` and `afterInfo`. Example:\n\n```php\n$content = [\n   'title' =\u003e 'Invoice No. {number}',\n   'beforeInfo' =\u003e [\n      '\u003cb\u003eDate:\u003c/b\u003e',\n      '{createdDate}',\n   ],\n   //...\n];\n\n$variables = [\n   'number' =\u003e 1,\n   'createdDate' =\u003e 'June 10, 2021',\n];\n\n$pdf = new Invoice($content);\n$pdf-\u003esetVariables($variables);\n```\n\nThe following variables are always available:\n\n- `{total}`: Total amount of the invoice.\n- `{page}`: Current page number.\n- `{pages}`: Total number of pages.\n\n### Layout\n\nThe default spacings, font, font size etc. can be overridden with a custom layout. Example:\n\n```php\n$layout = [\n   'font' =\u003e 'helvetica',\n];\n\n$pdf = new Invoice($content);\n$pdf-\u003esetLayout($layout);\n```\n\nSee the [source code](src/Invoice.php#L357) for all available layout options and the defaults.\n\n## Acknowledgment\n\nThanks to the creator(s) of [FPDF](http://www.fpdf.org/) and [FPDI](https://www.setasign.com/products/fpdi/about/)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzur%2Finvoiscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmzur%2Finvoiscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzur%2Finvoiscript/lists"}