(PECL pdflib >= 2.0.0)
PDF_create_bookmark — Erstellt ein Lesezeichen
Erzeugt ein Lesezeichen mit verschiedenen Optionen.
This function expects either basic ASCII or UTF-16 with a BOM (byte order mark) at the beginning of the string. Any other multibyte encoding (like UTF-8) will be treated as garbage, or in some situations may produce a fatal error.
Here's the solution I came up with, for making a bookmark from a UTF-8 string. The pack() function creates the BOM.
<?php
$bookmark = 'a UTF-8 string';
$bookmark = pack('H*','feff').mb_convert_encoding($bookmark, 'UTF-16', 'UTF-8');
PDF_create_bookmark($p, $bookmark, '');
?>