I use the PDF class to create invoice and other documents in my opencart system. Now I need some javascript in one of ".tpl" that can draw a chart.
The document is fine, because if I use this to open:
==================================================================
$this->response->setOutput($this->load->view('path/mytemplate.tpl', $data));
==================================================================
Then I get the document with the chart, so the javascript runs well.
BUT I need in PDF, so I have to use this line to open/save:
====================================================================================================
$this->response->setOutput($pdf->mypdf($this->load->view('path/mytemplate.tpl', $data), $data['product']['model']));
====================================================================================================
When I use this, I cant see my chart, so the javascript doesnt run

Is any idea, how can I put javascript in to my template and then save it to PDF?
Thank you