-
-
Notifications
You must be signed in to change notification settings - Fork 72
Resizing Symbols
Terry Burton edited this page May 22, 2025
·
9 revisions
To create a barcode of some required width and height (without stretching the text) perform the following steps, in order.
Starting with this example:
0 0 moveto (9520123456788) (includetext)
/ean13 /uk.co.terryburton.bwipp findresource exec
Find the uniform (same x and y) scale factor that makes your output of the required width:
gsave
2 2 scale % <-- Add a line like this
0 0 moveto (9520123456788) (includetext)
/ean13 /uk.co.terryburton.bwipp findresource exec
grestore
Add a height option that adjusts the bar height appropriately (taking the scaling into account):
gsave
2 2 scale
% Added height=0.8 option to adjust height
0 0 moveto (9520123456788) (includetext height=0.8)
/ean13 /uk.co.terryburton.bwipp findresource exec
grestore
The result should now be of the intended dimensions with properly scaled (not stretched) text.
BWIPP generates linear symbols with an X-dimension of 1pt and default height of 1in.
Using the above scheme, to create a linear barcode having an X-dimension of X mm and height of H mm:
scale = (72 * X) / 25.4
height = H / (72 * X)
Home | Download | Documentation (PDF) | Source | Support | Issues | Online Barcode Generator