Dompdf\Adapter\PDFLib
PDF rendering interface
Dompdf\Adapter\PDFLib provides a simple, stateless interface to the one
provided by PDFLib.
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 PDFlib functions.
Synopsis
class PDFLib
implements
Canvas
{
- // members
- public static array; $PAPER_SIZES = ;
- public static bool $IN_MEMORY = true;
- private Dompdf $_dompdf;
- private PDFlib $_pdf;
- private $_file;
- private $_width;
- private $_height;
- private $_last_fill_color;
- private $_last_stroke_color;
- private $_current_opacity;
- private $_imgs;
- private $_fonts;
- private $_objs;
- private array $_gstates = ;
- private $_page_number;
- private $_page_count;
- private $_page_text;
- private $_pages;
- // methods
- public void __construct()
- public Dompdf get_dompdf()
- protected void _close()
- public PDFLib get_pdflib()
- public void add_info()
- public int open_object()
- public void reopen_object()
- public void close_object()
- public void add_object()
- public void stop_object()
- protected void _place_objects()
- public float|mixed get_width()
- public float|mixed 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_line_style()
- protected void _set_stroke_color()
- protected void _set_fill_color()
- public void _set_fill_opacity()
- public void _set_stroke_opacity()
- public void set_opacity()
- public int _set_gstate()
- public void set_default_view()
- protected int _load_font()
- protected float y()
- public void line()
- public void arc()
- 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 mixed get_text_width()
- public float get_font_height()
- public float get_font_baseline()
- public void page_text()
- public void page_script()
- public void new_page()
- protected void _add_page_text()
- public void stream()
- public string output()
Hierarchy
Implements
Tasks
Line | Task |
---|---|
198 | fetch PDFLib version information for the producer field |
635 | |
858 |
Members
private
- $_current_opacity
—
array
The current opacity level - $_dompdf — Dompdf\Dompdf
- $_file
—
string
Name of temporary file used for PDFs created on disk - $_fonts
—
array
Cache of font handles - $_gstates
—
array
List of gstate objects created for this PDF (for reuse) - $_height
—
float
PDF height, in points - $_imgs
—
array
Cache of image handles - $_last_fill_color
—
array
Last fill color used - $_last_stroke_color
—
array
Last stroke color used - $_objs
—
array
List of objects (templates) to add to multiple pages - $_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
—
\PDFlib
Instance of PDFLib class - $_width
—
float
PDF width, in points
public
- $IN_MEMORY
—
Dompdf\Adapter\bool
Whether to create PDFs in memory or on disk - $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
- _close() — Close the pdf
- _load_font() — Loads a specific font and stores the corresponding descriptor.
- _place_objects() — Add all active objects to the current page
- _set_fill_color() — Sets the fill color
- _set_line_style() — Sets the line style
- _set_stroke_color() — Sets the line color
- y() — Remaps y coords from 4th to 1st quadrant
public
- __construct() — Class constructor
- _set_fill_opacity() — Sets the fill opacity
- _set_gstate() — Sets the gstate
- _set_stroke_opacity() — Sets the stroke opacity
- 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 the specified object to the document
- arc()
- circle()
- clipping_end()
- clipping_rectangle()
- clipping_roundrectangle()
- close_object() — Close the current template
- filled_rectangle()
- get_dompdf()
- get_font_baseline()
- get_font_height()
- get_height()
- get_page_count()
- get_page_number()
- get_pdflib() — Returns the PDFLib instance
- get_text_width()
- get_width()
- image()
- javascript()
- line()
- new_page()
- open_object() — Opens a new 'object' (template in PDFLib-speak)
- 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()
- reopen_object() — Reopen an existing object (NOT IMPLEMENTED) PDFLib does not seem to support reopening templates.
- restore()
- rotate()
- save()
- scale()
- set_default_view()
- set_opacity() — Sets the opacity
- set_page_count()
- set_page_number()
- skew()
- stop_object() — Stops the specified template from appearing in the document.
- stream() — Streams the PDF to the client.
- text()
- transform()
- translate()