| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Endroid\QrCode\Writer\Result; |
| 6 |
|
| 7 |
use Endroid\QrCode\Matrix\MatrixInterface; |
| 8 |
|
| 9 |
final class PdfResult extends AbstractResult |
| 10 |
{ |
| 11 |
public function __construct( |
| 12 |
MatrixInterface $matrix, |
| 13 |
private readonly \FPDF $fpdf |
| 14 |
) { |
| 15 |
parent::__construct($matrix); |
| 16 |
} |
| 17 |
|
| 18 |
public function getPdf(): \FPDF |
| 19 |
{ |
| 20 |
return $this->fpdf; |
| 21 |
} |
| 22 |
|
| 23 |
public function getString(): string |
| 24 |
{ |
| 25 |
return $this->fpdf->Output('S'); |
| 26 |
} |
| 27 |
|
| 28 |
public function getMimeType(): string |
| 29 |
{ |
| 30 |
return 'application/pdf'; |
| 31 |
} |
| 32 |
} |