How Can I Save Pdf File To Disk Using Tcpdf

I’m using this code to create pdf file.But it outputs the file to browser.How can I save it to disk in server?

pdf = Yii::createComponent('application.extensions.tcpdf.ETcPdf',

                'P', 'cm', 'A4', true, 'UTF-8');










            $pdf->SetFont("times", "", 10);

            $pdf->writeHTML($body, true, false, false, false, '');

           $pdf->Output("test.pdf", "D");

Change your last line to this.

$pdf->Output('test.pdf', 'F');

Thank you so much…worked for me :)