PrestaShop margin size on delivery slips

Recently one of my clients contacted me asking if I can make a change. Shrink a little bit huge margins on PDF delivery slips. The task wasn’t easy because settings is bit hidden in the files. By modifying templates you can change font size, and amend or remove elements from the printout. Unfortunately you can’t actually decrease margin on PDF printout.

All templates are located in folder PDF in root directory of your deployment. You can modify multiple files to achieve desired effect.

But what you are really looking for is file classes/pdf/PDFGenerator.php where you can find something like that:

$this->setMargins(10, 40, 10);

This functions set’s up margins in order LEFT, TOP… so if you reduce 40 -> 10 – it will shrink margins to desired height.