Commit 85f0a102 authored by xixinzhao's avatar xixinzhao

交接班pdf样式

parent fdbbbbc7
...@@ -27,36 +27,7 @@ public class PdfUtils { ...@@ -27,36 +27,7 @@ public class PdfUtils {
return document; return document;
} }
/** public static PdfPCell createCell(Object value, Font font, int align, int colspan, int row, int size,int top,int right,int bottom,int left){
*
* @param value 单元格数据
* @param font 单元格样式
* @param align 位置
* @param colspan 占几列
* @param row 占几行
* @param size 高度
* @return
*/
public static PdfPCell createCell(Object value, Font font, int align, int colspan, int row, int size){
String cellValue;
if (value == null) {
cellValue = "";
} else {
cellValue = value.toString();
}
PdfPCell cell = new PdfPCell();
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(align);
cell.setColspan(colspan);
cell.setPhrase(new Phrase(cellValue,font));
cell.setFixedHeight(size);
if (row != 1) {
cell.setRowspan(row);
}
return cell;
}
public static PdfPCell createCell(Object value, Font font, int align, int colspan, int row, int size,boolean flag){
String cellValue; String cellValue;
if (value == null) { if (value == null) {
cellValue = ""; cellValue = "";
...@@ -72,16 +43,10 @@ public class PdfUtils { ...@@ -72,16 +43,10 @@ public class PdfUtils {
if (row != 1) { if (row != 1) {
cell.setRowspan(row); cell.setRowspan(row);
} }
if (flag) { cell.setBorderWidthLeft(left);
cell.setBorderWidthLeft(0); cell.setBorderWidthRight(right);
cell.setBorderWidthTop(0); cell.setBorderWidthTop(top);
cell.setBorderWidthBottom(0); cell.setBorderWidthBottom(bottom);
} else {
cell.setBorderWidthLeft(0);
cell.setBorderWidthRight(0);
cell.setBorderWidthTop(0);
cell.setBorderWidthBottom(0);
}
return cell; return cell;
} }
public static PdfPCell createCell(Image image, int align, int colspan){ public static PdfPCell createCell(Image image, int align, int colspan){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment