我已经实现了创建PDFPCell的通用方法,适用于文本字段。在这里,我正在寻找可以帮助我添加url(热链接)的代码。提前致谢。
public PdfPCell createCell(String text, Font font, BaseColor bColor, int rowSpan, int colSpan, int hAlign, int vAlign) {
PdfPCell cell = new PdfPCell(new Phrase(text, font));
cell.setBackgroundColor(bColor);
cell.setRowspan(rowSpan);
cell.setColspan(colSpan);
cell.setHorizontalAlignment(hAlign);
cell.setVerticalAlignment(hAlign);
cell.setMinimumHeight(20);
cell.setNoWrap(true);
return cell;
}
Run Code Online (Sandbox Code Playgroud)