PHP Doku:: Erstellt ein Lesezeichen - function.pdf-create-bookmark.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzNon-Text MIME-AusgabenPDFPDF FunktionenPDF_create_bookmark

Ein Service von Reinhard Neidl - Webprogrammierung.

PDF Funktionen

<<PDF_create_annotation

PDF_create_field>>

PDF_create_bookmark

(PECL pdflib >= 2.0.0)

PDF_create_bookmarkErstellt ein Lesezeichen

Beschreibung

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

Erzeugt ein Lesezeichen mit verschiedenen Optionen.


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
mryan *at* carleton *daught* edu
28.04.2009 0: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, '');
?>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)