Jump to content

[solved]cannot override pdf class


Recommended Posts

Hi,

 

We have exactly the same problem, overriding pdf controller works perfectly on 1.5.2, 1.5.3.1, etc.. but not on 1.5.3.0.

 

We can't find any issue for the moment... if someone has a solution,he's welcome :)

 

P.S: and no change log about it between 1.5.3 and 1.5.3.1 so i really don't have any hint

Edited by IllicoPresta (see edit history)
Link to comment
Share on other sites

  • 2 years later...

Hello guys  :) 

Why am i not able to override PDFGenerator.php file?

 

Under "Override/classes/pdf/" i have created the same file, which is PDFGenerator.php. Within that file i have put code below, because i want to define different header and footer height. The problem is, that override doesn't work at all, even if i disable cache and delete class_index.php file within cache directory. What am i doing wrong? Is there maybe a bug or something?

<?php

class PDFGeneratorCoreOverride extends PDFGeneratorCore {

	/* Header and Footer HEIGHT change */
	public function writePage() {
		
		$this->SetHeaderMargin(10);
		$this->SetFooterMargin(30);
		$this->setMargins(10, 40, 10);

		$this->AddPage();

		$this->writeHTML($this->content, true, false, true, false, '');
	}
	
}

I am using Prestashop version 1.6.0.14.

 

If i change code directly, it affects PDF, when it is exported. It works as it should but no results, when overriding PDFGenerator.php file. Overriding works good for modules as well.

Could you guys take a look and help me here please?

Thank you and best regards,
Housy

Link to comment
Share on other sites

×
×
  • Create New...