public function footnotes()
    {
        foreach ($this->printedfootnotes as $element) {
            if (($this->GetY() + $element->getFootnoteHeight($this)) > $this->getPageHeight()) {
                $this->AddPage();
            }

            $element->renderFootnote($this);

            if ($this->GetY() > $this->getPageHeight()) {
                $this->AddPage();
            }
        }
    }