Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| PrinterMarkAnnotation | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| getSubtype | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toPdf | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Pdf\Core\Annotation; |
| 6 | |
| 7 | use Phpdftk\Pdf\Core\PdfName; |
| 8 | use Phpdftk\Pdf\Core\PdfVersion; |
| 9 | use Phpdftk\Pdf\Core\RequiresPdfVersion; |
| 10 | |
| 11 | /** |
| 12 | * PrinterMark annotation (/Subtype /PrinterMark). |
| 13 | */ |
| 14 | #[RequiresPdfVersion(PdfVersion::V1_3)] |
| 15 | class PrinterMarkAnnotation extends Annotation |
| 16 | { |
| 17 | public ?PdfName $mn = null; // /MN - mark name |
| 18 | |
| 19 | public function getSubtype(): string |
| 20 | { |
| 21 | return 'PrinterMark'; |
| 22 | } |
| 23 | |
| 24 | public function toPdf(): string |
| 25 | { |
| 26 | $dict = $this->buildDictionary(); |
| 27 | |
| 28 | if ($this->mn !== null) { |
| 29 | $dict->set('MN', $this->mn); |
| 30 | } |
| 31 | |
| 32 | return $dict->toPdf(); |
| 33 | } |
| 34 | } |