Several phrases in one PdfPCell
I want to add multiple phrases to one PdfPCell. I am concerned that I want to show how "Created Date:" in gray font and "Date" in black font in the same cell.
So, is there anyway to do it? Please, help.
The code is similar,
PdfPCell cell = new PdfPCell(new Phrase("Created Date : ",grayFont));
Now I want to add Date after that without adding a new cell. Is it possible?
+3
source to share
3 answers
Using
Phrase datePhrase = new Phrase(new Chunk("Created Date", FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD, BaseColor.GRAY)));
datePhrase.add(new Phrase(new Chunk("Your Date", FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD, BaseColor.BLACK))));
PdfPCell cell = new PdfPCell(datePhrase);
0
source to share