src/com/sys/plugin/doc/PDFWriteUtil.java
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.sys.plugin.doc;
import java.awt.Color;
import java.io.File;
import java.io.FileOutputStream;
import java.lang.reflect.Method;
import java.util.List;
import jxl.write.Label;
import jxl.write.WritableSheet;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;
import com.sys.common.util.UUIDGenerator;
public class PDFWriteUtil<T> {
public String filePath = System.getProperty("user.dir");
public String fileName = UUIDGenerator.genFileName() + ".pdf";
private Document document = null;
private PdfPTable table = null;
public String getFullFilePath() {
return filePath + File.separator + fileName;
}
private PDFWriteUtil(String filePath, String fileName) {
this.filePath = filePath;
this.fileName = fileName;
}
private Document createDocument() {
if (document == null) {
document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream(this
.getFullFilePath()));
} catch (Exception e) {
e.printStackTrace();
}
document.open();
}
return document;
}
public Font genChineseFont() {
try {
BaseFont bfChinese = BaseFont.createFont("STSongStd-Light",
"UniGB-UCS2-H", false);
Font bold_fontChinese = new Font(bfChinese, 12, Font.BOLD,
Color.BLACK);
return bold_fontChinese;
后面还有 70 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。