note 90551 added to function.pdf-create-bookmark
| From: | mryan*at*carleton*daught*edu at osu1 dot php dot net | Date: | Mon, 27 Apr 2009 22:17:21 +0000 |
| Subject: | note 90551 added to function.pdf-create-bookmark | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-153867@lists.php.net to get a copy of this message | ||
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, '');
?>
----
Server IP: 209.41.74.194
Probable Submitter: 137.22.191.153
----
Manual Page -- http://www.php.net/manual/en/function.pdf-create-bookmark.php
Edit -- https://master.php.net/note/edit/90551
Del: integrated -- https://master.php.net/note/delete/90551/integrated
Del: useless -- https://master.php.net/note/delete/90551/useless
Del: bad code -- https://master.php.net/note/delete/90551/bad+code
Del: spam -- https://master.php.net/note/delete/90551/spam
Del: non-english -- https://master.php.net/note/delete/90551/non-english
Del: in docs -- https://master.php.net/note/delete/90551/in+docs
Del: other reasons-- https://master.php.net/note/delete/90551
Reject -- https://master.php.net/note/reject/90551
Search -- https://master.php.net/manage/user-notes.php