我正在使用flex4,需要导出一些pdf文件。为此,我使用了purePDF库。谁能解释一下如何用purePDF ->在pdf文件中写罗马尼亚字符?我需要写一些字符,比如ăüşţ等。
我查看了该库的wiki文档,但无法充分理解我所需要的内容。感谢任何人的帮助。
谢谢
发布于 2011-07-28 21:29:03
我会问我自己的问题,考虑到它将对其他人有用。
注意:考虑到purePDF是与Java等效的iText库,当您遇到任何问题并需要文档时,您可以参考iText文档来获得purepdf的灵感。
所以这就是你需要做的:
public static const SERIF_NORMAL : String = "FreeSerif.ttf";
//"assets/fonts/FreeSerif.ttf" is the directory where I copied my *.ttf files
[Embed(source="assets/fonts/FreeSerif.ttf", mimeType="application/octet-stream")]
private var serifNormalCls : Class;
private var normalFont : Font;
var bfNormal : BaseFont;
//...
//in youre initialization function :
FontsResourceFactory.getInstance().registerFont(SERIF_NORMAL, new this.serifNormalCls());
bfNormal = BaseFont.createFont(SERIF_NORMAL, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
//and when you need to use your the special characters, you will use that font
this.normalFont = new Font(Font.UNDEFINED, 10, Font.UNDEFINED, null, bfNormal);干杯!
https://stackoverflow.com/questions/6844524
复制相似问题