I have a String
that consists of a constant part and a variable part.
I want the variable to be formatted using a regular font within the text paragraph, whereas I want the constant part to be bold.
This is my code:
String cc_cust_name = request.getParameter("CC_CUST_NAME");
document.add(new Paragraph(" NAME " + cc_cust_name, fontsmallbold));
My code for a cell in a table looks like this:
cell1 = new PdfPCell(new Phrase("Date of Birth" + cc_cust_dob ,fontsmallbold));
In both cases, the first part (" NAME "
and "Date of Birth"
) should be bold and the variable part (cc_cust_name
and cc_cust_dob
) should be regular.