Sending pdf to screen from controller [SOLVED]


I am trying to show a pdf on the screen from a controller. I’ve tried everything I can think of, even using fpdf but I get a blank pdf. I have no problem downloading the pdf like this

 $response  = $response->withHeader('Content- Description', File_Transfer')
    ->withHeader('Content-Type', 'application/octet-stream')

Is there a way to use with header to display a pdf?


For anyone wondering it was simple I just did this,

$response = ->withHeader(‘Content-Type’, ‘application/pdf’)
->withHeader(‘Content-Disposition’ 'inline;filename=" ’ . basename($file) . ’ ");