barnhill / barcode-java

Java Barcode Image Generation Library
MIT License
25 stars 14 forks source link

allow for customizable margin (feature request) #11

Open teicher opened 3 years ago

teicher commented 3 years ago

when the barcode is embedded on some background, the scanner gun will need some "peace space" (white border) in order to recognize the barcode regardless of the background. this should be an option to have. could look like

b.setMargin(10)

or even

b.setMargin(10,10,10,15)
barnhill commented 2 years ago

Would you envision this to work like Android applications and margin be applied outside the specified bounds for drawing and then padding be internal?

teicher commented 2 years ago

Any way would be fine as long as the behaviour is deterministic and documented ;-)

If the margin increases the overall image size, it could also be called setAdditionalMargin(...)

barnhill commented 5 months ago

Wanna put a PR together for this?