mPDF Manual – mPDF functions

# Bookmark()

(mPDF >= 1.0)

Bookmark – Add a Bookmark to the document

void Bookmark ( string $content [, int$level [, float $y ]]) Add a Bookmark to the document. Bookmarks appear in Adobe Reader and link to specific points in the text. The target is set as the current writing position in the document when the Bookmark is defined. ## Parameters$content

Specifies the text to appear as a Bookmark.

$content cannot contain any of the characters: < > & ‘ or “ and must use the appropriate HTML entities e.g. <annotation content=”This is &lt; 40” /> It is recommended that you use htmlspecialchars(‘Content’, ENT_QUOTES) for this.$level

$level specifies the “tree” level for the Bookmark. The top level is 0. See Example 2 below. Accepts an integer from 0 to the maximum depth you wish. DEFAULT: 0$y

\$y specifies the y-coordinate on the page for the Bookmark. The top of the page is 0. The default is the current writing position on the page.

#

Example #1

Example #2