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

search for in the

PDF_initgraphics> <PDF_info_textflow
[edit] Last updated: Fri, 25 May 2012

view this page in

PDF_info_textline

(PECL pdflib >= 2.1.0)

PDF_info_textlineテキストの行のフォーマットを行い、メトリクスを問い合わせる

説明

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

テキストの行のフォーマットを行い、その結果のメトリクスを問い合わせます。



add a note add a note User Contributed Notes PDF_info_textline
nico 16-Jul-2009 04: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, '');
}
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites