Dompdf\Canvas
Main rendering interface
Currently , , and 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.
Synopsis
interface Canvas
{
- // methods
- public void __construct()
- public Dompdf get_dompdf()
- public int get_page_number()
- public int get_page_count()
- public void set_page_count()
- public void line()
- public void rectangle()
- public void filled_rectangle()
- public void clipping_rectangle()
- public clipping_roundrectangle()
- public void clipping_end()
- public void save()
- public void restore()
- public void rotate()
- public void skew()
- public void scale()
- public void translate()
- public transform()
- public void polygon()
- public void circle()
- public void image()
- public void arc()
- public void text()
- public void add_named_dest()
- public void add_link()
- public void add_info()
- public float get_text_width()
- public float get_font_height()
- public float get_font_baseline()
- public float get_width()
- public float get_height()
- public void set_opacity()
- public void set_default_view()
- public void javascript()
- public void new_page()
- public void stream()
- public string output()
Methods
public
- __construct()
- add_info() — Add meta information to the pdf
- add_link() — Add a link to the pdf
- add_named_dest() — Add a named destination (similar to <a name="foo">...</a> in html)
- arc() — Add an arc to the PDF See {@link Style::munge_color()} for the format of the color array.
- circle() — Draws a circle at $x,$y with radius $r
- clipping_end() — Ends the last clipping shape
- clipping_rectangle() — Starts a clipping rectangle at x1,y1 with width w and height h
- clipping_roundrectangle() — Starts a rounded clipping rectangle at x1,y1 with width w and height h
- filled_rectangle() — Draws a filled rectangle at x1,y1 with width w and height h
- get_dompdf()
- get_font_baseline() — Calculates font baseline, in points
- get_font_height() — Calculates font height, in points
- get_height() — Return the image's height in pixels
- get_page_count() — Returns the total number of pages
- get_page_number() — Returns the current page number
- get_text_width() — Calculates text size, in points
- get_width() — Returns the PDF's width in points
- image() — Add an image to the pdf.
- javascript()
- line() — Draws a line from x1,y1 to x2,y2
- new_page() — Starts a new page
- output() — Returns the PDF as a string.
- polygon() — Draws a polygon
- rectangle() — Draws a rectangle at x1,y1 with width w and height h
- restore() — Restore last state
- rotate() — Rotate
- save() — Save current state
- scale() — Scale
- set_default_view() — Sets the default view
- set_opacity() — Sets the opacity
- set_page_count() — Sets the total number of pages
- skew() — Skew
- stream() — Streams the PDF directly to the browser.
- text() — Writes text at the specified x and y coordinates See {@link Style::munge_color()} for the format of the color array.
- transform() — Transform
- translate() — Translate