-
Notifications
You must be signed in to change notification settings - Fork 305
BWIPP border vs bwipjs padding
There are two ways to specify padding/margins around the images produced by bwipjs. There are the native BWIPP options borderleft
, borderright
, bordertop
, and borderbottom
. These values are specified in points/pixels, and scale
accordingly. There is also the bwipjs-specific options paddingwidth
and paddingheight
. paddingwidth
sets the left and right padding to the same value. paddingheight
sets the top and bottom padding to the same value. The values are specified in points/pixels and scale accordingly.
The BWIPP border options provide padding solely around the bar code symbol; the text is not part of the border calculation. If any text falls outside the border area, bwipjs will automatically expand the image so all text is included.
The bwipjs padding options add space after BWIPP is done rendering the image:
And the BWIPP and bwipjs options are additive:
Finally, the BWIPP border padding only applies to linear barcodes (the feature is only implemented in the relinear
renderer). The bwipjs padding options apply to all barcode types.