How to use multiple fonts in a single line Using C# iTextSharp

时间:2018-02-03 07:59:29

标签: c# itext itext7

How to use multiple fonts in a single line Using PdfContentByte

For Example:

pcb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, "Some normal font" + " Bold Font" + " Some normal font",iXCoordinate, iYCoordinate, 0);

1 个答案:

答案 0 :(得分:1)

You need a different version of the ShowTextAligned() method to achieve this.

ColumnText.ShowTextAligned(pcb, Element.ALIGN_CENTER, phrase, iXCoordinate, iYCoordinate, 0);

The phrase parameter is of type Phrase and it can be composed of Chunk objects with different fonts.