barcode icon indicating copy to clipboard operation
barcode copied to clipboard

Margins problem 2.1.0

Open CSCARBON opened this issue 7 years ago • 2 comments

Hi,

I have a QRcode Left and Right margins problem.

CSCARBON avatar Dec 06 '17 06:12 CSCARBON

Hi, if you mean that there is no effect on changing top, bottom, left and fight margins, I guess I found some solution for this problem. For some reason there is no passing of margins values, so they are used with default values (30, 30, 30, 30). To fix it, you can:

  1. open file <your_glpi_folder>/plugins/barcode/inc/barcode.class.php (even for QRcode margins)
  2. find there strings smth like
    $width = $config['maxCodeWidth']; $height = $config['maxCodeHeight']; $marginH = $config['marginHorizontal']; $marginV = $config['marginVertical']; they are somewhere at 307-310 strings
  3. insert after them code $pdf->ezSetMargins($config['marginTop'], $config['marginBottom'], $config['marginLeft'], $config['marginRight'] );

et voilà

bthw, if you want set that margins in cm, just insert $pdf->ezSetCmMargins($config['marginTop'], $config['marginBottom'], $config['marginLeft'], $config['marginRight'] ); but beware, cm are more large, so if you get blank sheet, decrease your values

DenSardonic avatar Mar 14 '20 12:03 DenSardonic

Thank you DenSardonic, it works for me.

dajean0104 avatar Jan 29 '21 15:01 dajean0104