ar_last(); $result = \PDF_set_layer_dependency($pdfdoc, $type, $optlist); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets some PDFlib parameter with string type. Returns TRUE on success. * * @param resource $p * @param string $key * @param string $value * @throws PdfException * */ function PDF_set_parameter($p, string $key, string $value): void { error_clear_last(); $result = \PDF_set_parameter($p, $key, $value); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the position for text output on the page. Returns TRUE on success. * * @param resource $p * @param float $x * @param float $y * @throws PdfException * */ function PDF_set_text_pos($p, float $x, float $y): void { error_clear_last(); $result = \PDF_set_text_pos($p, $x, $y); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the value of some PDFlib parameter with numerical type. Returns TRUE on success. * * @param resource $p * @param string $key * @param float $value * @throws PdfException * */ function PDF_set_value($p, string $key, float $value): void { error_clear_last(); $result = \PDF_set_value($p, $key, $value); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current color space and color. Returns TRUE on success. * * @param resource $p * @param string $fstype * @param string $colorspace * @param float $c1 * @param float $c2 * @param float $c3 * @param float $c4 * @throws PdfException * */ function PDF_setcolor($p, string $fstype, string $colorspace, float $c1, float $c2, float $c3, float $c4): void { error_clear_last(); $result = \PDF_setcolor($p, $fstype, $colorspace, $c1, $c2, $c3, $c4); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current dash pattern to b black * and w white units. Returns TRUE on success. * * @param resource $pdfdoc * @param float $b * @param float $w * @throws PdfException * */ function PDF_setdash($pdfdoc, float $b, float $w): void { error_clear_last(); $result = \PDF_setdash($pdfdoc, $b, $w); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets a dash pattern defined by an option list. Returns TRUE on success. * * @param resource $pdfdoc * @param string $optlist * @throws PdfException * */ function PDF_setdashpattern($pdfdoc, string $optlist): void { error_clear_last(); $result = \PDF_setdashpattern($pdfdoc, $optlist); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the flatness parameter. Returns TRUE on success. * * @param resource $pdfdoc * @param float $flatness * @throws PdfException * */ function PDF_setflat($pdfdoc, float $flatness): void { error_clear_last(); $result = \PDF_setflat($pdfdoc, $flatness); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current font in the specified fontsize, using a * font handle returned by PDF_load_font. * Returns TRUE on success. * * @param resource $pdfdoc * @param int $font * @param float $fontsize * @throws PdfException * */ function PDF_setfont($pdfdoc, int $font, float $fontsize): void { error_clear_last(); $result = \PDF_setfont($pdfdoc, $font, $fontsize); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current fill color to a gray value between 0 and 1 inclusive. * Returns TRUE on success. * * This function is deprecated since PDFlib version 4, use * PDF_setcolor instead. * * @param resource $p * @param float $g * @throws PdfException * */ function PDF_setgray_fill($p, float $g): void { error_clear_last(); $result = \PDF_setgray_fill($p, $g); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current stroke color to a gray value between 0 and 1 inclusive. * Returns TRUE on success. * * This function is deprecated since PDFlib version 4, use * PDF_setcolor instead. * * @param resource $p * @param float $g * @throws PdfException * */ function PDF_setgray_stroke($p, float $g): void { error_clear_last(); $result = \PDF_setgray_stroke($p, $g); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current fill and stroke color to a gray value between 0 and 1 inclusive. Returns TRUE on success. * * This function is deprecated since PDFlib version 4, use * PDF_setcolor instead. * * @param resource $p * @param float $g * @throws PdfException * */ function PDF_setgray($p, float $g): void { error_clear_last(); $result = \PDF_setgray($p, $g); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the linejoin parameter to specify the shape * at the corners of paths that are stroked. Returns TRUE on success. * * @param resource $p * @param int $value * @throws PdfException * */ function PDF_setlinejoin($p, int $value): void { error_clear_last(); $result = \PDF_setlinejoin($p, $value); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current line width. Returns TRUE on success. * * @param resource $p * @param float $width * @throws PdfException * */ function PDF_setlinewidth($p, float $width): void { error_clear_last(); $result = \PDF_setlinewidth($p, $width); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Explicitly sets the current transformation matrix. Returns TRUE on success. * * @param resource $p * @param float $a * @param float $b * @param float $c * @param float $d * @param float $e * @param float $f * @throws PdfException * */ function PDF_setmatrix($p, float $a, float $b, float $c, float $d, float $e, float $f): void { error_clear_last(); $result = \PDF_setmatrix($p, $a, $b, $c, $d, $e, $f); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the miter limit.Returns TRUE on success. * * @param resource $pdfdoc * @param float $miter * @throws PdfException * */ function PDF_setmiterlimit($pdfdoc, float $miter): void { error_clear_last(); $result = \PDF_setmiterlimit($pdfdoc, $miter); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current fill color to the supplied RGB values. Returns TRUE on success. * * This function is deprecated since PDFlib version 4, use * PDF_setcolor instead. * * @param resource $p * @param float $red * @param float $green * @param float $blue * @throws PdfException * */ function PDF_setrgbcolor_fill($p, float $red, float $green, float $blue): void { error_clear_last(); $result = \PDF_setrgbcolor_fill($p, $red, $green, $blue); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current stroke color to the supplied RGB values. Returns TRUE on success. * * This function is deprecated since PDFlib version 4, use * PDF_setcolor instead. * * @param resource $p * @param float $red * @param float $green * @param float $blue * @throws PdfException * */ function PDF_setrgbcolor_stroke($p, float $red, float $green, float $blue): void { error_clear_last(); $result = \PDF_setrgbcolor_stroke($p, $red, $green, $blue); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Sets the current fill and stroke color to the supplied RGB values. * Returns TRUE on success. * * This function is deprecated since PDFlib version 4, use * PDF_setcolor instead. * * @param resource $p * @param float $red * @param float $green * @param float $blue * @throws PdfException * */ function PDF_setrgbcolor($p, float $red, float $green, float $blue): void { error_clear_last(); $result = \PDF_setrgbcolor($p, $red, $green, $blue); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Prints text in the current font. Returns TRUE on success. * * @param resource $p * @param string $text * @param float $x * @param float $y * @throws PdfException * */ function PDF_show_xy($p, string $text, float $x, float $y): void { error_clear_last(); $result = \PDF_show_xy($p, $text, $x, $y); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Prints text in the current font and size at * the current position. Returns TRUE on success. * * @param resource $pdfdoc * @param string $text * @throws PdfException * */ function PDF_show($pdfdoc, string $text): void { error_clear_last(); $result = \PDF_show($pdfdoc, $text); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Skews the coordinate system in x and y direction by alpha * and beta degrees, respectively. Returns TRUE on success. * * @param resource $p * @param float $alpha * @param float $beta * @throws PdfException * */ function PDF_skew($p, float $alpha, float $beta): void { error_clear_last(); $result = \PDF_skew($p, $alpha, $beta); if ($result === false) { throw PdfException::createFromPhpError(); } } /** * Strokes the path with the current color and line width, and clear it. * Returns TRUE on success. * * @param resource $p * @throws PdfException * */ function PDF_stroke($p): void { error_clear_last(); $result = \PDF_stroke($p); if ($result === false) { throw PdfException::createFromPhpError(); } }