Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
85.71% |
6 / 7 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| MediaScreenParams | |
85.71% |
6 / 7 |
|
0.00% |
0 / 1 |
3.03 | |
0.00% |
0 / 1 |
| toPdf | |
85.71% |
6 / 7 |
|
0.00% |
0 / 1 |
3.03 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Pdf\Core\Multimedia; |
| 6 | |
| 7 | use Phpdftk\Pdf\Core\PdfDictionary; |
| 8 | use Phpdftk\Pdf\Core\PdfName; |
| 9 | use Phpdftk\Pdf\Core\PdfObject; |
| 10 | use Phpdftk\Pdf\Core\PdfVersion; |
| 11 | use Phpdftk\Pdf\Core\RequiresPdfVersion; |
| 12 | |
| 13 | /** |
| 14 | * Media screen parameters (/Type /MediaScreenParams) — ISO 32000-2 §13.2.5. |
| 15 | * |
| 16 | * Describes where the media plays (window geometry, monitor, background). |
| 17 | */ |
| 18 | #[RequiresPdfVersion(PdfVersion::V1_5)] |
| 19 | class MediaScreenParams extends PdfObject |
| 20 | { |
| 21 | public const PDF_TYPE = 'MediaScreenParams'; |
| 22 | |
| 23 | public ?PdfDictionary $mh = null; // /MH |
| 24 | public ?PdfDictionary $be = null; // /BE |
| 25 | |
| 26 | public function toPdf(): string |
| 27 | { |
| 28 | $dict = new PdfDictionary(); |
| 29 | $dict->set('Type', new PdfName(self::PDF_TYPE)); |
| 30 | if ($this->mh !== null) { |
| 31 | $dict->set('MH', $this->mh); |
| 32 | } |
| 33 | if ($this->be !== null) { |
| 34 | $dict->set('BE', $this->be); |
| 35 | } |
| 36 | return $dict->toPdf(); |
| 37 | } |
| 38 | } |