I am trying to edit the template of packing slip pdf print file.
Basically the part that I am interested is the height of product description area.
I traced back the parts that create font size or box height, but I am not sure how I should edit it. Obviously I am not looking for editing them on Magento core and I am trying to edit the parts in a custom module.
for example on this line the $this->y
& $this->y - 15
are the rectangle height for the pdf print out in products
area.
I tried to create an Invoice.php
file in my custom module under
MY_MODULE\Model\Order\Pdf
and copy/paste the content of git repo file there and did the edit, but it did't work. I know how to change the xml layouts but technically I am not sure how I should edit this type of files.
Anyone can help?
Best Answer
It is possible yo change the layout of pdfslip by using Model file. edit, create a di.xml file under
MY\MODULE\etc\adminhtml\
and edit it as followedAfter that create a Invoice.php file under
MY\MODULE\Model\Order\Pdf
and change it like thisAs it is editing a protected function
__DrawHeader
you should changes its name, like_doDrawHeader
. Also you should edit its name in the calling method$this->_doDrawHeader($page);
inpublic function getPdf