<?php
$pdf = "this is actually a binary PDF in PHP variable."
header('Content-Description: Statement');
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename=Statement.pdf');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
return $pdf;
This question has been answered by Jako. See the first response.
return $pdf;
echo $pdf; exit;
$pdf = file_get_contents(MODX_BASE_PATH.'whatever.pdf');
Change
return $pdf;
into
echo $pdf; exit;