xmatox Posted March 16, 2015 Share Posted March 16, 2015 Bonjour, J'ai un module où dedans je crée un PDF pour générer le PDF je me suis aidé du tuto là : http://blog.belvg.com/pdf-in-prestashop.html et tout marche très bien, mon seul problème c'est que je n'arrive pas à trouver comment modifier la taille du header et du footer ... merci de votre aide ! Link to comment Share on other sites More sharing options...
tuk66 Posted March 16, 2015 Share Posted March 16, 2015 $this->setMargins() dans la writePage method dans /classes/pdf/PDFGenerator.php Link to comment Share on other sites More sharing options...
xmatox Posted March 16, 2015 Author Share Posted March 16, 2015 j'avais vu ça, mais à partir de mon module c'est possible ? merci ! Link to comment Share on other sites More sharing options...
tuk66 Posted March 16, 2015 Share Posted March 16, 2015 De vous module? Quelle est votre module? From you module? What is your module? Link to comment Share on other sites More sharing options...
xmatox Posted March 16, 2015 Author Share Posted March 16, 2015 Le PDF est généré à partir d'un module que je suis en train de créer Link to comment Share on other sites More sharing options...
tuk66 Posted March 16, 2015 Share Posted March 16, 2015 Et alors? Nous ne savons pas votre module. So what? We don't know your module. Link to comment Share on other sites More sharing options...
xmatox Posted March 16, 2015 Author Share Posted March 16, 2015 et donc je souhaiterai pouvoir modifier la taille du header et du footer du PDF que je génère à partir de mon module J'ai essayé de d'utiliser $this->setMargins() dans ma class HTMLTemplateCustomPdf qui génère mon PDF mais ça ne marche pas merci I can try in english If you prefer : my problem is to change footer's and header's height of my PDF that I create from a personal module i have create my PDF with this method : http://blog.belvg.com/pdf-in-prestashop.html but i can't find how to change the footer's or header's height I have try to use $this->setMargins() in my class HTMLTemplateCustomPdf, but it doesn't work thanks Link to comment Share on other sites More sharing options...
tuk66 Posted March 16, 2015 Share Posted March 16, 2015 I think that page is not about a new module. It just replaces HTMLTemplate class and calls PDF class to create the document. I wrote about PDFGenerator class, and it looks like this class is untouched in that code. Link to comment Share on other sites More sharing options...
xmatox Posted March 16, 2015 Author Share Posted March 16, 2015 so, what i must to do for modify the height of header and footer from my module ? Link to comment Share on other sites More sharing options...
xmatox Posted March 17, 2015 Author Share Posted March 17, 2015 J'ai enfin compris comment il faut faire ... il faut tout simplement faire un override de la classe PDFGenerator Il faut donc créer PDFGenerator.php dans monmodule/override/classes/pdf/ <?php class PDFGenerator extends PDFGeneratorCore { /** * Write a PDF page */ public function writePage() { $this->SetHeaderMargin(5); $this->SetFooterMargin(30); $this->setMargins(10, 40, 10); $this->SetAutoPageBreak(true, 35); $this->AddPage(); $this->writeHTML($this->content, true, false, true, false, ''); } } et voilà ! à l'installation du module, il fait une copie du fichier dans override/classes/pdf/ et du coup ça marche Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now