PDF response class.
class PDF extends \Hazaar\Controller\Response\HTTP\OKExtends: Hazaar\Controller\Response\HTTP\OK
This response wraps a PDF file object and emits it as an HTTP response with PDF-specific headers. It supports both inline rendering and forced download mode, including compatibility headers for user agents handling binary file transfers.
Properties
pdfFile
Backing PDF file instance used as response content source.
private PDFFile $pdfFileType: Hazaar\File\PDF
downloadable
Indicates whether the response should force a file download.
private bool $downloadableType: bool
When true, download-oriented headers are set in Hazaar\Controller\Response\PDF::writeOutput.
Methods
__construct
Constructor: initialize command line and reserve temporary file.
public __construct(PDFFile|string $file, bool $downloadable): voidParameters
| Parameter | Type | Description |
|---|---|---|
$file | Hazaar\File\PDF | string |
$downloadable | bool |
__call
public __call(string $method, array $args): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$method | string | |
$args | array |
writeOutput
Write the PDF response output with appropriate HTTP headers.
public writeOutput(): voidReturns: void
Sets the content type to application/pdf and applies either attachment or inline Content-Disposition depending on the downloadable flag, followed by delegated output via the parent response implementation.
getContent
Get raw PDF binary content for the response body.
public getContent(): stringReturns: string
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000