I'm relatively new to iText 5 .NET (formerly known as iTextSharp). Is there a way to write a text across multiple columns? I can't use colspan as each column has a different color.
var cell = new PdfPCell() { Padding = 0, BorderWidth = 0, FixedHeight = _slotParam.SlotHeight };
var tgrid = new PdfPTable(3);
tgrid.AddCell(new PdfPCell() { Padding = 0, BackgroundColor = Color.ORANGE, BorderWidth = 0, FixedHeight = _slotParam.SlotHeight });
tgrid.AddCell(new PdfPCell() { Padding = 0, BackgroundColor = Color.WHITE, BorderWidth = 0, FixedHeight = _slotParam.SlotHeight });
tgrid.AddCell(new PdfPCell() { Padding = 0, BackgroundColor = Color.GREEN, BorderWidth = 0, FixedHeight = _slotParam.SlotHeight });
cell.AddElement(tgrid);
Paragraph paragraph = new Paragraph(phrase);
paragraph.Leading = 11f;
cell.AddElement(phrase);
mainGrid.AddCell(cell);
This is the output that I have, I want to write a text across that 3 colors.
question from:
https://stackoverflow.com/questions/65882936/how-to-write-a-text-across-multiple-columns-in-itextsharp 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…