如何在PHP中使用TCPDF创建Malayalam PDF? [英] How can I create Malayalam PDF using TCPDF in PHP?

查看:152
本文介绍了如何在PHP中使用TCPDF创建Malayalam PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用TCPDF创建malayalam pdf。
根据手册,我已经转换字体(使用 http://fonts.snm-portal。 com / )并添加了它们。它正在工作,但不能正常工作。



这些字样,例如酒店,酒店,旅馆。是
,显示为Светлайскийпользовать,ഉത^തരവിട^ടനെനും,എത^രയും'。

现在我正在使用'kartika.ttf'字体,并尝试了一些其他的马来亚字体。
数据库,表格,字段和站点都是'utf-8'格式。

有没有解决这个问题的方法?
是否可以使用印度字体显示/保存为PDF格式?

解决方案

从头开始我的最后一条评论。据我所能找到,TCPDF不支持指示脚本。欲了解更多信息,请参阅 http:// thottingal。 Python的PyPDFLib org / projects / pypdflibrel =nofollow> http://savannah.nongnu.org/projects/pypdflib 应该能够正确呈现您提供的示例文本。



我想测试一下PyPDFLib下的pango,它会处理上面提供的字符串。所以我使用了另一个包。我用rsvg渲染它。 http://rrbits.com/malayalam.pdf [注意:文字应该以Kartika字体显示,由于缺乏知识,我无法确定它是否100%正确,但是我知道它比我从TCPDF中提取的任何东西都要密切得多。我的pango版本也是古代的。]


I am trying to create malayalam pdfs using TCPDF. As per the manual, i had converted the fonts (using http://fonts.snm-portal.com/) and had added them. It is working but is not working correctly.

The words like 'ന്യൂഡല്ഹി, ഉത്തരവിട്ടെന്നും, എത്രയും'. are displayed as 'ന^യൂഡല്ഹി, ഉത^തരവിട^ടനെനും, എത^രയും'.

I am using 'kartika.ttf' font now and had tried some other malayalam fonts. The database, tables, fields and the site are in 'utf-8' format.

Is there any solution for this problem? Is it possible to show/save as pdf format using indian fonts?

解决方案

Scratch my last comment. As far as I've been able to find, TCPDF does not support indic scripts. For more information see the comments on this blog post http://thottingal.in/blog/2011/05/07/language-ecosystem-sourashtra/

Python's PyPDFLib http://savannah.nongnu.org/projects/pypdflib should be able to render the sample text you provided correctly however.

I wanted to test that pango, which underlies PyPDFLib, would handle the string you provided above. So I used another package built on it. I rendered it with rsvg. http://rrbits.com/malayalam.pdf [Note: The text should show up in the Kartika font, and I can't really tell if it's 100% correct due to my lack of knowledge, but I do know it's a lot closer than anything I extracted out of TCPDF. My version of pango is also ancient.]

这篇关于如何在PHP中使用TCPDF创建Malayalam PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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