I have a question. I have a url for Phantomjs which generates a PDF. But I want to generate the PDF on Serverside.
<script> $("#generatePDF").click(function(){
var fullLink = "<? echo $link ?>"
$.ajax({
type: "POST",
url: "/php/ajax/generatepdf.php?",
data: {link : fullLink}
}).done( function(data){
window.open(data);
} );
}); </script>
This is where I send the data to the generatepdf.php
The link generates a PDF with Phantom.JS
Now I do the following in the generatepdf.php
$link = $_POST['link'];
CurlConnect = curl_init();
curl_setopt($CurlConnect, CURLOPT_URL, $link);
curl_setopt($CurlConnect, CURLOPT_POST, 1);
curl_setopt($CurlConnect, CURLOPT_RETURNTRANSFER, 0 );
$Result = curl_exec($CurlConnect);
echo $Result;
My question: How can I open a PDF in a new tab with the stuff from the phantom.js result?
I hope you understand my question.
Best Regards.
generatepdf.phpto generate PDF ???