PrestaShop margin size on delivery slips

Recently one of my clients contacted me asking if I could make a change. The task was to shrink huge margins on PDF delivery slips. The mission wasn’t easy because the settings were hidden in the files. You can change font size and amend or remove elements from the printout by modifying templates. Unfortunately, you can’t decrease the margin on PDF printouts.

All templates are located in folder PDF in the root directory of your deployment. You can modify multiple files to achieve the 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.