{"id":20207103,"url":"https://github.com/kreativekorp/barcode","last_synced_at":"2025-04-04T21:07:00.992Z","repository":{"id":41333624,"uuid":"61605073","full_name":"kreativekorp/barcode","owner":"kreativekorp","description":"barcode.php - Generate barcodes from a single PHP file. MIT license.","archived":false,"fork":false,"pushed_at":"2023-02-22T07:27:46.000Z","size":48,"stargazers_count":270,"open_issues_count":24,"forks_count":137,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-28T20:06:14.961Z","etag":null,"topics":["barcode","barcode-generator","barcodes","codabar","code128","code39","code93","datamatrix","ean","ean13","ean8","linear-barcodes","matrix-barcodes","php","qr-code","qrcode","qrcode-generator","upc","upc-a","upc-e"],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/kreativekorp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-21T05:35:10.000Z","updated_at":"2025-03-10T21:12:45.000Z","dependencies_parsed_at":"2024-11-14T05:27:33.772Z","dependency_job_id":"70075b4b-7cbf-465f-8cb6-60a8c7e5c20b","html_url":"https://github.com/kreativekorp/barcode","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kreativekorp%2Fbarcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kreativekorp%2Fbarcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kreativekorp%2Fbarcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kreativekorp%2Fbarcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kreativekorp","download_url":"https://codeload.github.com/kreativekorp/barcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249524,"owners_count":20908212,"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":["barcode","barcode-generator","barcodes","codabar","code128","code39","code93","datamatrix","ean","ean13","ean8","linear-barcodes","matrix-barcodes","php","qr-code","qrcode","qrcode-generator","upc","upc-a","upc-e"],"created_at":"2024-11-14T05:27:28.717Z","updated_at":"2025-04-04T21:07:00.976Z","avatar_url":"https://github.com/kreativekorp.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# barcode.php\n\n### Generate barcodes from a single PHP file. MIT license.\n\n  * Output to PNG, GIF, JPEG, or SVG.\n  * Generates UPC-A, UPC-E, EAN-13, EAN-8, Code 39, Code 93, Code 128, Codabar, ITF, QR Code, and Data Matrix.\n\n### Use directly as a PHP script with GET or POST:\n\n```\nbarcode.php?f={format}\u0026s={symbology}\u0026d={data}\u0026{options}\n```\n\ne.g.\n\n```\nbarcode.php?f=png\u0026s=upc-e\u0026d=06543217\nbarcode.php?f=svg\u0026s=qr\u0026d=HELLO%20WORLD\u0026sf=8\u0026ms=r\u0026md=0.8\n```\n\n**When using this method, you must escape non-alphanumeric characters with URL encoding, for example `%26` for `\u0026` or `%2F` for `?`.**\n\n### Or use as a library from another PHP script:\n\n```\ninclude 'barcode.php';\n\n$generator = new barcode_generator();\n\n/* Output directly to standard output. */\nheader(\"Content-Type: image/$format\");\n$generator-\u003eoutput_image($format, $symbology, $data, $options);\n\n/* Create bitmap image and write to standard output. */\nheader('Content-Type: image/png');\n$image = $generator-\u003erender_image($symbology, $data, $options);\nimagepng($image);\nimagedestroy($image);\n\n/* Create bitmap image and write to file. */\n$image = $generator-\u003erender_image($symbology, $data, $options);\nimagepng($image, $filename);\nimagedestroy($image);\n\n/* Generate SVG markup and write to standard output. */\nheader('Content-Type: image/svg+xml');\n$svg = $generator-\u003erender_svg($symbology, $data, $options);\necho $svg;\n\n/* Generate SVG markup and write to file. */\n$svg = $generator-\u003erender_svg($symbology, $data, $options);\nfile_put_contents($filename, $svg);\n```\n\n**When using this method, you must NOT use URL encoding.**\n\n### Options:\n\n`f` - Format. One of:\n```\n    png\n    gif\n    jpeg\n    svg\n```\n\n`s` - Symbology (type of barcode). One of:\n```\n    upc-a          code-39         qr     dmtx\n    upc-e          code-39-ascii   qr-l   dmtx-s\n    ean-8          code-93         qr-m   dmtx-r\n    ean-13         code-93-ascii   qr-q   gs1-dmtx\n    ean-13-pad     code-128        qr-h   gs1-dmtx-s\n    ean-13-nopad   codabar                gs1-dmtx-r\n    ean-128        itf\n```\n\n`d` - Data. For UPC or EAN, use `*` for missing digit. For Codabar, use `ABCD` or `ENT*` for start and stop characters. For QR, encode in Shift-JIS for kanji mode.\n\n`w` - Width of image. Overrides `sf` or `sx`.\n\n`h` - Height of image. Overrides `sf` or `sy`.\n\n`sf` - Scale factor. Default is 1 for linear barcodes or 4 for matrix barcodes.\n\n`sx` - Horizontal scale factor. Overrides `sf`.\n\n`sy` - Vertical scale factor. Overrides `sf`.\n\n`p` - Padding. Default is 10 for linear barcodes or 0 for matrix barcodes.\n\n`pv` - Top and bottom padding. Default is value of `p`.\n\n`ph` - Left and right padding. Default is value of `p`.\n\n`pt` - Top padding. Default is value of `pv`.\n\n`pl` - Left padding. Default is value of `ph`.\n\n`pr` - Right padding. Default is value of `ph`.\n\n`pb` - Bottom padding. Default is value of `pv`.\n\n`bc` - Background color in `#RRGGBB` format.\n\n`cs` - Color of spaces in `#RRGGBB` format.\n\n`cm` - Color of modules in `#RRGGBB` format.\n\n`tc` - Text color in `#RRGGBB` format. Applies to linear barcodes only.\n\n`tf` - Text font for SVG output. Default is monospace. Applies to linear barcodes only.\n\n`ts` - Text size. For SVG output, this is in points and the default is 10. For PNG, GIF, or JPEG output, this is the GD library built-in font number from 1 to 5 and the default is 1. Applies to linear barcodes only.\n\n`th` - Distance from text baseline to bottom of modules. Default is 10. Applies to linear barcodes only.\n\n`ms` - Module shape. One of: `s` for square, `r` for round, or `x` for X-shaped. Default is `s`. Applies to matrix barcodes only.\n\n`md` - Module density. A number between 0 and 1. Default is 1. Applies to matrix barcodes only.\n\n`wq` - Width of quiet area units. Default is 1. Use 0 to suppress quiet area.\n\n`wm` - Width of narrow modules and spaces. Default is 1.\n\n`ww` - Width of wide modules and spaces. Applies to Code 39, Codabar, and ITF only. Default is 3.\n\n`wn` - Width of narrow space between characters. Applies to Code 39 and Codabar only. Default is 1.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkreativekorp%2Fbarcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkreativekorp%2Fbarcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkreativekorp%2Fbarcode/lists"}