Let me describe the case:
I want to fill up a form in web then populate the forms data to a page then i need to download that page as PDF. I am using TCPDF.
TCPDF works in most of the time. But when there is a large html page need to convert into PDF it sometimes just give me the .php file for download. And after downloading the php file it show some special character inside the .php file.
In 80% time i get the PDF as accepted. But in 20% time i get the .php file. I google a lot about it but didn't find anything helpful.
My HTML page link is : http://app.ans4u.com/wp-content/themes/dctappv2/requre/pdf-creator/passport-form.php
You can see the plain html code in the source. In the page you will find a download button. If you click it 5times you will see 1 or 2 time its returning a php file to download.
To generate the PDF what i am using the code below:
require_once(dirname(__FILE__).'/html2pdf.class.php');
try
{
$html2pdf = new HTML2PDF($form_orientation, 'Letter', 'fr');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output('form-'.$form_no.'.pdf','D');
}
catch(HTML2PDF_exception $e) {
echo $e;
exit;
}
Am i missing something? Please help.