Hello! I’m trying to create a table in a PDF where the cells have different font styles.
example: in a cell i want the pdf to render like, “Bob read Hello World”
I’ve been trying to use TextSegments and the table has the correct information, but when rendering the pdf looks like it takes the DefaultCellTextState
my code
var content_segment1 = new TextSegment("Bob read ");
var content_segment2 = new TextSegment("Hello World")
{
TextState = new TextState() { FontStyle = FontStyles.Bold, ForegroundColor = Color.Beige, FontSize = 20, Font = FontRepository.FindFont("Arial-Bold") }
};
var content_fragment = new TextFragment();
content_fragment.Segments.Add(content_segment);
content_fragment.Segments.Add(content_segment2);
row.Cells.Add(new Cell()
{
Paragraphs = { content_fragment }
});