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