PHP Doku:: Formatiert Textzeile und ermittelt Metrikdaten - function.pdf-info-textline.html

Verlauf / Chronik / History: (13) anzeigen

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

Ein Service von Reinhard Neidl - Webprogrammierung.

PDF Funktionen

<<PDF_info_textflow

PDF_initgraphics>>

PDF_info_textline

(PECL pdflib >= 2.1.0)

PDF_info_textlineFormatiert Textzeile und ermittelt Metrikdaten

Beschreibung

float PDF_info_textline ( resource $pdfdoc , string $text , string $keyword , string $optlist )

Formatiert eine Textzeile und ermittelt die daraus resultierenden Metrikdaten.


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
nico
17.07.2009 1:18
You can use PDF_info_textline to center some text in the page.

Here's a little function

<?php
// Parameters:
// $p -> the PDF handle
// $text -> the text to center
// $posy -> the vertical position of the text
// $pageWidth -> the width of the page, defaults to 595 (A4)
function center_text($p, $text, $posy, $pageWidth=595)
    {
   
$width = PDF_info_textline($p, $text, 'width', '');
   
PDF_fit_textline($p, $text, ($pageWidth-$width)/2, $posy, '');
}
?>



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",...)