src/Pdf.php
public function addToc($options = array())
    {
        $options['input'] = ($this->version9 ? '--' : '') . 'toc';
        $this->_objects[] = $this->ensureUrlOrFileOptions($options);
        return $this;
    }
public function addToc($options = array())
    {
        $options['input'] = ($this->version9 ? '--' : '') . 'toc';
        $this->_objects[] = $this->ensureUrlOrFileOptions($options);
        return $this;
    }
Add a TOC object to the output

@param array $options optional options for the table of contents
@return static the Pdf instance for method chaining