Single
class Single extends AbstractWriter
Methods
Add Single Line content to PDF
Add Single Line content to PDF with center alignment
Add Single Line content to PDF with right alignment
Details
at line 75
add(string $html, array $position = [], string $overflow = 'auto')
Add Single Line content to PDF
Add content to the PDF that has a fixed positioned and is better suited for a single line of text (the line height matches the font size for more accurate positioning). This is the main way you overlay content onto your PDF documents.
The $position
is always calculated in millimeters and the units should NOT be included.
By default, if the text extends outside the container it will be shrunk to fit (this can be overriden).
All content added with this method will be wrapped in a DIV with the class .single
for more convenient styling.
Example
// Add content to the current page positioned 20mm from the left, 50mm from the top, with a width of 30mm and a height of 5mm
$w->add( 'My content', [ 20, 50, 30, 5 ] );
// Instead of shrinking the content to fit the container, the 'visible' property will allow it to overflow the container
$w->add( 'My content', [ 20, 50, 30, 5 ], 'visible' );
at line 113
addCenter(string $html, array $position = [], string $overflow = 'auto')
Add Single Line content to PDF with center alignment
at line 134
addRight(string $html, array $position = [], string $overflow = 'auto')
Add Single Line content to PDF with right alignment