Render

HTML cell rendering driver.

Namespace: Com\Tecnick\Pdf\HTML

trait Render

Source: src/HTML/Render.php:45

HTML cell rendering driver.

Methods

addHTMLCell()

Adds an HTML block inside a rectangular cell.

Accounts for automatic page and region breaks while appending page-specific content directly to each affected page stream.

public addHTMLCell(
    string $html,
    float $posx = 0,
    float $posy = 0,
    float $width = 0,
    float $height = 0,
    ?TCellDef $cell = null,
    array<int|string,BorderStyle> $styles = []
): void

Parameters:

  • $html (string): HTML code to be processed.
  • $posx (float): Abscissa of upper-left corner.
  • $posy (float): Ordinate of upper-left corner.
  • $width (float): Width.
  • $height (float): Height.
  • $cell (?TCellDef): Optional to overwrite cell parameters for padding, margin etc. The margin and padding values are in points.
  • $styles (array<int|string,BorderStyle>): Cell border styles (see: getCurrentStyleArray).

Throws:

Source: src/HTML/Render.php:1080

getHTMLCell()

Returns the PDF code to render an HTML block inside a rectangular cell.

The content is laid out on the current page: content taller than the remaining region continues below it. Use addHTMLCell() for content that continues on the following pages.

public getHTMLCell(
    string $html,
    float $posx = 0,
    float $posy = 0,
    float $width = 0,
    float $height = 0,
    ?TCellDef $cell = null,
    array<int|string,BorderStyle> $styles = []
): string

Parameters:

  • $html (string): HTML code to be processed.
  • $posx (float): Abscissa of upper-left corner.
  • $posy (float): Ordinate of upper-left corner.
  • $width (float): Width.
  • $height (float): Height.
  • $cell (?TCellDef): Optional to overwrite cell parameters for padding, margin etc. The margin and padding values are in points.
  • $styles (array<int|string,BorderStyle>): Cell border styles (see: getCurrentStyleArray).

Returns: string

Throws:

Source: src/HTML/Render.php:977

getLastHTMLCellEnd()

Returns the page and the ordinate (user units) of the bottom of the last block rendered by getHTMLCell() or addHTMLCell(). A following block placed at this ordinate on this page starts right below it. The page is -1 before the first call.

public getLastHTMLCellEnd(): array{page: int, y: float}

Returns: array{page: int, y: float}

Source: src/HTML/Render.php:948