Closed luongit closed 4 years ago
public function actionPdf(){
$pdf = new Pdf([
'mode' => Pdf::MODE_UTF8,
'format' => Pdf::FORMAT_A4,
'orientation' => Pdf::ORIENT_PORTRAIT,
'destination' => Pdf::DEST_DOWNLOAD, //DEST_FILE, DEST_BROWSER, DEST_DOWNLOAD
'filename' => 'This is the filename',
'content' => $content,
'marginLeft' =>15,
'marginRight' =>15,
'marginTop' =>15,
'marginBottom' =>15,
'marginHeader' =>5,
'marginFooter' =>10,
'options' => ['title' => 'This is the title'],
'methods' => [
'SetHeader' => ['||On: ' . date("r")],
'SetFooter'=>['{PAGENO}'],
]
]);
return $pdf->render();
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I want to automatically download the file instead of displaying it in a browser Please help me Thanks you !