在某些情况下,印度语不会在iText中呈现 [英] Indic language not rendered in iText under certain scenarios

查看:212
本文介绍了在某些情况下,印度语不会在iText中呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iText版本 - 5.3.5



我使用印度语(泰米尔语)生成PDF。我使用基本字体将其作为短语,并使用ColumnText写入文档。很少有字形呈现为符号(钻石之间的问号)。



com.lowagie.text.pdf.ColumnText.showTextAligned(canvas,PdfContentByte.ALIGN_LEFT,Phrase(DATA,font),(float)X,(float )Y,rotationVal,RUN_DIRECTION,0);



请参阅下面的截图。



我用过2句话。当我只使用第二句时,它在PDF中打印正确。但是当我一起打印2个句子时,第二个句子打印不正确。



解决方案

你的问题中存在一些矛盾。你说你使用的是iText 5.3.5,但是你提到了 com.lowagie.text.pdf ,它仅用于2.1.7及更早版本。



您还期望早于iText 7的版本支持泰米尔语。不是这种情况。如果您需要Tamil支持,至少需要iText 7(作为AGPL软件提供)与PdfCalligraph结合使用:



PdfCalligraph是iText 7的附加值。它不能用作开源软件。


iText version – 5.3.5

I’m using an Indic language (Tamil) to generate PDF. I have made it as a phrase using base font and is written on to the document using ColumnText. Few glyphs are rendered as symbol (a question mark in between a diamond).

com.lowagie.text.pdf.ColumnText.showTextAligned(canvas, PdfContentByte.ALIGN_LEFT, Phrase(DATA, font), (float)X, (float)Y, rotationVal, RUN_DIRECTION, 0);

Refer screenshot below.

I have used 2 sentences. When I'm using only second sentence then it is printing correct in PDF. But when I print 2 sentences together, then the second one doesn't print properly.

解决方案

There are some contradictions in your question. You say that you are using iText 5.3.5, but you mention com.lowagie.text.pdf which was used only in version 2.1.7 and earlier.

You also expect that versions predating iText 7 support Tamil. This is not the case. If you want Tamil support, you need at least iText 7 (available as AGPL software) in combination with PdfCalligraph: http://itextpdf.com/itext7/pdfCalligraph

Take a look at the following screen shot to see the difference between writing Tamil without the addon versus Tamil with the addon:

PdfCalligraph is a value addon to iText 7. It is not available as open source software.

这篇关于在某些情况下,印度语不会在iText中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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