Main rendering interface
Currently {@link Dompdf\Adapter\CPDF}, {@link Dompdf\Adapter\PDFLib}, and {@link Dompdf\Adapter\GD} implement this interface.
Implementations should measure x and y increasing to the left and down, respectively, with the origin in the top left corner. Implementations are free to use a unit other than points for length, but I can't guarantee that the results will look any good.
| Methods | ||
|---|---|---|
public
|
__construct(string|float[] $paper = "letter", string $orientation = "portrait", Dompdf|null $dompdf = null)
|
# |
public
|
get_dompdf(): Dompdf
|
# |
public
|
get_page_number(): int
|
# |
public
|
get_page_count(): int
|
# |
public
|
set_page_count(int $count)
|
# |
public
|
line(float $x1, float $y1, float $x2, float $y2, array $color, float $width, array $style = [], string $cap = "butt")
|
# |
public
|
arc(
float $x,
float $y,
float $r1,
float $r2,
float $astart,
float $aend,
array $color,
float $width,
array $style = [],
string $cap = "butt",
)
|
# |
public
|
rectangle(float $x1, float $y1, float $w, float $h, array $color, float $width, array $style = [], string $cap = "butt")
|
# |
public
|
filled_rectangle(float $x1, float $y1, float $w, float $h, array $color)
|
# |
public
|
clipping_rectangle(float $x1, float $y1, float $w, float $h)
|
# |
public
|
clipping_roundrectangle(float $x1, float $y1, float $w, float $h, float $tl, float $tr, float $br, float $bl)
|
# |
public
|
clipping_polygon(float[] $points): void
|
# |
public
|
clipping_end()
|
# |
public
|
page_script(callable $callback): void
|
# |
public
|
page_text(
float $x,
float $y,
string $text,
string $font,
float $size,
array $color = [0, 0, 0],
float $word_space = 0.0,
float $char_space = 0.0,
float $angle = 0.0,
)
|
# |
public
|
page_line(float $x1, float $y1, float $x2, float $y2, array $color, float $width, array $style = [])
|
# |
public
|
save()
|
# |
public
|
restore()
|
# |
public
|
rotate(float $angle, float $x, float $y)
|
# |
public
|
skew(float $angle_x, float $angle_y, float $x, float $y)
|
# |
public
|
scale(float $s_x, float $s_y, float $x, float $y)
|
# |
public
|
translate(float $t_x, float $t_y)
|
# |
public
|
transform(float $a, float $b, float $c, float $d, float $e, float $f)
|
# |
public
|
polygon(array $points, array $color, float $width = null, array $style = [], bool $fill = false)
|
# |
public
|
circle(float $x, float $y, float $r, array $color, float $width = null, array $style = [], bool $fill = false)
|
# |
public
|
image(string $img, float $x, float $y, float $w, float $h, string $resolution = "normal")
|
# |
public
|
text(
float $x,
float $y,
string $text,
string $font,
float $size,
array $color = [0, 0, 0],
float $word_space = 0.0,
float $char_space = 0.0,
float $angle = 0.0,
)
|
# |
public
|
add_named_dest(string $anchorname)
|
# |
public
|
add_link(string $url, float $x, float $y, float $width, float $height)
|
# |
public
|
add_info(string $label, string $value): void
|
# |
public
|
get_text_width(string $text, string $font, float $size, float $word_spacing = 0.0, float $char_spacing = 0.0): float
|
# |
public
|
get_font_height(string $font, float $size): float
|
# |
public
|
get_font_baseline(string $font, float $size): float
|
# |
public
|
get_width(): float
|
# |
public
|
get_height(): float
|
# |
public
|
set_opacity(float $opacity, string $mode = "Normal"): void
|
# |
public
|
set_default_view(string $view, array $options = [])
|
# |
public
|
javascript(string $code)
|
# |
public
|
new_page()
|
# |
public
|
stream(string $filename, array $options = [])
|
# |
public
|
output(array $options = []): string
|
# |