Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

annotation_pdf_class()

Description

Utility function to generate a one-off TCPDF variant (with multiRow method)

Parameters

This function accepts no parameters.

Location

include/annotation_functions.php lines 1001 to 1041

Definition

 
function annotation_pdf_class()
{
    include_once 
dirname(__DIR__) . '/lib/html2pdf/vendor/tecnickcom/tcpdf/tcpdf.php';
    return new class extends 
TCPDF {
        public function 
multiRow($left$right)
        {

            
$page_start $this->getPage();
            
$y_start $this->GetY();

            
// write the left cell
            
$this->MultiCell(.50$left1'C'12''''true0);

            
$page_end_1 $this->getPage();
            
$y_end_1 $this->GetY();

            
$this->setPage($page_start);

            
// write the right cell
            
$right str_replace("<br />""\n"$right);
            
$this->MultiCell(00$right1'L'01$this->GetX(), $y_starttrue0);

            
$page_end_2 $this->getPage();
            
$y_end_2 $this->GetY();

            
// set the new row position by case
            
if (max($page_end_1$page_end_2) == $page_start) {
                
$ynew max($y_end_1$y_end_2);
            } elseif (
$page_end_1 == $page_end_2) {
                
$ynew max($y_end_1$y_end_2);
            } elseif (
$page_end_1 $page_end_2) {
                
$ynew $y_end_1;
            } else {
                
$ynew $y_end_2;
            }

            
$this->setPage(max($page_end_1$page_end_2));
            
$this->SetXY($this->GetX(), $ynew);
        }
    };
}

This article was last updated 4th July 2025 18:35 Europe/London time based on the source file dated 4th July 2025 10:35 Europe/London time.