質問

I am facing a very frustrating problem. I am generating a pdf file with html2pdf and it shows up properly in a popup screen with pdf plugin. When I try to save the file, it is not taking the filename that I have allocated it. It is instead taking the name of the page used to generate the file.

    $html2pdf = new HTML2PDF('P', 'A4', 'en', false, 'ISO-8859-15', array(6,6,6,6));
    $html2pdf->setDefaultFont('Arial');
    $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
    $html2pdf->Output($filename.'.pdf');

Your help is much appreciated.

Thanks and regards,

Babu

役に立ちましたか?

解決

What html2pdf version? Try $html2pdf->Output($filename.'.pdf', 'D'); to force the download and check the name. Perhaps you could add error_reporting(-1); at the top of the script to check eventual warning.

他のヒント

Working OK with the filename proposal when using "D" for download. Unfortunately, when using "O" for open, it doesn't suggest using the variable name when saving afterwards, but just proposes the filename.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top