C#使用iText7画发票PDF——字体与自定义颜色
字体可以引用windows自带的字体,引用方式如下:
//楷体
PdfFont KT = PdfFontFactory.CreateFont(“C://Windows//Fonts//SIMKAI.TTF”, PdfEncodings.IDENTITY_H);
//宋体
PdfFont ST = PdfFontFactory.CreateFont(“C://Windows//Fonts//SIMFANG.TTF”, PdfEncodings.IDENTITY_H);
字体或颜色可以用自定义RGB来定义,定义方式如下:
DeviceRgb customColor = new DeviceRgb(128, 0, 0);