Java – multiple phrases in a pdfpcell
•
Java
I want to add multiple phrases to a pdfpcell
So, do this anyway? Please help.
The code is like,
PdfPCell cell = new PdfPCell(new Phrase("Created Date : ",grayFont));
Now, I want to add date without adding a new cell Is that possible?
Solution
Create a cell and add as many phrases as you need:
PdfPCell cell = new PdfPCell(); cell.addElement(new Phrase("Created Date : ",grayFont)); cell.addElement(new Phrase(theDate,blackFont));
You may also consider adding chunks instead of phrases
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码