forked from davidscotttufts/php-barcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbarcode.php
More file actions
31 lines (25 loc) · 879 Bytes
/
barcode.php
File metadata and controls
31 lines (25 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/*
* Author: David S. Tufts
* Company: Rocketwood.LLC
* www.rocketwood.com
* Date: 05/25/2003
* Usage:
* <img src="/barcode.php?text=testing" alt="testing" />
*
* Modified by: Artur Gołdyn
* Company: RichApps Artur Gołdyn
* www.richapps.pl
* Date: 01.03.2016
*/
require_once("PhpBarcode.php");
// Get pararameters that are passed in through $_GET or set to the default value
$text = (isset($_GET["text"])?$_GET["text"]:"0");
$size = (isset($_GET["size"])?$_GET["size"]:"20");
$orientation = (isset($_GET["orientation"])?$_GET["orientation"]:"horizontal");
$code_type = (isset($_GET["codetype"])?$_GET["codetype"]:"code128");
$image = PhpBarcode::GenerateBarcode($code_type, $text, $orientation, $size);
PhpBarcode::DrawBarcodeToScreen($image);
//$pngData = PhpBarcode::GetPngData($image);
//header('Content-type: image/png');
//echo $pngData;