我一直试图用fpdf获取pdf文件名,但是没有用。这是我的代码:
use Dompdf\Dompdf;
if (logged_in() === true) {
if (isset($_POST['do'],$_POST['create_resume'])) {
$file = addslashes($_POST['create_resume']);
require('fpdf/fpdf.php');
setlocale(LC_CTYPE, 'en_US');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$file = iconv('UTF-8', 'ASCII//TRANSLIT', $file);
$pdf->Cell(0, 0, $file);
//$pdf->Cell(40,10,$_POST['create_resume']);
$name = $pdf->Output('file.pdf','S');
$name = pathinfo($name,PATHINFO_FILENAME);
// $name = $name['filename'];
//$name = basename($name);
echo $name;