Dompdf\Adapter\CPDF
PDF rendering interface
Dompdf\Adapter\CPDF provides a simple stateless interface to the stateful one
provided by the Cpdf class.
Unless otherwise mentioned, all dimensions are in points (1/72 in). The
coordinate origin is in the top left corner, and y values increase
downwards.
See for more complete documentation
on the underlying class.
Synopsis
class CPDF
implements
Canvas
{
- // members
- public static array; $PAPER_SIZES = ;
- private Dompdf $_dompdf;
- private Cpdf $_pdf;
- private $_width;
- private float; $_height;
- private $_page_number;
- private $_page_count;
- private $_page_text;
- private $_pages;
- private $_image_cache;
- private integer $_current_opacity = 1;
- // methods
- public void __construct()
- public Dompdf get_dompdf()
- public void __destruct()
- public Cpdf get_cpdf()
- public void add_info()
- public int open_object()
- public void reopen_object()
- public void close_object()
- public void add_object()
- public void stop_object()
- public void serialize_object()
- public void reopen_serialized_object()
- public float get_width()
- public float get_height()
- public int get_page_number()
- public int get_page_count()
- public void set_page_number()
- public void set_page_count()
- protected void _set_stroke_color()
- protected void _set_fill_color()
- protected void _set_line_transparency()
- protected void _set_fill_transparency()
- protected void _set_line_style()
- public void set_opacity()
- public void set_default_view()
- protected float y()
- public void line()
- public void arc()
- protected string _convert_gif_bmp_to_png()
- public void rectangle()
- public void filled_rectangle()
- public void clipping_rectangle()
- public void 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 void transform()
- public void polygon()
- public void circle()
- public void image()
- public void text()
- public void javascript()
- public void add_named_dest()
- public void add_link()
- public float|int get_text_width()
- public void register_string_subset()
- public float|int get_font_height()
- public float get_font_baseline()
- public void page_text()
- public void page_script()
- public int new_page()
- protected void _add_page_text()
- public void stream()
- public string output()
- public string get_messages()
Hierarchy
Implements
Members
private
- $_current_opacity
—
float
Currently-applied opacity level (0 - 1) - $_dompdf
—
Dompdf\Dompdf
The Dompdf object - $_height
—
Dompdf\Adapter\float;
PDF height, in points - $_image_cache
—
array
Array of temporary cached images to be deleted when processing is complete - $_page_count
—
int
Total number of pages - $_page_number
—
int
Current page number - $_page_text
—
array
Text to display on every page - $_pages
—
array
Array of pages for accesing after rendering is initially complete - $_pdf
—
Dompdf\Adapter\Cpdf
Instance of Cpdf class - $_width
—
float
PDF width, in points
public
- $PAPER_SIZES
—
Dompdf\Adapter\array;
Dimensions of paper sizes in points
Methods
protected
- _add_page_text() — Add text to each page after rendering is complete
- _convert_gif_bmp_to_png() — Convert a GIF or BMP image to a PNG image
- _set_fill_color() — Sets the fill colour
- _set_fill_transparency() — Sets fill transparency
- _set_line_style() — Sets the line style
- _set_line_transparency() — Sets line transparency
- _set_stroke_color() — Sets the stroke color
- y() — Remaps y coords from 4th to 1st quadrant
public
- __construct() — Class constructor
- __destruct() — Class destructor
- 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)
- add_object() — Adds a specified 'object' to the document
- arc()
- circle()
- clipping_end()
- clipping_rectangle()
- clipping_roundrectangle()
- close_object() — Closes the current 'object'
- filled_rectangle()
- get_cpdf() — Returns the Cpdf instance
- get_dompdf()
- get_font_baseline()
- get_font_height()
- get_height() — Returns the PDF's height in points
- get_messages() — Returns logging messages generated by the Cpdf class
- get_page_count() — Returns the total number of pages in the document
- get_page_number() — Returns the current page number
- get_text_width()
- get_width() — Returns the PDF's width in points
- image()
- javascript()
- line() — Canvas implementation
- new_page()
- open_object() — Opens a new 'object'
- output() — Returns the PDF as a string.
- page_script() — Processes a script on every page
- page_text() — Writes text at the specified x and y coordinates on every page
- polygon()
- rectangle()
- register_string_subset()
- reopen_object() — Reopens an existing 'object'
- reopen_serialized_object()
- restore()
- rotate()
- save()
- scale()
- serialize_object()
- set_default_view()
- set_opacity() — Sets the opacity
- set_page_count() — Sets the page count
- set_page_number() — Sets the current page number
- skew()
- stop_object() — Stops the specified 'object' from appearing in the document.
- stream() — Streams the PDF to the client.
- text()
- transform()
- translate()