greyfinality Posted July 13, 2015 Share Posted July 13, 2015 Hi everyone, I'm a new prestashop developer, and after a lot of looking around the forums and googling I can't seem to find any resources on how to generate a pdf other from a template within the module. When I try to simply generate the pdf by putting the direct link in the template field, I don't generate anything. Can anyone tell me what I need to fix so I can get a pdf that says "hello world" to generate from this process? public function processGeneratePdf(){ if(Tools::isSubmit("id_order")) $order=new Order(Tools::getValue("id_order")); if(!Validate::isLoadedObject($order)) $this->errors[] = Tools::displayError('Order not found in DB'); $helloTemplate=_PS_MODULE_DIR_.'module/pdf/helloWorld.tpl'; $pdf=new PDF($order,$helloTemplate,$this->context->smarty); $pdf->render(); } When I do the same thing with, PDF::TEMPLATE_INVOICE, it works fine, but I want to be able to generate my own PDF forms manually. What am I missing? Link to comment Share on other sites More sharing options...
Besens Posted June 20, 2016 Share Posted June 20, 2016 Hello Did you have the answers to this problem about PDF generation from a module? How did you solved? Thx 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