Exceptions
5 days ago
apache.php
5 days ago
apcu.php
5 days ago
array.php
5 days ago
bzip2.php
5 days ago
calendar.php
5 days ago
classobj.php
5 days ago
com.php
5 days ago
cubrid.php
5 days ago
curl.php
5 days ago
datetime.php
5 days ago
dir.php
5 days ago
eio.php
5 days ago
errorfunc.php
5 days ago
exec.php
5 days ago
fileinfo.php
5 days ago
filesystem.php
5 days ago
filter.php
5 days ago
fpm.php
5 days ago
ftp.php
5 days ago
funchand.php
5 days ago
functionsList.php
5 days ago
gmp.php
5 days ago
gnupg.php
5 days ago
hash.php
5 days ago
ibase.php
5 days ago
ibmDb2.php
5 days ago
iconv.php
5 days ago
image.php
5 days ago
imap.php
5 days ago
info.php
5 days ago
ingres-ii.php
5 days ago
inotify.php
5 days ago
json.php
5 days ago
ldap.php
5 days ago
libxml.php
5 days ago
lzf.php
5 days ago
mailparse.php
5 days ago
mbstring.php
5 days ago
misc.php
5 days ago
msql.php
5 days ago
mysql.php
5 days ago
mysqli.php
5 days ago
mysqlndMs.php
5 days ago
mysqlndQc.php
5 days ago
network.php
5 days ago
oci8.php
5 days ago
opcache.php
5 days ago
openssl.php
5 days ago
outcontrol.php
5 days ago
password.php
5 days ago
pcntl.php
5 days ago
pcre.php
5 days ago
pdf.php
5 days ago
pgsql.php
5 days ago
posix.php
5 days ago
ps.php
5 days ago
pspell.php
5 days ago
readline.php
5 days ago
rpminfo.php
5 days ago
rrd.php
5 days ago
sem.php
5 days ago
session.php
5 days ago
shmop.php
5 days ago
simplexml.php
5 days ago
sockets.php
5 days ago
sodium.php
5 days ago
solr.php
5 days ago
spl.php
5 days ago
sqlsrv.php
5 days ago
ssdeep.php
5 days ago
ssh2.php
5 days ago
stream.php
5 days ago
strings.php
5 days ago
swoole.php
5 days ago
uodbc.php
5 days ago
uopz.php
5 days ago
url.php
5 days ago
var.php
5 days ago
xdiff.php
5 days ago
xml.php
5 days ago
xmlrpc.php
5 days ago
yaml.php
5 days ago
yaz.php
5 days ago
zip.php
5 days ago
zlib.php
5 days ago
pdf.php
1411 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\Safe; |
| 4 | |
| 5 | use ProfilePressVendor\Safe\Exceptions\PdfException; |
| 6 | /** |
| 7 | * Activates a previously created structure element or other content item. |
| 8 | * Returns TRUE on success. |
| 9 | * |
| 10 | * @param resource $pdfdoc |
| 11 | * @param int $id |
| 12 | * @throws PdfException |
| 13 | * |
| 14 | */ |
| 15 | function PDF_activate_item($pdfdoc, int $id): void |
| 16 | { |
| 17 | error_clear_last(); |
| 18 | $result = \PDF_activate_item($pdfdoc, $id); |
| 19 | if ($result === \false) { |
| 20 | throw PdfException::createFromPhpError(); |
| 21 | } |
| 22 | } |
| 23 | /** |
| 24 | * Add a link annotation to a target within the current PDF file. |
| 25 | * Returns TRUE on success. |
| 26 | * |
| 27 | * This function is deprecated since PDFlib version 6, use |
| 28 | * PDF_create_action with type=GoTo |
| 29 | * and PDF_create_annotation with |
| 30 | * type=Link instead. |
| 31 | * |
| 32 | * @param resource $pdfdoc |
| 33 | * @param float $lowerleftx |
| 34 | * @param float $lowerlefty |
| 35 | * @param float $upperrightx |
| 36 | * @param float $upperrighty |
| 37 | * @param int $page |
| 38 | * @param string $dest |
| 39 | * @throws PdfException |
| 40 | * |
| 41 | */ |
| 42 | function PDF_add_locallink($pdfdoc, float $lowerleftx, float $lowerlefty, float $upperrightx, float $upperrighty, int $page, string $dest): void |
| 43 | { |
| 44 | error_clear_last(); |
| 45 | $result = \PDF_add_locallink($pdfdoc, $lowerleftx, $lowerlefty, $upperrightx, $upperrighty, $page, $dest); |
| 46 | if ($result === \false) { |
| 47 | throw PdfException::createFromPhpError(); |
| 48 | } |
| 49 | } |
| 50 | /** |
| 51 | * Creates a named destination on an arbitrary page in the current document. |
| 52 | * Returns TRUE on success. |
| 53 | * |
| 54 | * @param resource $pdfdoc |
| 55 | * @param string $name |
| 56 | * @param string $optlist |
| 57 | * @throws PdfException |
| 58 | * |
| 59 | */ |
| 60 | function PDF_add_nameddest($pdfdoc, string $name, string $optlist): void |
| 61 | { |
| 62 | error_clear_last(); |
| 63 | $result = \PDF_add_nameddest($pdfdoc, $name, $optlist); |
| 64 | if ($result === \false) { |
| 65 | throw PdfException::createFromPhpError(); |
| 66 | } |
| 67 | } |
| 68 | /** |
| 69 | * Sets an annotation for the current page. Returns TRUE on success. |
| 70 | * |
| 71 | * This function is deprecated since PDFlib version 6, use |
| 72 | * PDF_create_annotation with |
| 73 | * type=Text instead. |
| 74 | * |
| 75 | * @param resource $pdfdoc |
| 76 | * @param float $llx |
| 77 | * @param float $lly |
| 78 | * @param float $urx |
| 79 | * @param float $ury |
| 80 | * @param string $contents |
| 81 | * @param string $title |
| 82 | * @param string $icon |
| 83 | * @param int $open |
| 84 | * @throws PdfException |
| 85 | * |
| 86 | */ |
| 87 | function PDF_add_note($pdfdoc, float $llx, float $lly, float $urx, float $ury, string $contents, string $title, string $icon, int $open): void |
| 88 | { |
| 89 | error_clear_last(); |
| 90 | $result = \PDF_add_note($pdfdoc, $llx, $lly, $urx, $ury, $contents, $title, $icon, $open); |
| 91 | if ($result === \false) { |
| 92 | throw PdfException::createFromPhpError(); |
| 93 | } |
| 94 | } |
| 95 | /** |
| 96 | * Add a file link annotation to a PDF target. |
| 97 | * Returns TRUE on success. |
| 98 | * |
| 99 | * This function is deprecated since PDFlib version 6, use |
| 100 | * PDF_create_action with |
| 101 | * type=GoToR and |
| 102 | * PDF_create_annotation with |
| 103 | * type=Link instead. |
| 104 | * |
| 105 | * @param resource $pdfdoc |
| 106 | * @param float $bottom_left_x |
| 107 | * @param float $bottom_left_y |
| 108 | * @param float $up_right_x |
| 109 | * @param float $up_right_y |
| 110 | * @param string $filename |
| 111 | * @param int $page |
| 112 | * @param string $dest |
| 113 | * @throws PdfException |
| 114 | * |
| 115 | */ |
| 116 | function PDF_add_pdflink($pdfdoc, float $bottom_left_x, float $bottom_left_y, float $up_right_x, float $up_right_y, string $filename, int $page, string $dest): void |
| 117 | { |
| 118 | error_clear_last(); |
| 119 | $result = \PDF_add_pdflink($pdfdoc, $bottom_left_x, $bottom_left_y, $up_right_x, $up_right_y, $filename, $page, $dest); |
| 120 | if ($result === \false) { |
| 121 | throw PdfException::createFromPhpError(); |
| 122 | } |
| 123 | } |
| 124 | /** |
| 125 | * Adds an existing image as thumbnail for the current page. |
| 126 | * Returns TRUE on success. |
| 127 | * |
| 128 | * @param resource $pdfdoc |
| 129 | * @param int $image |
| 130 | * @throws PdfException |
| 131 | * |
| 132 | */ |
| 133 | function PDF_add_thumbnail($pdfdoc, int $image): void |
| 134 | { |
| 135 | error_clear_last(); |
| 136 | $result = \PDF_add_thumbnail($pdfdoc, $image); |
| 137 | if ($result === \false) { |
| 138 | throw PdfException::createFromPhpError(); |
| 139 | } |
| 140 | } |
| 141 | /** |
| 142 | * Adds a weblink annotation to a target url on the Web. |
| 143 | * Returns TRUE on success. |
| 144 | * |
| 145 | * This function is deprecated since PDFlib version 6, use |
| 146 | * PDF_create_action with type=URI |
| 147 | * and PDF_create_annotation with |
| 148 | * type=Link instead. |
| 149 | * |
| 150 | * @param resource $pdfdoc |
| 151 | * @param float $lowerleftx |
| 152 | * @param float $lowerlefty |
| 153 | * @param float $upperrightx |
| 154 | * @param float $upperrighty |
| 155 | * @param string $url |
| 156 | * @throws PdfException |
| 157 | * |
| 158 | */ |
| 159 | function PDF_add_weblink($pdfdoc, float $lowerleftx, float $lowerlefty, float $upperrightx, float $upperrighty, string $url): void |
| 160 | { |
| 161 | error_clear_last(); |
| 162 | $result = \PDF_add_weblink($pdfdoc, $lowerleftx, $lowerlefty, $upperrightx, $upperrighty, $url); |
| 163 | if ($result === \false) { |
| 164 | throw PdfException::createFromPhpError(); |
| 165 | } |
| 166 | } |
| 167 | /** |
| 168 | * Adds a file attachment annotation. Returns TRUE on success. |
| 169 | * |
| 170 | * This function is deprecated since PDFlib version 6, use |
| 171 | * PDF_create_annotation with |
| 172 | * type=FileAttachment instead. |
| 173 | * |
| 174 | * @param resource $pdfdoc |
| 175 | * @param float $llx |
| 176 | * @param float $lly |
| 177 | * @param float $urx |
| 178 | * @param float $ury |
| 179 | * @param string $filename |
| 180 | * @param string $description |
| 181 | * @param string $author |
| 182 | * @param string $mimetype |
| 183 | * @param string $icon |
| 184 | * @throws PdfException |
| 185 | * |
| 186 | */ |
| 187 | function PDF_attach_file($pdfdoc, float $llx, float $lly, float $urx, float $ury, string $filename, string $description, string $author, string $mimetype, string $icon): void |
| 188 | { |
| 189 | error_clear_last(); |
| 190 | $result = \PDF_attach_file($pdfdoc, $llx, $lly, $urx, $ury, $filename, $description, $author, $mimetype, $icon); |
| 191 | if ($result === \false) { |
| 192 | throw PdfException::createFromPhpError(); |
| 193 | } |
| 194 | } |
| 195 | /** |
| 196 | * Starts a layer for subsequent output on the page. Returns TRUE on success. |
| 197 | * |
| 198 | * This function requires PDF 1.5. |
| 199 | * |
| 200 | * @param resource $pdfdoc |
| 201 | * @param int $layer |
| 202 | * @throws PdfException |
| 203 | * |
| 204 | */ |
| 205 | function PDF_begin_layer($pdfdoc, int $layer): void |
| 206 | { |
| 207 | error_clear_last(); |
| 208 | $result = \PDF_begin_layer($pdfdoc, $layer); |
| 209 | if ($result === \false) { |
| 210 | throw PdfException::createFromPhpError(); |
| 211 | } |
| 212 | } |
| 213 | /** |
| 214 | * Adds a new page to the document, and specifies various options. |
| 215 | * The parameters width and height |
| 216 | * are the dimensions of the new page in points. Returns TRUE on success. |
| 217 | * |
| 218 | * |
| 219 | * Common Page Sizes in Points |
| 220 | * |
| 221 | * |
| 222 | * |
| 223 | * name |
| 224 | * size |
| 225 | * |
| 226 | * |
| 227 | * |
| 228 | * |
| 229 | * A0 |
| 230 | * 2380 x 3368 |
| 231 | * |
| 232 | * |
| 233 | * A1 |
| 234 | * 1684 x 2380 |
| 235 | * |
| 236 | * |
| 237 | * A2 |
| 238 | * 1190 x 1684 |
| 239 | * |
| 240 | * |
| 241 | * A3 |
| 242 | * 842 x 1190 |
| 243 | * |
| 244 | * |
| 245 | * A4 |
| 246 | * 595 x 842 |
| 247 | * |
| 248 | * |
| 249 | * A5 |
| 250 | * 421 x 595 |
| 251 | * |
| 252 | * |
| 253 | * A6 |
| 254 | * 297 x 421 |
| 255 | * |
| 256 | * |
| 257 | * B5 |
| 258 | * 501 x 709 |
| 259 | * |
| 260 | * |
| 261 | * letter (8.5" x 11") |
| 262 | * 612 x 792 |
| 263 | * |
| 264 | * |
| 265 | * legal (8.5" x 14") |
| 266 | * 612 x 1008 |
| 267 | * |
| 268 | * |
| 269 | * ledger (17" x 11") |
| 270 | * 1224 x 792 |
| 271 | * |
| 272 | * |
| 273 | * 11" x 17" |
| 274 | * 792 x 1224 |
| 275 | * |
| 276 | * |
| 277 | * |
| 278 | * |
| 279 | * |
| 280 | * @param resource $pdfdoc |
| 281 | * @param float $width |
| 282 | * @param float $height |
| 283 | * @param string $optlist |
| 284 | * @throws PdfException |
| 285 | * |
| 286 | */ |
| 287 | function PDF_begin_page_ext($pdfdoc, float $width, float $height, string $optlist): void |
| 288 | { |
| 289 | error_clear_last(); |
| 290 | $result = \PDF_begin_page_ext($pdfdoc, $width, $height, $optlist); |
| 291 | if ($result === \false) { |
| 292 | throw PdfException::createFromPhpError(); |
| 293 | } |
| 294 | } |
| 295 | /** |
| 296 | * Adds a new page to the document. Returns TRUE on success. |
| 297 | * |
| 298 | * This function is deprecated since PDFlib version 6, use |
| 299 | * PDF_begin_page_ext instead. |
| 300 | * |
| 301 | * @param resource $pdfdoc |
| 302 | * @param float $width |
| 303 | * @param float $height |
| 304 | * @throws PdfException |
| 305 | * |
| 306 | */ |
| 307 | function PDF_begin_page($pdfdoc, float $width, float $height): void |
| 308 | { |
| 309 | error_clear_last(); |
| 310 | $result = \PDF_begin_page($pdfdoc, $width, $height); |
| 311 | if ($result === \false) { |
| 312 | throw PdfException::createFromPhpError(); |
| 313 | } |
| 314 | } |
| 315 | /** |
| 316 | * Adds a circle. Returns TRUE on success. |
| 317 | * |
| 318 | * @param resource $pdfdoc |
| 319 | * @param float $x |
| 320 | * @param float $y |
| 321 | * @param float $r |
| 322 | * @throws PdfException |
| 323 | * |
| 324 | */ |
| 325 | function PDF_circle($pdfdoc, float $x, float $y, float $r): void |
| 326 | { |
| 327 | error_clear_last(); |
| 328 | $result = \PDF_circle($pdfdoc, $x, $y, $r); |
| 329 | if ($result === \false) { |
| 330 | throw PdfException::createFromPhpError(); |
| 331 | } |
| 332 | } |
| 333 | /** |
| 334 | * Uses the current path as clipping path, and terminate the path. Returns TRUE on success. |
| 335 | * |
| 336 | * @param resource $p |
| 337 | * @throws PdfException |
| 338 | * |
| 339 | */ |
| 340 | function PDF_clip($p): void |
| 341 | { |
| 342 | error_clear_last(); |
| 343 | $result = \PDF_clip($p); |
| 344 | if ($result === \false) { |
| 345 | throw PdfException::createFromPhpError(); |
| 346 | } |
| 347 | } |
| 348 | /** |
| 349 | * Closes the page handle, and frees all page-related resources. Returns TRUE on success. |
| 350 | * |
| 351 | * @param resource $p |
| 352 | * @param int $page |
| 353 | * @throws PdfException |
| 354 | * |
| 355 | */ |
| 356 | function PDF_close_pdi_page($p, int $page): void |
| 357 | { |
| 358 | error_clear_last(); |
| 359 | $result = \PDF_close_pdi_page($p, $page); |
| 360 | if ($result === \false) { |
| 361 | throw PdfException::createFromPhpError(); |
| 362 | } |
| 363 | } |
| 364 | /** |
| 365 | * Closes all open page handles, and closes the input PDF document. Returns TRUE on success. |
| 366 | * |
| 367 | * This function is deprecated since PDFlib version 7, |
| 368 | * use PDF_close_pdi_document instead. |
| 369 | * |
| 370 | * @param resource $p |
| 371 | * @param int $doc |
| 372 | * @throws PdfException |
| 373 | * |
| 374 | */ |
| 375 | function PDF_close_pdi($p, int $doc): void |
| 376 | { |
| 377 | error_clear_last(); |
| 378 | $result = \PDF_close_pdi($p, $doc); |
| 379 | if ($result === \false) { |
| 380 | throw PdfException::createFromPhpError(); |
| 381 | } |
| 382 | } |
| 383 | /** |
| 384 | * Closes the generated PDF file, and frees all document-related resources. |
| 385 | * Returns TRUE on success. |
| 386 | * |
| 387 | * This function is deprecated since PDFlib version 6, use |
| 388 | * PDF_end_document instead. |
| 389 | * |
| 390 | * @param resource $p |
| 391 | * @throws PdfException |
| 392 | * |
| 393 | */ |
| 394 | function PDF_close($p): void |
| 395 | { |
| 396 | error_clear_last(); |
| 397 | $result = \PDF_close($p); |
| 398 | if ($result === \false) { |
| 399 | throw PdfException::createFromPhpError(); |
| 400 | } |
| 401 | } |
| 402 | /** |
| 403 | * Closes the path, fills, and strokes it. Returns TRUE on success. |
| 404 | * |
| 405 | * @param resource $p |
| 406 | * @throws PdfException |
| 407 | * |
| 408 | */ |
| 409 | function PDF_closepath_fill_stroke($p): void |
| 410 | { |
| 411 | error_clear_last(); |
| 412 | $result = \PDF_closepath_fill_stroke($p); |
| 413 | if ($result === \false) { |
| 414 | throw PdfException::createFromPhpError(); |
| 415 | } |
| 416 | } |
| 417 | /** |
| 418 | * Closes the path, and strokes it. Returns TRUE on success. |
| 419 | * |
| 420 | * @param resource $p |
| 421 | * @throws PdfException |
| 422 | * |
| 423 | */ |
| 424 | function PDF_closepath_stroke($p): void |
| 425 | { |
| 426 | error_clear_last(); |
| 427 | $result = \PDF_closepath_stroke($p); |
| 428 | if ($result === \false) { |
| 429 | throw PdfException::createFromPhpError(); |
| 430 | } |
| 431 | } |
| 432 | /** |
| 433 | * Closes the current path. Returns TRUE on success. |
| 434 | * |
| 435 | * @param resource $p |
| 436 | * @throws PdfException |
| 437 | * |
| 438 | */ |
| 439 | function PDF_closepath($p): void |
| 440 | { |
| 441 | error_clear_last(); |
| 442 | $result = \PDF_closepath($p); |
| 443 | if ($result === \false) { |
| 444 | throw PdfException::createFromPhpError(); |
| 445 | } |
| 446 | } |
| 447 | /** |
| 448 | * Concatenates a matrix to the current transformation matrix (CTM). Returns TRUE on success. |
| 449 | * |
| 450 | * @param resource $p |
| 451 | * @param float $a |
| 452 | * @param float $b |
| 453 | * @param float $c |
| 454 | * @param float $d |
| 455 | * @param float $e |
| 456 | * @param float $f |
| 457 | * @throws PdfException |
| 458 | * |
| 459 | */ |
| 460 | function PDF_concat($p, float $a, float $b, float $c, float $d, float $e, float $f): void |
| 461 | { |
| 462 | error_clear_last(); |
| 463 | $result = \PDF_concat($p, $a, $b, $c, $d, $e, $f); |
| 464 | if ($result === \false) { |
| 465 | throw PdfException::createFromPhpError(); |
| 466 | } |
| 467 | } |
| 468 | /** |
| 469 | * Prints text at the next line. Returns TRUE on success. |
| 470 | * |
| 471 | * @param resource $p |
| 472 | * @param string $text |
| 473 | * @throws PdfException |
| 474 | * |
| 475 | */ |
| 476 | function PDF_continue_text($p, string $text): void |
| 477 | { |
| 478 | error_clear_last(); |
| 479 | $result = \PDF_continue_text($p, $text); |
| 480 | if ($result === \false) { |
| 481 | throw PdfException::createFromPhpError(); |
| 482 | } |
| 483 | } |
| 484 | /** |
| 485 | * Draws a Bezier curve from the current point, using 3 more control points. |
| 486 | * Returns TRUE on success. |
| 487 | * |
| 488 | * @param resource $p |
| 489 | * @param float $x1 |
| 490 | * @param float $y1 |
| 491 | * @param float $x2 |
| 492 | * @param float $y2 |
| 493 | * @param float $x3 |
| 494 | * @param float $y3 |
| 495 | * @throws PdfException |
| 496 | * |
| 497 | */ |
| 498 | function PDF_curveto($p, float $x1, float $y1, float $x2, float $y2, float $x3, float $y3): void |
| 499 | { |
| 500 | error_clear_last(); |
| 501 | $result = \PDF_curveto($p, $x1, $y1, $x2, $y2, $x3, $y3); |
| 502 | if ($result === \false) { |
| 503 | throw PdfException::createFromPhpError(); |
| 504 | } |
| 505 | } |
| 506 | /** |
| 507 | * Deletes a PDFlib object, and frees all internal resources. Returns TRUE on success. |
| 508 | * |
| 509 | * @param resource $pdfdoc |
| 510 | * @throws PdfException |
| 511 | * |
| 512 | */ |
| 513 | function PDF_delete($pdfdoc): void |
| 514 | { |
| 515 | error_clear_last(); |
| 516 | $result = \PDF_delete($pdfdoc); |
| 517 | if ($result === \false) { |
| 518 | throw PdfException::createFromPhpError(); |
| 519 | } |
| 520 | } |
| 521 | /** |
| 522 | * Deactivates all active layers. Returns TRUE on success. |
| 523 | * |
| 524 | * This function requires PDF 1.5. |
| 525 | * |
| 526 | * @param resource $pdfdoc |
| 527 | * @throws PdfException |
| 528 | * |
| 529 | */ |
| 530 | function PDF_end_layer($pdfdoc): void |
| 531 | { |
| 532 | error_clear_last(); |
| 533 | $result = \PDF_end_layer($pdfdoc); |
| 534 | if ($result === \false) { |
| 535 | throw PdfException::createFromPhpError(); |
| 536 | } |
| 537 | } |
| 538 | /** |
| 539 | * Finishes a page, and applies various options. Returns TRUE on success. |
| 540 | * |
| 541 | * @param resource $pdfdoc |
| 542 | * @param string $optlist |
| 543 | * @throws PdfException |
| 544 | * |
| 545 | */ |
| 546 | function PDF_end_page_ext($pdfdoc, string $optlist): void |
| 547 | { |
| 548 | error_clear_last(); |
| 549 | $result = \PDF_end_page_ext($pdfdoc, $optlist); |
| 550 | if ($result === \false) { |
| 551 | throw PdfException::createFromPhpError(); |
| 552 | } |
| 553 | } |
| 554 | /** |
| 555 | * Finishes the page. Returns TRUE on success. |
| 556 | * |
| 557 | * @param resource $p |
| 558 | * @throws PdfException |
| 559 | * |
| 560 | */ |
| 561 | function PDF_end_page($p): void |
| 562 | { |
| 563 | error_clear_last(); |
| 564 | $result = \PDF_end_page($p); |
| 565 | if ($result === \false) { |
| 566 | throw PdfException::createFromPhpError(); |
| 567 | } |
| 568 | } |
| 569 | /** |
| 570 | * Finishes the pattern definition. Returns TRUE on success. |
| 571 | * |
| 572 | * @param resource $p |
| 573 | * @throws PdfException |
| 574 | * |
| 575 | */ |
| 576 | function PDF_end_pattern($p): void |
| 577 | { |
| 578 | error_clear_last(); |
| 579 | $result = \PDF_end_pattern($p); |
| 580 | if ($result === \false) { |
| 581 | throw PdfException::createFromPhpError(); |
| 582 | } |
| 583 | } |
| 584 | /** |
| 585 | * Finishes a template definition. Returns TRUE on success. |
| 586 | * |
| 587 | * @param resource $p |
| 588 | * @throws PdfException |
| 589 | * |
| 590 | */ |
| 591 | function PDF_end_template($p): void |
| 592 | { |
| 593 | error_clear_last(); |
| 594 | $result = \PDF_end_template($p); |
| 595 | if ($result === \false) { |
| 596 | throw PdfException::createFromPhpError(); |
| 597 | } |
| 598 | } |
| 599 | /** |
| 600 | * Fills and strokes the current path with the current fill and stroke color. |
| 601 | * Returns TRUE on success. |
| 602 | * |
| 603 | * @param resource $p |
| 604 | * @throws PdfException |
| 605 | * |
| 606 | */ |
| 607 | function PDF_fill_stroke($p): void |
| 608 | { |
| 609 | error_clear_last(); |
| 610 | $result = \PDF_fill_stroke($p); |
| 611 | if ($result === \false) { |
| 612 | throw PdfException::createFromPhpError(); |
| 613 | } |
| 614 | } |
| 615 | /** |
| 616 | * Fills the interior of the current path with the current fill color. |
| 617 | * Returns TRUE on success. |
| 618 | * |
| 619 | * @param resource $p |
| 620 | * @throws PdfException |
| 621 | * |
| 622 | */ |
| 623 | function PDF_fill($p): void |
| 624 | { |
| 625 | error_clear_last(); |
| 626 | $result = \PDF_fill($p); |
| 627 | if ($result === \false) { |
| 628 | throw PdfException::createFromPhpError(); |
| 629 | } |
| 630 | } |
| 631 | /** |
| 632 | * Places an image or template on the page, subject to various options. |
| 633 | * Returns TRUE on success. |
| 634 | * |
| 635 | * @param resource $pdfdoc |
| 636 | * @param int $image |
| 637 | * @param float $x |
| 638 | * @param float $y |
| 639 | * @param string $optlist |
| 640 | * @throws PdfException |
| 641 | * |
| 642 | */ |
| 643 | function PDF_fit_image($pdfdoc, int $image, float $x, float $y, string $optlist): void |
| 644 | { |
| 645 | error_clear_last(); |
| 646 | $result = \PDF_fit_image($pdfdoc, $image, $x, $y, $optlist); |
| 647 | if ($result === \false) { |
| 648 | throw PdfException::createFromPhpError(); |
| 649 | } |
| 650 | } |
| 651 | /** |
| 652 | * Places an imported PDF page on the page, subject to various options. |
| 653 | * Returns TRUE on success. |
| 654 | * |
| 655 | * @param resource $pdfdoc |
| 656 | * @param int $page |
| 657 | * @param float $x |
| 658 | * @param float $y |
| 659 | * @param string $optlist |
| 660 | * @throws PdfException |
| 661 | * |
| 662 | */ |
| 663 | function PDF_fit_pdi_page($pdfdoc, int $page, float $x, float $y, string $optlist): void |
| 664 | { |
| 665 | error_clear_last(); |
| 666 | $result = \PDF_fit_pdi_page($pdfdoc, $page, $x, $y, $optlist); |
| 667 | if ($result === \false) { |
| 668 | throw PdfException::createFromPhpError(); |
| 669 | } |
| 670 | } |
| 671 | /** |
| 672 | * Places a single line of text on the page, subject to various options. Returns TRUE on success. |
| 673 | * |
| 674 | * @param resource $pdfdoc |
| 675 | * @param string $text |
| 676 | * @param float $x |
| 677 | * @param float $y |
| 678 | * @param string $optlist |
| 679 | * @throws PdfException |
| 680 | * |
| 681 | */ |
| 682 | function PDF_fit_textline($pdfdoc, string $text, float $x, float $y, string $optlist): void |
| 683 | { |
| 684 | error_clear_last(); |
| 685 | $result = \PDF_fit_textline($pdfdoc, $text, $x, $y, $optlist); |
| 686 | if ($result === \false) { |
| 687 | throw PdfException::createFromPhpError(); |
| 688 | } |
| 689 | } |
| 690 | /** |
| 691 | * Reset all color and graphics state parameters to their defaults. |
| 692 | * Returns TRUE on success. |
| 693 | * |
| 694 | * @param resource $p |
| 695 | * @throws PdfException |
| 696 | * |
| 697 | */ |
| 698 | function PDF_initgraphics($p): void |
| 699 | { |
| 700 | error_clear_last(); |
| 701 | $result = \PDF_initgraphics($p); |
| 702 | if ($result === \false) { |
| 703 | throw PdfException::createFromPhpError(); |
| 704 | } |
| 705 | } |
| 706 | /** |
| 707 | * Draws a line from the current point to another point. Returns TRUE on success. |
| 708 | * |
| 709 | * @param resource $p |
| 710 | * @param float $x |
| 711 | * @param float $y |
| 712 | * @throws PdfException |
| 713 | * |
| 714 | */ |
| 715 | function PDF_lineto($p, float $x, float $y): void |
| 716 | { |
| 717 | error_clear_last(); |
| 718 | $result = \PDF_lineto($p, $x, $y); |
| 719 | if ($result === \false) { |
| 720 | throw PdfException::createFromPhpError(); |
| 721 | } |
| 722 | } |
| 723 | /** |
| 724 | * Finds a built-in spot color name, or makes a named spot color from the |
| 725 | * current fill color. Returns TRUE on success. |
| 726 | * |
| 727 | * @param resource $p |
| 728 | * @param string $spotname |
| 729 | * @return int |
| 730 | * @throws PdfException |
| 731 | * |
| 732 | */ |
| 733 | function PDF_makespotcolor($p, string $spotname): int |
| 734 | { |
| 735 | error_clear_last(); |
| 736 | $result = \PDF_makespotcolor($p, $spotname); |
| 737 | if ($result === \false) { |
| 738 | throw PdfException::createFromPhpError(); |
| 739 | } |
| 740 | return $result; |
| 741 | } |
| 742 | /** |
| 743 | * Sets the current point for graphics output. Returns TRUE on success. |
| 744 | * |
| 745 | * @param resource $p |
| 746 | * @param float $x |
| 747 | * @param float $y |
| 748 | * @throws PdfException |
| 749 | * |
| 750 | */ |
| 751 | function PDF_moveto($p, float $x, float $y): void |
| 752 | { |
| 753 | error_clear_last(); |
| 754 | $result = \PDF_moveto($p, $x, $y); |
| 755 | if ($result === \false) { |
| 756 | throw PdfException::createFromPhpError(); |
| 757 | } |
| 758 | } |
| 759 | /** |
| 760 | * Creates a new PDF file using the supplied file name. |
| 761 | * Returns TRUE on success. |
| 762 | * |
| 763 | * This function is deprecated since PDFlib version 6, use |
| 764 | * PDF_begin_document instead. |
| 765 | * |
| 766 | * @param resource $p |
| 767 | * @param string $filename |
| 768 | * @throws PdfException |
| 769 | * |
| 770 | */ |
| 771 | function PDF_open_file($p, string $filename): void |
| 772 | { |
| 773 | error_clear_last(); |
| 774 | $result = \PDF_open_file($p, $filename); |
| 775 | if ($result === \false) { |
| 776 | throw PdfException::createFromPhpError(); |
| 777 | } |
| 778 | } |
| 779 | /** |
| 780 | * Places an image and scales it. Returns TRUE on success. |
| 781 | * |
| 782 | * This function is deprecated since PDFlib version 5, use |
| 783 | * PDF_fit_image instead. |
| 784 | * |
| 785 | * @param resource $pdfdoc |
| 786 | * @param int $image |
| 787 | * @param float $x |
| 788 | * @param float $y |
| 789 | * @param float $scale |
| 790 | * @throws PdfException |
| 791 | * |
| 792 | */ |
| 793 | function PDF_place_image($pdfdoc, int $image, float $x, float $y, float $scale): void |
| 794 | { |
| 795 | error_clear_last(); |
| 796 | $result = \PDF_place_image($pdfdoc, $image, $x, $y, $scale); |
| 797 | if ($result === \false) { |
| 798 | throw PdfException::createFromPhpError(); |
| 799 | } |
| 800 | } |
| 801 | /** |
| 802 | * Places a PDF page and scales it. Returns TRUE on success. |
| 803 | * |
| 804 | * This function is deprecated since PDFlib version 5, use |
| 805 | * PDF_fit_pdi_page instead. |
| 806 | * |
| 807 | * @param resource $pdfdoc |
| 808 | * @param int $page |
| 809 | * @param float $x |
| 810 | * @param float $y |
| 811 | * @param float $sx |
| 812 | * @param float $sy |
| 813 | * @throws PdfException |
| 814 | * |
| 815 | */ |
| 816 | function PDF_place_pdi_page($pdfdoc, int $page, float $x, float $y, float $sx, float $sy): void |
| 817 | { |
| 818 | error_clear_last(); |
| 819 | $result = \PDF_place_pdi_page($pdfdoc, $page, $x, $y, $sx, $sy); |
| 820 | if ($result === \false) { |
| 821 | throw PdfException::createFromPhpError(); |
| 822 | } |
| 823 | } |
| 824 | /** |
| 825 | * Draws a rectangle. Returns TRUE on success. |
| 826 | * |
| 827 | * @param resource $p |
| 828 | * @param float $x |
| 829 | * @param float $y |
| 830 | * @param float $width |
| 831 | * @param float $height |
| 832 | * @throws PdfException |
| 833 | * |
| 834 | */ |
| 835 | function PDF_rect($p, float $x, float $y, float $width, float $height): void |
| 836 | { |
| 837 | error_clear_last(); |
| 838 | $result = \PDF_rect($p, $x, $y, $width, $height); |
| 839 | if ($result === \false) { |
| 840 | throw PdfException::createFromPhpError(); |
| 841 | } |
| 842 | } |
| 843 | /** |
| 844 | * Restores the most recently saved graphics state. Returns TRUE on success. |
| 845 | * |
| 846 | * @param resource $p |
| 847 | * @throws PdfException |
| 848 | * |
| 849 | */ |
| 850 | function PDF_restore($p): void |
| 851 | { |
| 852 | error_clear_last(); |
| 853 | $result = \PDF_restore($p); |
| 854 | if ($result === \false) { |
| 855 | throw PdfException::createFromPhpError(); |
| 856 | } |
| 857 | } |
| 858 | /** |
| 859 | * Rotates the coordinate system. Returns TRUE on success. |
| 860 | * |
| 861 | * @param resource $p |
| 862 | * @param float $phi |
| 863 | * @throws PdfException |
| 864 | * |
| 865 | */ |
| 866 | function PDF_rotate($p, float $phi): void |
| 867 | { |
| 868 | error_clear_last(); |
| 869 | $result = \PDF_rotate($p, $phi); |
| 870 | if ($result === \false) { |
| 871 | throw PdfException::createFromPhpError(); |
| 872 | } |
| 873 | } |
| 874 | /** |
| 875 | * Saves the current graphics state. Returns TRUE on success. |
| 876 | * |
| 877 | * @param resource $p |
| 878 | * @throws PdfException |
| 879 | * |
| 880 | */ |
| 881 | function PDF_save($p): void |
| 882 | { |
| 883 | error_clear_last(); |
| 884 | $result = \PDF_save($p); |
| 885 | if ($result === \false) { |
| 886 | throw PdfException::createFromPhpError(); |
| 887 | } |
| 888 | } |
| 889 | /** |
| 890 | * Scales the coordinate system. Returns TRUE on success. |
| 891 | * |
| 892 | * @param resource $p |
| 893 | * @param float $sx |
| 894 | * @param float $sy |
| 895 | * @throws PdfException |
| 896 | * |
| 897 | */ |
| 898 | function PDF_scale($p, float $sx, float $sy): void |
| 899 | { |
| 900 | error_clear_last(); |
| 901 | $result = \PDF_scale($p, $sx, $sy); |
| 902 | if ($result === \false) { |
| 903 | throw PdfException::createFromPhpError(); |
| 904 | } |
| 905 | } |
| 906 | /** |
| 907 | * Sets the border color for all kinds of annotations. Returns TRUE on success. |
| 908 | * |
| 909 | * This function is deprecated since PDFlib version 6, use |
| 910 | * the option annotcolor in |
| 911 | * PDF_create_annotation instead. |
| 912 | * |
| 913 | * @param resource $p |
| 914 | * @param float $red |
| 915 | * @param float $green |
| 916 | * @param float $blue |
| 917 | * @throws PdfException |
| 918 | * |
| 919 | */ |
| 920 | function PDF_set_border_color($p, float $red, float $green, float $blue): void |
| 921 | { |
| 922 | error_clear_last(); |
| 923 | $result = \PDF_set_border_color($p, $red, $green, $blue); |
| 924 | if ($result === \false) { |
| 925 | throw PdfException::createFromPhpError(); |
| 926 | } |
| 927 | } |
| 928 | /** |
| 929 | * Sets the border dash style for all kinds of annotations. Returns TRUE on success. |
| 930 | * |
| 931 | * This function is deprecated since PDFlib version 6, use |
| 932 | * the option dasharray in |
| 933 | * PDF_create_annotation instead. |
| 934 | * |
| 935 | * @param resource $pdfdoc |
| 936 | * @param float $black |
| 937 | * @param float $white |
| 938 | * @throws PdfException |
| 939 | * |
| 940 | */ |
| 941 | function PDF_set_border_dash($pdfdoc, float $black, float $white): void |
| 942 | { |
| 943 | error_clear_last(); |
| 944 | $result = \PDF_set_border_dash($pdfdoc, $black, $white); |
| 945 | if ($result === \false) { |
| 946 | throw PdfException::createFromPhpError(); |
| 947 | } |
| 948 | } |
| 949 | /** |
| 950 | * Sets the border style for all kinds of annotations. Returns TRUE on success. |
| 951 | * |
| 952 | * This function is deprecated since PDFlib version 6, use |
| 953 | * the options borderstyle and |
| 954 | * linewidth in |
| 955 | * PDF_create_annotation instead. |
| 956 | * |
| 957 | * @param resource $pdfdoc |
| 958 | * @param string $style |
| 959 | * @param float $width |
| 960 | * @throws PdfException |
| 961 | * |
| 962 | */ |
| 963 | function PDF_set_border_style($pdfdoc, string $style, float $width): void |
| 964 | { |
| 965 | error_clear_last(); |
| 966 | $result = \PDF_set_border_style($pdfdoc, $style, $width); |
| 967 | if ($result === \false) { |
| 968 | throw PdfException::createFromPhpError(); |
| 969 | } |
| 970 | } |
| 971 | /** |
| 972 | * Fill document information field key with |
| 973 | * value. Returns TRUE on success. |
| 974 | * |
| 975 | * @param resource $p |
| 976 | * @param string $key |
| 977 | * @param string $value |
| 978 | * @throws PdfException |
| 979 | * |
| 980 | */ |
| 981 | function PDF_set_info($p, string $key, string $value): void |
| 982 | { |
| 983 | error_clear_last(); |
| 984 | $result = \PDF_set_info($p, $key, $value); |
| 985 | if ($result === \false) { |
| 986 | throw PdfException::createFromPhpError(); |
| 987 | } |
| 988 | } |
| 989 | /** |
| 990 | * Defines hierarchical and group relationships among layers. Returns TRUE on success. |
| 991 | * |
| 992 | * This function requires PDF 1.5. |
| 993 | * |
| 994 | * @param resource $pdfdoc |
| 995 | * @param string $type |
| 996 | * @param string $optlist |
| 997 | * @throws PdfException |
| 998 | * |
| 999 | */ |
| 1000 | function PDF_set_layer_dependency($pdfdoc, string $type, string $optlist): void |
| 1001 | { |
| 1002 | error_clear_last(); |
| 1003 | $result = \PDF_set_layer_dependency($pdfdoc, $type, $optlist); |
| 1004 | if ($result === \false) { |
| 1005 | throw PdfException::createFromPhpError(); |
| 1006 | } |
| 1007 | } |
| 1008 | /** |
| 1009 | * Sets some PDFlib parameter with string type. Returns TRUE on success. |
| 1010 | * |
| 1011 | * @param resource $p |
| 1012 | * @param string $key |
| 1013 | * @param string $value |
| 1014 | * @throws PdfException |
| 1015 | * |
| 1016 | */ |
| 1017 | function PDF_set_parameter($p, string $key, string $value): void |
| 1018 | { |
| 1019 | error_clear_last(); |
| 1020 | $result = \PDF_set_parameter($p, $key, $value); |
| 1021 | if ($result === \false) { |
| 1022 | throw PdfException::createFromPhpError(); |
| 1023 | } |
| 1024 | } |
| 1025 | /** |
| 1026 | * Sets the position for text output on the page. Returns TRUE on success. |
| 1027 | * |
| 1028 | * @param resource $p |
| 1029 | * @param float $x |
| 1030 | * @param float $y |
| 1031 | * @throws PdfException |
| 1032 | * |
| 1033 | */ |
| 1034 | function PDF_set_text_pos($p, float $x, float $y): void |
| 1035 | { |
| 1036 | error_clear_last(); |
| 1037 | $result = \PDF_set_text_pos($p, $x, $y); |
| 1038 | if ($result === \false) { |
| 1039 | throw PdfException::createFromPhpError(); |
| 1040 | } |
| 1041 | } |
| 1042 | /** |
| 1043 | * Sets the value of some PDFlib parameter with numerical type. Returns TRUE on success. |
| 1044 | * |
| 1045 | * @param resource $p |
| 1046 | * @param string $key |
| 1047 | * @param float $value |
| 1048 | * @throws PdfException |
| 1049 | * |
| 1050 | */ |
| 1051 | function PDF_set_value($p, string $key, float $value): void |
| 1052 | { |
| 1053 | error_clear_last(); |
| 1054 | $result = \PDF_set_value($p, $key, $value); |
| 1055 | if ($result === \false) { |
| 1056 | throw PdfException::createFromPhpError(); |
| 1057 | } |
| 1058 | } |
| 1059 | /** |
| 1060 | * Sets the current color space and color. Returns TRUE on success. |
| 1061 | * |
| 1062 | * @param resource $p |
| 1063 | * @param string $fstype |
| 1064 | * @param string $colorspace |
| 1065 | * @param float $c1 |
| 1066 | * @param float $c2 |
| 1067 | * @param float $c3 |
| 1068 | * @param float $c4 |
| 1069 | * @throws PdfException |
| 1070 | * |
| 1071 | */ |
| 1072 | function PDF_setcolor($p, string $fstype, string $colorspace, float $c1, float $c2, float $c3, float $c4): void |
| 1073 | { |
| 1074 | error_clear_last(); |
| 1075 | $result = \PDF_setcolor($p, $fstype, $colorspace, $c1, $c2, $c3, $c4); |
| 1076 | if ($result === \false) { |
| 1077 | throw PdfException::createFromPhpError(); |
| 1078 | } |
| 1079 | } |
| 1080 | /** |
| 1081 | * Sets the current dash pattern to b black |
| 1082 | * and w white units. Returns TRUE on success. |
| 1083 | * |
| 1084 | * @param resource $pdfdoc |
| 1085 | * @param float $b |
| 1086 | * @param float $w |
| 1087 | * @throws PdfException |
| 1088 | * |
| 1089 | */ |
| 1090 | function PDF_setdash($pdfdoc, float $b, float $w): void |
| 1091 | { |
| 1092 | error_clear_last(); |
| 1093 | $result = \PDF_setdash($pdfdoc, $b, $w); |
| 1094 | if ($result === \false) { |
| 1095 | throw PdfException::createFromPhpError(); |
| 1096 | } |
| 1097 | } |
| 1098 | /** |
| 1099 | * Sets a dash pattern defined by an option list. Returns TRUE on success. |
| 1100 | * |
| 1101 | * @param resource $pdfdoc |
| 1102 | * @param string $optlist |
| 1103 | * @throws PdfException |
| 1104 | * |
| 1105 | */ |
| 1106 | function PDF_setdashpattern($pdfdoc, string $optlist): void |
| 1107 | { |
| 1108 | error_clear_last(); |
| 1109 | $result = \PDF_setdashpattern($pdfdoc, $optlist); |
| 1110 | if ($result === \false) { |
| 1111 | throw PdfException::createFromPhpError(); |
| 1112 | } |
| 1113 | } |
| 1114 | /** |
| 1115 | * Sets the flatness parameter. Returns TRUE on success. |
| 1116 | * |
| 1117 | * @param resource $pdfdoc |
| 1118 | * @param float $flatness |
| 1119 | * @throws PdfException |
| 1120 | * |
| 1121 | */ |
| 1122 | function PDF_setflat($pdfdoc, float $flatness): void |
| 1123 | { |
| 1124 | error_clear_last(); |
| 1125 | $result = \PDF_setflat($pdfdoc, $flatness); |
| 1126 | if ($result === \false) { |
| 1127 | throw PdfException::createFromPhpError(); |
| 1128 | } |
| 1129 | } |
| 1130 | /** |
| 1131 | * Sets the current font in the specified fontsize, using a |
| 1132 | * font handle returned by PDF_load_font. |
| 1133 | * Returns TRUE on success. |
| 1134 | * |
| 1135 | * @param resource $pdfdoc |
| 1136 | * @param int $font |
| 1137 | * @param float $fontsize |
| 1138 | * @throws PdfException |
| 1139 | * |
| 1140 | */ |
| 1141 | function PDF_setfont($pdfdoc, int $font, float $fontsize): void |
| 1142 | { |
| 1143 | error_clear_last(); |
| 1144 | $result = \PDF_setfont($pdfdoc, $font, $fontsize); |
| 1145 | if ($result === \false) { |
| 1146 | throw PdfException::createFromPhpError(); |
| 1147 | } |
| 1148 | } |
| 1149 | /** |
| 1150 | * Sets the current fill color to a gray value between 0 and 1 inclusive. |
| 1151 | * Returns TRUE on success. |
| 1152 | * |
| 1153 | * This function is deprecated since PDFlib version 4, use |
| 1154 | * PDF_setcolor instead. |
| 1155 | * |
| 1156 | * @param resource $p |
| 1157 | * @param float $g |
| 1158 | * @throws PdfException |
| 1159 | * |
| 1160 | */ |
| 1161 | function PDF_setgray_fill($p, float $g): void |
| 1162 | { |
| 1163 | error_clear_last(); |
| 1164 | $result = \PDF_setgray_fill($p, $g); |
| 1165 | if ($result === \false) { |
| 1166 | throw PdfException::createFromPhpError(); |
| 1167 | } |
| 1168 | } |
| 1169 | /** |
| 1170 | * Sets the current stroke color to a gray value between 0 and 1 inclusive. |
| 1171 | * Returns TRUE on success. |
| 1172 | * |
| 1173 | * This function is deprecated since PDFlib version 4, use |
| 1174 | * PDF_setcolor instead. |
| 1175 | * |
| 1176 | * @param resource $p |
| 1177 | * @param float $g |
| 1178 | * @throws PdfException |
| 1179 | * |
| 1180 | */ |
| 1181 | function PDF_setgray_stroke($p, float $g): void |
| 1182 | { |
| 1183 | error_clear_last(); |
| 1184 | $result = \PDF_setgray_stroke($p, $g); |
| 1185 | if ($result === \false) { |
| 1186 | throw PdfException::createFromPhpError(); |
| 1187 | } |
| 1188 | } |
| 1189 | /** |
| 1190 | * Sets the current fill and stroke color to a gray value between 0 and 1 inclusive. Returns TRUE on success. |
| 1191 | * |
| 1192 | * This function is deprecated since PDFlib version 4, use |
| 1193 | * PDF_setcolor instead. |
| 1194 | * |
| 1195 | * @param resource $p |
| 1196 | * @param float $g |
| 1197 | * @throws PdfException |
| 1198 | * |
| 1199 | */ |
| 1200 | function PDF_setgray($p, float $g): void |
| 1201 | { |
| 1202 | error_clear_last(); |
| 1203 | $result = \PDF_setgray($p, $g); |
| 1204 | if ($result === \false) { |
| 1205 | throw PdfException::createFromPhpError(); |
| 1206 | } |
| 1207 | } |
| 1208 | /** |
| 1209 | * Sets the linejoin parameter to specify the shape |
| 1210 | * at the corners of paths that are stroked. Returns TRUE on success. |
| 1211 | * |
| 1212 | * @param resource $p |
| 1213 | * @param int $value |
| 1214 | * @throws PdfException |
| 1215 | * |
| 1216 | */ |
| 1217 | function PDF_setlinejoin($p, int $value): void |
| 1218 | { |
| 1219 | error_clear_last(); |
| 1220 | $result = \PDF_setlinejoin($p, $value); |
| 1221 | if ($result === \false) { |
| 1222 | throw PdfException::createFromPhpError(); |
| 1223 | } |
| 1224 | } |
| 1225 | /** |
| 1226 | * Sets the current line width. Returns TRUE on success. |
| 1227 | * |
| 1228 | * @param resource $p |
| 1229 | * @param float $width |
| 1230 | * @throws PdfException |
| 1231 | * |
| 1232 | */ |
| 1233 | function PDF_setlinewidth($p, float $width): void |
| 1234 | { |
| 1235 | error_clear_last(); |
| 1236 | $result = \PDF_setlinewidth($p, $width); |
| 1237 | if ($result === \false) { |
| 1238 | throw PdfException::createFromPhpError(); |
| 1239 | } |
| 1240 | } |
| 1241 | /** |
| 1242 | * Explicitly sets the current transformation matrix. Returns TRUE on success. |
| 1243 | * |
| 1244 | * @param resource $p |
| 1245 | * @param float $a |
| 1246 | * @param float $b |
| 1247 | * @param float $c |
| 1248 | * @param float $d |
| 1249 | * @param float $e |
| 1250 | * @param float $f |
| 1251 | * @throws PdfException |
| 1252 | * |
| 1253 | */ |
| 1254 | function PDF_setmatrix($p, float $a, float $b, float $c, float $d, float $e, float $f): void |
| 1255 | { |
| 1256 | error_clear_last(); |
| 1257 | $result = \PDF_setmatrix($p, $a, $b, $c, $d, $e, $f); |
| 1258 | if ($result === \false) { |
| 1259 | throw PdfException::createFromPhpError(); |
| 1260 | } |
| 1261 | } |
| 1262 | /** |
| 1263 | * Sets the miter limit.Returns TRUE on success. |
| 1264 | * |
| 1265 | * @param resource $pdfdoc |
| 1266 | * @param float $miter |
| 1267 | * @throws PdfException |
| 1268 | * |
| 1269 | */ |
| 1270 | function PDF_setmiterlimit($pdfdoc, float $miter): void |
| 1271 | { |
| 1272 | error_clear_last(); |
| 1273 | $result = \PDF_setmiterlimit($pdfdoc, $miter); |
| 1274 | if ($result === \false) { |
| 1275 | throw PdfException::createFromPhpError(); |
| 1276 | } |
| 1277 | } |
| 1278 | /** |
| 1279 | * Sets the current fill color to the supplied RGB values. Returns TRUE on success. |
| 1280 | * |
| 1281 | * This function is deprecated since PDFlib version 4, use |
| 1282 | * PDF_setcolor instead. |
| 1283 | * |
| 1284 | * @param resource $p |
| 1285 | * @param float $red |
| 1286 | * @param float $green |
| 1287 | * @param float $blue |
| 1288 | * @throws PdfException |
| 1289 | * |
| 1290 | */ |
| 1291 | function PDF_setrgbcolor_fill($p, float $red, float $green, float $blue): void |
| 1292 | { |
| 1293 | error_clear_last(); |
| 1294 | $result = \PDF_setrgbcolor_fill($p, $red, $green, $blue); |
| 1295 | if ($result === \false) { |
| 1296 | throw PdfException::createFromPhpError(); |
| 1297 | } |
| 1298 | } |
| 1299 | /** |
| 1300 | * Sets the current stroke color to the supplied RGB values. Returns TRUE on success. |
| 1301 | * |
| 1302 | * This function is deprecated since PDFlib version 4, use |
| 1303 | * PDF_setcolor instead. |
| 1304 | * |
| 1305 | * @param resource $p |
| 1306 | * @param float $red |
| 1307 | * @param float $green |
| 1308 | * @param float $blue |
| 1309 | * @throws PdfException |
| 1310 | * |
| 1311 | */ |
| 1312 | function PDF_setrgbcolor_stroke($p, float $red, float $green, float $blue): void |
| 1313 | { |
| 1314 | error_clear_last(); |
| 1315 | $result = \PDF_setrgbcolor_stroke($p, $red, $green, $blue); |
| 1316 | if ($result === \false) { |
| 1317 | throw PdfException::createFromPhpError(); |
| 1318 | } |
| 1319 | } |
| 1320 | /** |
| 1321 | * Sets the current fill and stroke color to the supplied RGB values. |
| 1322 | * Returns TRUE on success. |
| 1323 | * |
| 1324 | * This function is deprecated since PDFlib version 4, use |
| 1325 | * PDF_setcolor instead. |
| 1326 | * |
| 1327 | * @param resource $p |
| 1328 | * @param float $red |
| 1329 | * @param float $green |
| 1330 | * @param float $blue |
| 1331 | * @throws PdfException |
| 1332 | * |
| 1333 | */ |
| 1334 | function PDF_setrgbcolor($p, float $red, float $green, float $blue): void |
| 1335 | { |
| 1336 | error_clear_last(); |
| 1337 | $result = \PDF_setrgbcolor($p, $red, $green, $blue); |
| 1338 | if ($result === \false) { |
| 1339 | throw PdfException::createFromPhpError(); |
| 1340 | } |
| 1341 | } |
| 1342 | /** |
| 1343 | * Prints text in the current font. Returns TRUE on success. |
| 1344 | * |
| 1345 | * @param resource $p |
| 1346 | * @param string $text |
| 1347 | * @param float $x |
| 1348 | * @param float $y |
| 1349 | * @throws PdfException |
| 1350 | * |
| 1351 | */ |
| 1352 | function PDF_show_xy($p, string $text, float $x, float $y): void |
| 1353 | { |
| 1354 | error_clear_last(); |
| 1355 | $result = \PDF_show_xy($p, $text, $x, $y); |
| 1356 | if ($result === \false) { |
| 1357 | throw PdfException::createFromPhpError(); |
| 1358 | } |
| 1359 | } |
| 1360 | /** |
| 1361 | * Prints text in the current font and size at |
| 1362 | * the current position. Returns TRUE on success. |
| 1363 | * |
| 1364 | * @param resource $pdfdoc |
| 1365 | * @param string $text |
| 1366 | * @throws PdfException |
| 1367 | * |
| 1368 | */ |
| 1369 | function PDF_show($pdfdoc, string $text): void |
| 1370 | { |
| 1371 | error_clear_last(); |
| 1372 | $result = \PDF_show($pdfdoc, $text); |
| 1373 | if ($result === \false) { |
| 1374 | throw PdfException::createFromPhpError(); |
| 1375 | } |
| 1376 | } |
| 1377 | /** |
| 1378 | * Skews the coordinate system in x and y direction by alpha |
| 1379 | * and beta degrees, respectively. Returns TRUE on success. |
| 1380 | * |
| 1381 | * @param resource $p |
| 1382 | * @param float $alpha |
| 1383 | * @param float $beta |
| 1384 | * @throws PdfException |
| 1385 | * |
| 1386 | */ |
| 1387 | function PDF_skew($p, float $alpha, float $beta): void |
| 1388 | { |
| 1389 | error_clear_last(); |
| 1390 | $result = \PDF_skew($p, $alpha, $beta); |
| 1391 | if ($result === \false) { |
| 1392 | throw PdfException::createFromPhpError(); |
| 1393 | } |
| 1394 | } |
| 1395 | /** |
| 1396 | * Strokes the path with the current color and line width, and clear it. |
| 1397 | * Returns TRUE on success. |
| 1398 | * |
| 1399 | * @param resource $p |
| 1400 | * @throws PdfException |
| 1401 | * |
| 1402 | */ |
| 1403 | function PDF_stroke($p): void |
| 1404 | { |
| 1405 | error_clear_last(); |
| 1406 | $result = \PDF_stroke($p); |
| 1407 | if ($result === \false) { |
| 1408 | throw PdfException::createFromPhpError(); |
| 1409 | } |
| 1410 | } |
| 1411 |