Added a helper function that calls the most commonly used TCPDF functions to render provided content on the PDF
This commit is contained in:
parent
49a04bc7a3
commit
ee37ccf7e5
1 changed files with 13 additions and 0 deletions
|
@ -211,6 +211,19 @@ class customcert_element_base {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Common behaviour for rendering specified content on the pdf.
|
||||
*
|
||||
* @param stdClass $pdf the pdf object
|
||||
* @param stdClass $content the content to render
|
||||
*/
|
||||
public function render_content($pdf, $content) {
|
||||
$pdf->setFont($this->element->font, '', $this->element->size);
|
||||
$fontcolour = TCPDF_COLORS::convertHTMLColorToDec($this->element->colour, $fontcolour);
|
||||
$pdf->SetTextColor($fontcolour['R'], $fontcolour['G'], $fontcolour['B']);
|
||||
$pdf->writeHTMLCell(0, 0, $this->element->posx, $this->element->posy, $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles deleting any data this element may have introduced.
|
||||
* Can be overriden if more functionality is needed.
|
||||
|
|
Loading…
Reference in a new issue