pdfPath = $path; $this->fileName = $fileName ?? basename($path); } /** * Set a PDF from content (base64, binary, etc.) */ public function setPdfFromContent(string $content, ?string $fileName = null): void { $this->pdfContent = $content; $this->fileName = $fileName ?? 'invoice.pdf'; } /** * Set a DomPDF instance */ public function setPdf($pdf): void { $this->pdf = $pdf; } /** * Check if any PDF was provided */ public function hasPdf(): bool { return $this->pdf !== null || $this->pdfPath !== null || $this->pdfContent !== null; } }