Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
the code is given below

PdfPTable table = new PdfPTable(3);
PdfPCell cell = new PdfPCell(new Phrase("OFFICE COPY BANK COPY DEPARTMENT COPY", cop));
cell.VerticalAlignment = Element.ALIGN_MIDDLE;
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.Colspan = 3;

cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
table.AddCell(cell);
C#
cell = new PdfPCell(new Phrase("(*)Purpose of Deposit/Payment: application fees for admission to the course of" + cnams.CourseName + "," + depname + "", nm));
                    table.AddCell(cell);




in the above code i need to print the underline in between the "purpose of Deposit/Payment: application fees for admission to the course of" + cnams.CourseName + "," + depname +"



Pls help me
Thanks in Advance.

What I have tried:

i need to print the underline in the case of purpose of payement
Posted
Updated 12-Mar-18 1:35am
v2

C#
PdfPCell yourCell = new PdfPCell();
Paragraph yourParagraph = new Paragraph("Some Text:", FontFactory.GetFont("Calibri", 11f, Font.BOLD, BaseColor.BLACK));
LineSeparator underline = new LineSeparator(1, 100, BaseColor.BLACK, Element.ALIGN_LEFT, -2);
yourParagraph.Add(underline );
yourCell.AddElement(yourParagraph);
yourCell.PaddingTop = 20f;
yourCell.Border = PdfPCell.NO_BORDER;
yourTable.AddCell(yourCell);
 
Share this answer
 
v2
Comments
CHill60 12-Mar-18 8:38am    
2 years too late

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900