带有HTML标签的FPDF文本 [英] FPDF Text with HTML tags

查看:183
本文介绍了带有HTML标签的FPDF文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用FPDF创建一个A4大小的PDF,我可以添加文本/图像,并且工作正常。我有一个动态生成的字符串,其中包含一些HTML标记(BR等),并想知道如何将该输出放到PDF上,而不是将字符串打印出来。

  $ center = urldecode($ row_CertDetails ['centre_name']); 

$ pdf->文字(10,110,$ center);

我在一些论坛上看到有人提到 WriteHTML ,但是我的版本的FPDF似乎没有包含这个。



它是一个附加组件吗?

解决方案

是的,它是一个附加组件:




作者:ClémentLavoillotte

许可证:FPDF



这是支持的标签有:...

请参阅编写HTML FPDF脚本#42 ,我认为它是最新版本,但请随时浏览FPDF脚本/插件


I'm using FPDF to create an A4 sized PDF, I can add text/images and this is working fine. I have a dynamically generated string which contains some HTML tags (BR etc) and was wondering how I can have that output onto the PDF as opposed to literally printing the tags out.

$centre = urldecode($row_CertDetails['centre_name']);

$pdf->Text(10, 110, $centre);

I've seen on some forums people mentioning WriteHTML, however my version of FPDF doesn't seem to include that.

Is it an add-on?

解决方案

Yes, it is an Add-On:

Write HTML

Author: Clément Lavoillotte
License: FPDF

This is an enhancement of the WriteHTML() method from tutorial 6. Supported tags are: ...

Please see Write HTML FPDF Script #42 which I think is the latest version, but feel free to browse the FPDF scripts/Add-Ons.

这篇关于带有HTML标签的FPDF文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆