仅在词组中支持阿拉伯字体,方法是在词组中以其字体类型添加文本,然后在使用表格的单元格中添加文本。文本出现多次。请更正我的错误,这有助于防止多次发生。
BaseFont bfArialUniCode =
BaseFont.CreateFont(@"..\..\tradbdo.ttf",BaseFont.IDENTITY_H, true);
Font fontuni = new Font(bfArialUniCode, 12, 0, BaseColor.BLUE);
PdfContentByte cb = writer.DirectContent;
ColumnText ct = new ColumnText(cb);
Phrase text_1 = new Phrase("ملخص", fontuni);
PdfPCell cell = new PdfPCell(text_1);
cell.BorderColor = BaseColor.WHITE;
cell.PaddingBottom = -3f;
cell.PaddingLeft = -8f;
table.RunDirection = PdfWriter.RUN_DIRECTION_LTR;
table.AddCell(cell);
Paragraph p = new Paragraph("");
p.Add(table); p.SpacingAfter = -5f;
ct.AddElement(p);
cb.Stroke();
ct.Go();