if ($pdf_debug == 1)
{
- $pdfcode = $this->Output();
+ $pdfcode = $this->Output('','S');
$pdfcode = str_replace("\n", "\n<br>", htmlspecialchars($pdfcode));
echo '<html><body>';
echo trim($pdfcode);
else
{
- $buf = $this->Output();
- $len = strlen($buf);
$dir = $comp_path.'/'.user_company(). '/pdf_files';
//save the file
if (!file_exists($dir))
}
// do not use standard filenames or your sensitive company data
// are world readable
- $fname = tempnam($dir, 'FA');
- rename($fname, $fname.'.pdf');
- $fname .= '.pdf';
- $fp = fopen($fname,'w');
- fwrite($fp,$buf);
- fclose($fp);
+ $fname = $dir.'/'.uniqid('').'.pdf';
+ $this->Output($fname, 'F');
if ($email == 1)
{
$emailtype = true;