2
I am mounting a PDF and in this PDF I have to put a graphic that is being made by Highcharts
. I created an HTML and JS code by mounting the graph and it is creating it right, the problem is that I need to get the HTML code of this rendered graph and when I request the link of the page that mounts the graph, it brings the unprocessed HTML, that is, without having run the JS to mount the chart.
<?php
public function SendRequest($url){
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
$query = curl_exec($curl_handle);
curl_close($curl_handle);
return $query;
}
public function cria_grafico($id_pedido, $id_produto){
echo $this->load->view('sellins/GeraGraficoSellinB4', array('id_pedido'=>$id_pedido, 'id_produto'=>$id_produto), TRUE);
}
public function download($codigo_pedido = false){
$grafico = $this->SendRequest(base_url('Sellin_B4/cria_grafico/'.$produto['idPedido'].'/'.$produto['codigoProduto']));
$file = 'uploads/extract_sellin_goagro_'.time().'.pdf';
$mpdf = new mPDF();
$mpdf->SetHeader('Go Agro - Extract Sellin');
$mpdf->writeHTML($grafico);
$mpdf->SetFooter('{PAGENO}');
$mpdf->Output($file, 'F');
}
In the method graphic is where he calls HTML with JS and mounts the graph. If I access the link meusite.com.br/cria_grafico it shows the rendered graph, but when I make a request to get the same result via code, it brings the HTML without being rendered.