You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,8 @@ Each renderer has their own options. Only the barcode is required, the rest is o
67
67
A vector based SVG image. Gives the best quality to print.
68
68
```php
69
69
$renderer = new Picqer\Barcode\Renderers\SvgRenderer();
70
-
$renderer->setForegroundColor('red'); // Give a color for the bars, the background is always white
70
+
$renderer->setForegroundColor('red'); // Give a color for the bars, default is black
71
+
$renderer->setBackgroundColor('blue'); // Give a color for the background, default is transparent
71
72
$renderer->setSvgType($renderer::TYPE_SVG_INLINE); // Changes the output to be used inline inside HTML documents, instead of a standalone SVG image (default)
72
73
$renderer->setSvgType($renderer::TYPE_SVG_STANDALONE); // If you want to force the default, create a stand alone SVG image
73
74
@@ -78,7 +79,8 @@ $renderer->render($barcode, 450.20, 75); // Width and height support floats
78
79
All options for PNG and JPG are the same.
79
80
```php
80
81
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
81
-
$renderer->setForegroundColor([255, 0, 0]); // Give a color for the bars, the background is always white. Give it as 3 times 0-255 values for red, green and blue.
82
+
$renderer->setForegroundColor([255, 0, 0]); // Give a color for the bars, default is black. Give it as 3 times 0-255 values for red, green and blue.
83
+
$renderer->setBackgroundColor([0, 255, 255]); // Give a color for the background, default is transparent (in PNG) or white (in JPG). Give it as 3 times 0-255 values for red, green and blue.
82
84
$renderer->useGd(); // If you have Imagick and GD installed, but want to use GD
83
85
$renderer->useImagick(); // If you have Imagick and GD installed, but want to use Imagick
84
86
@@ -89,7 +91,8 @@ $renderer->render($barcode, 5, 40); // Width factor (how many pixel wide every b
89
91
Gives HTML to use inline in a full HTML document.
90
92
```php
91
93
$renderer = new Picqer\Barcode\Renderers\HtmlRenderer();
92
-
$renderer->setForegroundColor('red'); // Give a color for the bars, the background is always white
94
+
$renderer->setForegroundColor('red'); // Give a color for the bars, default is black
95
+
$renderer->setBackgroundColor('blue'); // Give a color for the background, default is transparent
93
96
94
97
$renderer->render($barcode, 450.20, 75); // Width and height support floats
95
98
````
@@ -98,7 +101,8 @@ $renderer->render($barcode, 450.20, 75); // Width and height support floats
98
101
Give HTML here the barcode is using the full width and height, to put inside a container/div that has a fixed size.
99
102
```php
100
103
$renderer = new Picqer\Barcode\Renderers\DynamicHtmlRenderer();
101
-
$renderer->setForegroundColor('red'); // Give a color for the bars, the background is always white
104
+
$renderer->setForegroundColor('red'); // Give a color for the bars, default is black
105
+
$renderer->setBackgroundColor('blue'); // Give a color for the background, default is transparent
0 commit comments