Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| GoTo3DViewAction | |
100.00% |
7 / 7 |
|
100.00% |
3 / 3 |
4 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getActionType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toPdf | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Pdf\Core\Action; |
| 6 | |
| 7 | use Phpdftk\Pdf\Core\PdfReference; |
| 8 | use Phpdftk\Pdf\Core\PdfVersion; |
| 9 | use Phpdftk\Pdf\Core\RequiresPdfVersion; |
| 10 | |
| 11 | /** |
| 12 | * Go-to-3D-view action (/S /GoTo3DView) — ISO 32000-2 §12.6.4.15. |
| 13 | * Selects a 3D view for a 3D annotation. |
| 14 | */ |
| 15 | #[RequiresPdfVersion(PdfVersion::V1_6)] |
| 16 | class GoTo3DViewAction extends Action |
| 17 | { |
| 18 | public PdfReference $ta; // /TA target annotation (required) |
| 19 | public mixed $v = null; // /V view specifier (name or dict) |
| 20 | |
| 21 | public function __construct(PdfReference $ta) |
| 22 | { |
| 23 | $this->ta = $ta; |
| 24 | } |
| 25 | |
| 26 | public function getActionType(): string |
| 27 | { |
| 28 | return 'GoTo3DView'; |
| 29 | } |
| 30 | |
| 31 | public function toPdf(): string |
| 32 | { |
| 33 | $dict = $this->baseDictionary(); |
| 34 | $dict->set('TA', $this->ta); |
| 35 | if ($this->v !== null) { |
| 36 | $dict->set('V', $this->v); |
| 37 | } |
| 38 | return $dict->toPdf(); |
| 39 | } |
| 40 | } |