Drawing diagonal line in a cell of a table in iTExt?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm creating a table in iText , but I've a problem with a cell that could be divided by a diagonal line . Someone know how can I do that? 回答1: The easiest way would be via an onGenericTag handler in a PdfPageEvent . You give the contents of that cell a generic tag via Chunk.setGenericTag(String tag) , and set up a PdfPageEvent hanlder that will draw your line when that chunk is drawn. Something like: public class MyPdfPageEvent extends PdfPageEventHelper { public void onGenericTag(PdfWriter writer, Document doc, Rectangle rect, String tag) {