The postscript code for producing the barcode images is located in the file pst-barcode.pro
which is found in your TEXMF tree in /dvips/pst-barcode
. You can copy this file to the directory of your document and then the pst-barcode
package will load the local file instead of the system file.
Modify the following lines in the ean13
encoder (starting at line 1165 in my version of pst-barcode
):
includetext {
/bhs [height height 12{height .075 sub}repeat height height 12{height .075 sub}repeat height height] def
/bbs [0 0 12{.075}repeat 0 0 12{.075}repeat 0 0] def
}
into the following:
includetext {
/bhs [2{height 0.1 add}repeat 12{height .075 sub}repeat 2{height 0.1 add}repeat 12{height .075 sub}repeat 2{height 0.1 add}repeat] def
/bbs [-0.1 -0.1 12{.075}repeat -0.1 -0.1 12{.075}repeat -0.1 -0.1] def
}
Make sure you modify the right lines, there are a lot of similar lines for other encoders but this is the one for ean13
which is used by the isbn
encoder.
Explanation (note this may be wrong, I don't know Postscript at all): the bhs
line controls the length of the bars. It starts with two bars of length height
, then twelve bars of length height-0.075
, then two normal bars, etc. The second line controls the baseline of the lines, which is 0 for the first two, 0.075 for the next twelve, etc. So all you need to do is increase the length of the long bars (with the 0.1 add
instruction) and lower the baseline (to -0.1 in the example).
Result:

It might be possible to patch the code on the fly (similar to etoolbox
/xpatch
) instead of copying and modifying the file, but I don't know how to do that.