document.addAuthor(author);
}
if (subject != null) {
document.addSubject(subject);
}
if (title != null) {
document.addTitle(title);
e.printStackTrace();
}
return document;
}
/**
* 创建pdf对象
*
* @param filePath
* @param title
* @param subject
* @param author
* @return
*/
public static Document createDocument(String filePath, String title,
String subject, String author) {
return createDocument(filePath, null, 0, title, subject, author);
table.getDefaultCell().setBorder(1);
} catch (Exception e) {
e.printStackTrace();
}
return table;
}
/**
* 创建table单元格
*
* @param widths
PdfPCell cell = new PdfPCell();
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(align);
cell.setColspan(colspan);
table.setTotalWidth(maxWidth);
table.setLockedWidth(true);
table.setHorizontalAlignment(Element.ALIGN_CENTER);
table.getDefaultCell().setBorder(1);
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.Image;
import com.lowagie.text.Paragraph;
cell.setHorizontalAlignment(align);
cell.setPhrase(new Phrase(value, font));
return cell;
}
/**
* 创建table单元格
*
* @param value
* @param font
* @param maxWidth
* @return
*/
public static PdfPTable createTable(float[] widths, int maxWidth) {
PdfPTable table = new PdfPTable(widths);
try {
PdfPTable table = new PdfPTable(colNumber);
try {
table.setTotalWidth(maxWidth);
table.setLockedWidth(true);
table.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setPhrase(new Phrase(value, font));
return cell;
}
/**
* 创建table单元格
*
* @param value
* @param font
* @param align
* @param colspan
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(align);
cell.setColspan(colspan);
cell.setPhrase(new Phrase(value, font));
if (pagesize != null) {
document.setPageSize(pagesize);
}
if (pageCount > 0) {
document.setPageCount(pageCount);
}
if (author != null) {
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setPhrase(new Phrase(value, font));
return cell;
}
/**
* 创建table单元格
*
* @param value
* @param font
* @param align
* @param colspan
* @return
*/
public static PdfPCell createCell(String value, Font font, int align,
int colspan) {
* @param align
* @return
*/
public static PdfPCell createCell(String value, Font font, int align) {
PdfPCell cell = new PdfPCell();
cell.setVerticalAlignmeБайду номын сангаасt(Element.ALIGN_MIDDLE);
}
document.open();
} catch (Exception e) {
e.printStackTrace();
}
return document;
}
/**
* 创建table单元格
*
* @param value
* @param font
import java.io.FileOutputStream;
import java.io.IOException;
import .MalformedURLException;
import com.lowagie.text.BadElementException;
import com.lowagie.text.Document;
int pageCount, String title, String subject, String author) {
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream(filePath));
* @param boderFlag
* @return
*/
public static PdfPCell createCell(String value, Font font, int align,
int colspan, boolean boderFlag) {
PdfPCell cell = new PdfPCell();
} catch (Exception e) {
e.printStackTrace();
}
return table;
}
/**
* 创建table单元格
*
* @param font
* @return
*/
public static PdfPTable createBlankTable(Font font) {
cell.setPadding(3.0f);
if (!boderFlag) {
cell.setBorder(0);
cell.setPaddingTop(15.0f);
cell.setPaddingBottom(8.0f);
}
return cell;
}
/**
* 创建table单元格
*
* @param colNumber
* @param maxWidth
* @return
*/
public static PdfPTable createTable(int colNumber, int maxWidth) {
}
/**
* 创建pdf对象
*
* @param filePath
* @param pagesize
* @param pageCount
* @return
*/
public static Document createDocument(String filePath, Rectangle pagesize,
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream(filePath));
document.open();
} catch (Exception e) {
PdfPTable table = new PdfPTable(1);
import com.lowagie.text.Phrase;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
* @param pageCount
* @param title
* @param subject
* @param author
* @return
*/
public static Document createDocument(String filePath, Rectangle pagesize,
* @return
*/
public static PdfPCell createCell(String value, Font font) {
PdfPCell cell = new PdfPCell();
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
import com.lowagie.text.pdf.PdfWriter;
public class PdfUtil {
/**
* 创建pdf对象
*
* @param filePath
* @return
*/
public static Document createDocument(String filePath) {
int pageCount) {
return createDocument(filePath, pagesize, pageCount, null, null, null);
}
/**
* 创建pdf对象
*
* @param filePath
* @param pagesize
}
if (subject != null) {
document.addSubject(subject);
}
if (title != null) {
document.addTitle(title);
e.printStackTrace();
}
return document;
}
/**
* 创建pdf对象
*
* @param filePath
* @param title
* @param subject
* @param author
* @return
*/
public static Document createDocument(String filePath, String title,
String subject, String author) {
return createDocument(filePath, null, 0, title, subject, author);
table.getDefaultCell().setBorder(1);
} catch (Exception e) {
e.printStackTrace();
}
return table;
}
/**
* 创建table单元格
*
* @param widths
PdfPCell cell = new PdfPCell();
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(align);
cell.setColspan(colspan);
table.setTotalWidth(maxWidth);
table.setLockedWidth(true);
table.setHorizontalAlignment(Element.ALIGN_CENTER);
table.getDefaultCell().setBorder(1);
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.Image;
import com.lowagie.text.Paragraph;
cell.setHorizontalAlignment(align);
cell.setPhrase(new Phrase(value, font));
return cell;
}
/**
* 创建table单元格
*
* @param value
* @param font
* @param maxWidth
* @return
*/
public static PdfPTable createTable(float[] widths, int maxWidth) {
PdfPTable table = new PdfPTable(widths);
try {
PdfPTable table = new PdfPTable(colNumber);
try {
table.setTotalWidth(maxWidth);
table.setLockedWidth(true);
table.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setPhrase(new Phrase(value, font));
return cell;
}
/**
* 创建table单元格
*
* @param value
* @param font
* @param align
* @param colspan
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(align);
cell.setColspan(colspan);
cell.setPhrase(new Phrase(value, font));
if (pagesize != null) {
document.setPageSize(pagesize);
}
if (pageCount > 0) {
document.setPageCount(pageCount);
}
if (author != null) {
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setPhrase(new Phrase(value, font));
return cell;
}
/**
* 创建table单元格
*
* @param value
* @param font
* @param align
* @param colspan
* @return
*/
public static PdfPCell createCell(String value, Font font, int align,
int colspan) {
* @param align
* @return
*/
public static PdfPCell createCell(String value, Font font, int align) {
PdfPCell cell = new PdfPCell();
cell.setVerticalAlignmeБайду номын сангаасt(Element.ALIGN_MIDDLE);
}
document.open();
} catch (Exception e) {
e.printStackTrace();
}
return document;
}
/**
* 创建table单元格
*
* @param value
* @param font
import java.io.FileOutputStream;
import java.io.IOException;
import .MalformedURLException;
import com.lowagie.text.BadElementException;
import com.lowagie.text.Document;
int pageCount, String title, String subject, String author) {
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream(filePath));
* @param boderFlag
* @return
*/
public static PdfPCell createCell(String value, Font font, int align,
int colspan, boolean boderFlag) {
PdfPCell cell = new PdfPCell();
} catch (Exception e) {
e.printStackTrace();
}
return table;
}
/**
* 创建table单元格
*
* @param font
* @return
*/
public static PdfPTable createBlankTable(Font font) {
cell.setPadding(3.0f);
if (!boderFlag) {
cell.setBorder(0);
cell.setPaddingTop(15.0f);
cell.setPaddingBottom(8.0f);
}
return cell;
}
/**
* 创建table单元格
*
* @param colNumber
* @param maxWidth
* @return
*/
public static PdfPTable createTable(int colNumber, int maxWidth) {
}
/**
* 创建pdf对象
*
* @param filePath
* @param pagesize
* @param pageCount
* @return
*/
public static Document createDocument(String filePath, Rectangle pagesize,
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream(filePath));
document.open();
} catch (Exception e) {
PdfPTable table = new PdfPTable(1);
import com.lowagie.text.Phrase;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
* @param pageCount
* @param title
* @param subject
* @param author
* @return
*/
public static Document createDocument(String filePath, Rectangle pagesize,
* @return
*/
public static PdfPCell createCell(String value, Font font) {
PdfPCell cell = new PdfPCell();
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
import com.lowagie.text.pdf.PdfWriter;
public class PdfUtil {
/**
* 创建pdf对象
*
* @param filePath
* @return
*/
public static Document createDocument(String filePath) {
int pageCount) {
return createDocument(filePath, pagesize, pageCount, null, null, null);
}
/**
* 创建pdf对象
*
* @param filePath
* @param pagesize