PDF response class.
class PDF extends \Hazaar\Controller\Response\OKThis 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 $pdfFiledownloadable
Indicates whether the response should force a file download.
private bool $downloadableWhen true, download-oriented headers are set in {@see writeOutput()}.
Methods
__construct
Constructor: initialize command line and reserve temporary file.
public __construct(string $file, bool $downloadable): voidParameters
| Parameter | Type | Description |
|---|---|---|
$file | string | |
$downloadable | bool |
__call
public __call(string $method, array $args): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$method | string | |
$args | array |
writeOutput
Write the PDF response output with appropriate HTTP headers.
public writeOutput(): voidSets 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(): stringGenerated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000