Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * Pop PHP Framework (https://www.popphp.org/) |
| 4 | * |
| 5 | * @link https://github.com/popphp/popphp-framework |
| 6 | * @author Nick Sagona, III <dev@noladev.com> |
| 7 | * @copyright Copyright (c) 2009-2026 NOLA Interactive, LLC. |
| 8 | * @license https://www.popphp.org/license New BSD License |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | * @namespace |
| 13 | */ |
| 14 | namespace Pop\Pdf\Document; |
| 15 | |
| 16 | use Pop\Pdf\Document\Page\Annotation; |
| 17 | |
| 18 | /** |
| 19 | * Pdf page interface |
| 20 | * |
| 21 | * @category Pop |
| 22 | * @package Pop\Pdf |
| 23 | * @author Nick Sagona, III <dev@noladev.com> |
| 24 | * @copyright Copyright (c) 2009-2026 NOLA Interactive, LLC. |
| 25 | * @license https://www.popphp.org/license New BSD License |
| 26 | * @version 5.2.7 |
| 27 | */ |
| 28 | interface PageInterface |
| 29 | { |
| 30 | |
| 31 | /** |
| 32 | * Set the page width |
| 33 | * |
| 34 | * @param mixed $width |
| 35 | * @return PageInterface |
| 36 | */ |
| 37 | public function setWidth(mixed $width): PageInterface; |
| 38 | |
| 39 | /** |
| 40 | * Set the page height |
| 41 | * |
| 42 | * @param mixed $height |
| 43 | * @return PageInterface |
| 44 | */ |
| 45 | public function setHeight(mixed $height): PageInterface; |
| 46 | |
| 47 | /** |
| 48 | * Set the page index |
| 49 | * |
| 50 | * @param int $i |
| 51 | * @return PageInterface |
| 52 | */ |
| 53 | public function setIndex(int $i): PageInterface; |
| 54 | |
| 55 | /** |
| 56 | * Get the page width |
| 57 | * |
| 58 | * @return int |
| 59 | */ |
| 60 | public function getWidth(): int; |
| 61 | |
| 62 | /** |
| 63 | * Get the page height |
| 64 | * |
| 65 | * @return int |
| 66 | */ |
| 67 | public function getHeight(): int; |
| 68 | |
| 69 | /** |
| 70 | * Get the page index |
| 71 | * |
| 72 | * @return ?int |
| 73 | */ |
| 74 | public function getIndex(): ?int; |
| 75 | |
| 76 | /** |
| 77 | * Add an image to the PDF page |
| 78 | * |
| 79 | * @param Page\Image $image |
| 80 | * @param int $x |
| 81 | * @param int $y |
| 82 | * @return PageInterface |
| 83 | */ |
| 84 | public function addImage(Page\Image $image, int $x = 0, int $y = 0): PageInterface; |
| 85 | |
| 86 | /** |
| 87 | * Add text to the PDF page |
| 88 | * |
| 89 | * @param Page\Text $text |
| 90 | * @param string $fontStyle (can be either a reference to a font or a style) |
| 91 | * @param int $x |
| 92 | * @param int $y |
| 93 | * @return PageInterface |
| 94 | */ |
| 95 | public function addText(Page\Text $text, string $fontStyle, int $x = 0, int $y = 0): PageInterface; |
| 96 | |
| 97 | /** |
| 98 | * Add an annotation to the PDF page |
| 99 | * |
| 100 | * @param Annotation\AbstractAnnotation $annotation |
| 101 | * @param int $x |
| 102 | * @param int $y |
| 103 | * @return PageInterface |
| 104 | */ |
| 105 | public function addAnnotation(Annotation\AbstractAnnotation $annotation, int $x = 0, int $y = 0): PageInterface; |
| 106 | |
| 107 | /** |
| 108 | * Add a URL annotation to the PDF page |
| 109 | * |
| 110 | * @param Annotation\Url $url |
| 111 | * @param int $x |
| 112 | * @param int $y |
| 113 | * @return PageInterface |
| 114 | */ |
| 115 | public function addUrl(Annotation\Url $url, int $x = 0, int $y = 0): PageInterface; |
| 116 | |
| 117 | /** |
| 118 | * Add a link annotation to the PDF page |
| 119 | * |
| 120 | * @param Annotation\Link $link |
| 121 | * @param int $x |
| 122 | * @param int $y |
| 123 | * @return PageInterface |
| 124 | */ |
| 125 | public function addLink(Annotation\Link $link, int $x = 0, int $y = 0): PageInterface; |
| 126 | |
| 127 | /** |
| 128 | * Add a path to the Pdf page |
| 129 | * |
| 130 | * @param Page\Path $path |
| 131 | * @return PageInterface |
| 132 | */ |
| 133 | public function addPath(Page\Path $path): PageInterface; |
| 134 | |
| 135 | /** |
| 136 | * Get image objects |
| 137 | * |
| 138 | * @return array |
| 139 | */ |
| 140 | public function getImages(): array; |
| 141 | |
| 142 | /** |
| 143 | * Get text objects |
| 144 | * |
| 145 | * @return array |
| 146 | */ |
| 147 | public function getText(): array; |
| 148 | |
| 149 | /** |
| 150 | * Get annotation objects |
| 151 | * |
| 152 | * @return array |
| 153 | */ |
| 154 | public function getAnnotations(): array; |
| 155 | |
| 156 | /** |
| 157 | * Get path objects |
| 158 | * |
| 159 | * @return array |
| 160 | */ |
| 161 | public function getPaths(): array; |
| 162 | |
| 163 | /** |
| 164 | * Determine if the page has image objects |
| 165 | * |
| 166 | * @return bool |
| 167 | */ |
| 168 | public function hasImages(): bool; |
| 169 | |
| 170 | /** |
| 171 | * Determine if the page has text objects |
| 172 | * |
| 173 | * @return bool |
| 174 | */ |
| 175 | public function hasText(): bool; |
| 176 | |
| 177 | /** |
| 178 | * Determine if the page has annotation objects |
| 179 | * |
| 180 | * @return bool |
| 181 | */ |
| 182 | public function hasAnnotations(): bool; |
| 183 | |
| 184 | /** |
| 185 | * Determine if the page has path objects |
| 186 | * |
| 187 | * @return bool |
| 188 | */ |
| 189 | public function hasPaths(): bool; |
| 190 | |
| 191 | } |