Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add background and margin on generated barcode #201

Closed
osflake opened this issue May 23, 2024 · 3 comments
Closed

Add background and margin on generated barcode #201

osflake opened this issue May 23, 2024 · 3 comments

Comments

@osflake
Copy link

osflake commented May 23, 2024

Hello Mr @casperbakker,

I have one suggestions, because when I used Your library (very very thanks for that) we found a very big problem in our 1D scanner.

When we present barcode in dark mode (night mode) web browser change background to dark and outer lines are not readable.
image

It is possible to add param like:

$generator->setMargin(10);

$generator = new Picqer\Barcode\BarcodeGeneratorJPG();
$generator->useGd();
$generator->setMargin(10);
$result = $generator->getBarcode($inputValue, $generator::TYPE_CODE_128, 4, 120, $color = array(0, 0, 0));    
header('Content-Type: image/png');
echo $result;

or

$setMargin = 10;
$result = $generator->getBarcode($inputValue, $generator::TYPE_CODE_128, 4, 120, $color = array(0, 0, 0),$setMargin); 

Its very important issue.

Thank You

@casperbakker
Copy link
Member

Maybe we will add something after version 3 is launched (see #198), but that will take some time.

In the mean time you can show some white border around the image with HTML/CSS, same way you show the red numbers on top.

@osflake
Copy link
Author

osflake commented May 24, 2024

Hi

I added in HTML/css but web browser removed this

@casperbakker
Copy link
Member

If you added a background, that is usually ignored when printing. But a white "border" should work while printing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants