我正在创建一个 PDF,在其中向每个页面添加一些文本以及使用以下方法绘制的 2 行:
private void DrawLines(Document pdfDoc, PdfContentByte cb) {
cb.MoveTo(0, 562);
cb.LineTo(pdfDoc.PageSize.Width, 562);
cb.MoveTo(0, 561);
cb.LineTo(pdfDoc.PageSize.Width, 561);
}
在一个特定页面上,有一个表格,我在其中使用以下代码更改一个特定单元格的背景颜色:
header = new PdfPCell(new Phrase(market_data_list[i], grid_data_heading));
header.Colspan = 2;
header.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER;
header.BackgroundColor =new BaseColor(238,233,233);
market_table.AddCell(header); //adds cell to the table
我现在得到具有我指定的背景颜色(灰色)的单元格,但是线条从黑色变为灰色......我想用黑色绘制这些线条!