首页 > 解决方案 > FPDF 的 HTML 箭头实体、Dec 或十六进制代码

问题描述

我尝试对我的 fpdf 文档使用 html 箭头,但它不起作用

我尝试了其中的一些代码,但都不起作用,它只适用于像 © 这样的实体,但是当我想使用 ↠ 或 → 它不起作用时,我不知道为什么。

这是我的代码

$str = "&rarr";
$str = utf8_decode($str);
$str = html_entity_decode($str);
$huha =  iconv('UTF-8', 'windows-1252',$str);
$huha = iconv('UTF-8', 'windows-1252', html_entity_decode("→"));
$huha = html_entity_decode("©", ENT_XHTML,"ISO-8859-1");

标签: entityfpdf

解决方案


您可以按照示例获取所有字体字符。这就是你使用它的方式

$pdf->SetFont('Symbol','',11);
$pdf->Cell(0,5.5,chr(36),0,1); //This will display the $ character

以下是33个常用字符列表:!34:" 35:# 36:$ 37:% 38:&

@Olivier 有正确的答案,我只是想在这篇文章中举个例子。

参考:这里


推荐阅读