1

我正在尝试使用 dompdf 将 html 转换为 pdf。每件事都运行良好。我的代码在我的 html 中有向上和向下箭头,例如 ↑ ↓. 这些在 html 上运行良好。

但在pdf文件转换后,这些只是看 ?

我正在使用版本 dompdf_0-6-0_beta3

我怎么能解决这个问题?

4

1 回答 1

0

These particular characters are not supported by the default encoding scheme, which is Windows ANSI. You'll need a Unicode font, plus the correct document format. Luckily 0.6.0 beta 3 includes the DejaVu fonts, which work just fine.

Try: <span style="font-family: DejaVu Sans, sans-serif;">&uarr; &darr;</span>

And ensure that you're set up for Unicode support. I think you should be OK with your version of dompdf, but it never hurts to know the requirements. You can find an Unicode How-to on the wiki. The information is currently out of date with 0.6.0 beta 3, but it is a useful document none-the-less.

于 2013-01-11T02:41:23.787 回答