Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$title is deprecated in /home/www/dev/work/website/lvesu/class/controller/blog/php.php on line 28

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/php.manual.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
PHP - Manual: PDF_create_textflow - 互联网笔记

略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: PDF_create_textflow

2025-07-03

PDF_create_textflow

(PECL pdflib >= 2.0.0)

PDF_create_textflowCreate textflow object

说明

PDF_create_textflow ( resource $pdfdoc , string $text , string $optlist ) : int

Preprocesses text for later formatting and creates a textflow object.

add a note add a note

User Contributed Notes 3 notes

up
0
Hangumk
10 years ago
Not much documentation except the latest Pdflib manual, but either way the textlen is not required.

I have this and it works for me:

$opts = "fontname={$this->font[0]->_name} fontsize=$font_size encoding=$font_encoding alignment=$align ";
if ($indent) {
   $opts .= "leftindent=$indent ";
}
$textflow = pdf_create_textflow($this->_pdf,$data,$opts);

I've been working with the pdflib v7 for 2 months now, and since there's virtually no documentation on anythign except their manual, I recommend reading it. It's pretty good and detailed.
up
0
Alexandre Lveill
11 years ago
I had trouble trouble adding the created textflow to the PDF. The create_textflow() method always returned 0 no matter how many textFlow I created until I added "textlen" to the optlist like this :

<?php
$length
= strlen($infoJob['descriptionFac']);       
$optlist = "fontname=Helvetica textlen=".$length." fontsize=".$fontSize." encoding=winansi";
?>

I don't know why, but apparently, in my case, textlen was a mandatory option...
up
-1
michal at g-v dot cz
6 years ago
Textflow not supported in PDFlib Lite

官方地址:https://www.php.net/manual/en/function.pdf-create-textflow.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3