entity - 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");
解决方案
您可以按照示例获取所有字体字符。这就是你使用它的方式
$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 有正确的答案,我只是想在这篇文章中举个例子。
参考:这里
推荐阅读
- firebase - Firestore中的空字符串与空字符串,有什么区别吗?
- travis-ci - Travis CI 在构建后不更新徽章
- gps - 如何将 GPS 经度/纬度值转换为 .WKT 格式的 LINESTRINGS?
- c++ - C ++中带符号,带符号的int和int之间的区别?
- postgresql - 使用 pgAdmin 4.15 导入 2GB .sql 文件
- typescript - 为什么 TypeScript 无法检查函数的返回类型
- excel - 为什么我的任何 IF/ELSEIF 语句都不会执行?
- node.js - 节点 JS 解密在 Ubuntu 服务器上不起作用
- c++ - libusbK 微帧 OvlK_Wait
- amazon-web-services - DynamoDB PutItem 中的非预期结果