在itextsharp pdfpcell中如何在文本中添加下划线

编程入门 行业动态 更新时间:2024-10-19 11:45:50
本文介绍了在itextsharp pdfpcell中如何在文本中添加下划线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

代码如下: PdfPTable table = new PdfPTable(3); PdfPCell cell = new PdfPCell(new Phrase( OFFICE COPY BANK COPY DEPARTMENT COPY,cop)); cell.VerticalAlignment = Element.ALIGN_MIDDLE; cell.Horizo​​ntalAlignment = Element.ALIGN_CENTER; cell.Colspan = 3; cell.Horizo​​ntalAlignment = 1; // 0 =左,1 =居中,2 =正确 table.AddCell(单元格);

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);

cell = new PdfPCell(new Phrase("(*)Purpose of Deposit/Payment: application fees for admission to the course of" + cnams.CourseName + "," + depname + "", nm)); table.AddCell(cell);

在上面的代码中,我需要在存款/付款的目的:申请入场费用+ cnams.CourseName +,+ depname + b $ b 请帮帮我 提前致谢。 我尝试了什么: i需要在付款目的的情况下打印下划线

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

推荐答案

请参阅短语(iText,一个免费的Java-PDF库) 5.5.9-SNAPSHOT API) [ ^ ]。

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);

更多推荐

在itextsharp pdfpcell中如何在文本中添加下划线

本文发布于:2023-06-07 21:59:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/568526.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:下划线   如何在   itextsharp   pdfpcell   文本中

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!