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