downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

PDF_create_field> <PDF_create_annotation
Last updated: Fri, 20 Nov 2009

view this page in

PDF_create_bookmark

(PECL pdflib >= 2.0.0)

PDF_create_bookmarkCreate bookmark

Description

int PDF_create_bookmark ( resource $pdfdoc , string $text , string $optlist )

Creates a bookmark subject to various options.



add a note add a note User Contributed Notes
PDF_create_bookmark
mryan *at* carleton *daught* edu
27-Apr-2009 10:17
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, '');
?>

PDF_create_field> <PDF_create_annotation
Last updated: Fri, 20 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites