Java导出pdf含表格,含导出水印,水印可以文字或者图片

25 篇文章 2 订阅
8 篇文章 0 订阅

包含三个文件:文章末尾有效果图

public class PDFBuilder extends PdfPageEventHelper

public class PDFUtil

public class PDFReport 可直接在里面运行main方法

可移步:https://download.csdn.net/download/zlxls/12736300下载直接植入系统

加入依赖:

    <!-- pdf start -->
    <dependency>
      <groupId>com.itextpdf</groupId>
      <artifactId>itextpdf</artifactId>
      <version>5.3.2</version>
    </dependency>
    <dependency>
      <groupId>com.itextpdf</groupId>
      <artifactId>itext-asian</artifactId>
      <version>5.2.0</version>
    </dependency>
    <!-- pdf end -->

public class PDFBuilder extends PdfPageEventHelper

package com.fc.test.util.pdf;

import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
import java.io.IOException;
/**
 * 客户端工具类
 * @author zlxls
 * @date: 2020年08月21日 下午2:10:48
 */
public class PDFBuilder extends PdfPageEventHelper {
    /**
     * 页眉
     */
    public String header = "";

    /**
     * 文档字体大小,页脚页眉最好和文本大小一致
     */
    public int presentFontSize = 12;


    // 模板
    public PdfTemplate total;

    // 基础字体对象
    public BaseFont bf = null;

    // 利用基础字体生成的字体对象,一般用于生成中文文字
    public Font fontDetail = null;

    /**
     *
     * Creates a new instance of PdfReportM1HeaderFooter 无参构造方法.
     *
     */
    public PDFBuilder() {

    }

    public void setHeader(String header) {
        this.header = header;
    }

    /**
     *
     * TODO 文档打开时创建模板
     *
     * @see com.itextpdf.text.pdf.PdfPageEventHelper#onOpenDocument(com.itextpdf.text.pdf.PdfWriter,
     *      com.itextpdf.text.Document)
     */
    public void onOpenDocument(PdfWriter writer, Document document) {
        total = writer.getDirectContent().createTemplate(50, 50);// 共 页 的矩形的长宽高
    }

    /**
     *
     * TODO 关闭每页的时候,写入页眉,写入'第几页共'这几个字。
     *
     * @see com.itextpdf.text.pdf.PdfPageEventHelper#onEndPage(com.itextpdf.text.pdf.PdfWriter,
     *      com.itextpdf.text.Document)
     */
    public void onEndPage(PdfWriter writer, Document document) {
        this.addPage(writer, document);
    }

    //加分页
    public void addPage(PdfWriter writer, Document document){
        try {
            if (bf == null) {
                bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
            }
            if (fontDetail == null) {
                fontDetail = new Font(bf, presentFontSize, Font.NORMAL);// 数据体字体
            }
        } catch (DocumentException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        // 1.写入页眉
        ColumnText.showTextAligned(writer.getDirectContent(),
                Element.ALIGN_LEFT, new Phrase(header, fontDetail),
                document.left(), document.top() + 20, 0);
        // 2.写入前半部分的 第 X页/共
        int pageS = writer.getPageNumber();
        String foot1 = "第 " + pageS + " 页 / 共";
        Phrase footer = new Phrase(foot1, fontDetail);

        // 3.计算前半部分的foot1的长度,后面好定位最后一部分的'Y页'这俩字的x轴坐标,字体长度也要计算进去 = len
        float len = bf.getWidthPoint(foot1, presentFontSize);

        // 4.拿到当前的PdfContentByte
        PdfContentByte cb = writer.getDirectContent();

        // 5.写入页脚1,x轴就是(右margin+左margin + right() -left()- len)/2.0F
        // 再给偏移20F适合人类视觉感受,否则肉眼看上去就太偏左了
        // ,y轴就是底边界-20,否则就贴边重叠到数据体里了就不是页脚了;注意Y轴是从下往上累加的,最上方的Top值是大于Bottom好几百开外的。
        ColumnText
                .showTextAligned(
                        cb,
                        Element.ALIGN_CENTER,
                        footer,
                        (document.rightMargin() + document.right()
                                + document.leftMargin() - document.left() - len) / 2.0F + 20F,
                        document.bottom() - 20, 0);

        // 6.写入页脚2的模板(就是页脚的Y页这俩字)添加到文档中,计算模板的和Y轴,X=(右边界-左边界 - 前半部分的len值)/2.0F +
        // len , y 轴和之前的保持一致,底边界-20
        cb.addTemplate(total, (document.rightMargin() + document.right()
                        + document.leftMargin() - document.left()) / 2.0F + 20F,
                document.bottom() - 20); // 调节模版显示的位置

    }


    /**
     *
     * TODO 关闭文档时,替换模板,完成整个页眉页脚组件
     *
     * @see com.itextpdf.text.pdf.PdfPageEventHelper#onCloseDocument(com.itextpdf.text.pdf.PdfWriter,
     *      com.itextpdf.text.Document)
     */
    public void onCloseDocument(PdfWriter writer, Document document) {
        // 7.最后一步,是关闭文档的时候,将模板替换成实际的 Y 值,至此,page x of y 制作完毕,完美兼容各种文档size。
        total.beginText();
        total.setFontAndSize(bf, presentFontSize);// 生成的模版的字体、颜色
        String foot2 = " " + (writer.getPageNumber()-1) + " 页";
        total.showText(foot2);// 模版显示的内容
        total.endText();
        total.closePath();
    }
}

public class PDFUtil

package com.fc.test.util.pdf;

import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
/**
 * 客户端工具类
 * @author zlxls
 * @date: 2020年08月21日 下午2:10:48
 */
public class PDFUtil {
    private static Font headfont ; // 设置字体大小
    private static Font keyfont;   // 设置字体大小
    private static Font textfont;  // 设置字体大小
    private static BaseFont bfChinese;  // 设置字体大小
    static{
        try {
            bfChinese = BaseFont.createFont("STSong-Light","UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
            headfont = new Font(bfChinese, 16, Font.BOLD,BaseColor.BLACK);// 设置字体大小
            keyfont = new Font(bfChinese, 12, Font.BOLD,BaseColor.BLACK);// 设置字体大小
            textfont = new Font(bfChinese, 8, Font.NORMAL,BaseColor.BLACK);// 设置字体大小
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     * 生成表格
     * @param widths
     * @return
     */
    public static PdfPTable createTable(int [] widths){
        PdfPTable baseTable  = new PdfPTable(widths.length);
        baseTable.setWidthPercentage(100);
        baseTable.setSpacingBefore(10);
        try {
            baseTable.setWidths(widths);
        } catch (DocumentException e) {
            e.printStackTrace();
        }
        return baseTable;
    }
    /**
     * 写入非表格的头和尾部
     * @param value
     * @param colspan
     * @param size
     * @param font
     * @param algin
     * @param paddingLeft
     * @return
     */
    public static PdfPCell createCell(String value,int colspan,int size,int font,int algin,float paddingLeft){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(15);
        cell.setHorizontalAlignment(15);
        cell.setColspan(colspan);
        cell.setPhrase(new Phrase(value,new Font(bfChinese, size,font,BaseColor.BLACK)));
        cell.setHorizontalAlignment(algin); //水平居中
        cell.setBorder(0);
        cell.setPaddingTop(5.0f);
        cell.setPaddingBottom(5.0f);
        if(paddingLeft>0){
            cell.setPaddingLeft(paddingLeft);
        }
        return cell;
    }

    /**
     * 写入非表格的头
     * @param value
     * @param colspan
     * @return
     */
    public static PdfPCell createCell(String value,int colspan){
        return createCell(value,colspan,12,Font.BOLD,Element.ALIGN_CENTER,0.0f);
    }
    /**
     * 写入非表格的尾部
     * @param value
     * @param colspan
     * @param paddingLeft
     * @return
     */
    public static PdfPCell createCell(String value,int colspan,float paddingLeft){
        return createCell(value,colspan,8,Font.NORMAL,Element.ALIGN_LEFT,paddingLeft);
    }

    /**
     * 写入表头
     * @param value
     * @param colspan
     * @param rowspan
     * @param borderbottom
     * @return
     */
    public static PdfPCell createCellMore(String value,int colspan,int rowspan,float borderbottom){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value,new Font(bfChinese, 8, Font.NORMAL,BaseColor.BLACK)));
        cell.setBackgroundColor(new BaseColor(255, 255, 255));
        if(colspan>0){
            cell.setColspan(colspan);
        }
        if(rowspan>0){
            cell.setRowspan(rowspan);
        }
        cell.setFixedHeight(20);
        if(borderbottom>-1){
            cell.setBorderWidthBottom(borderbottom);
        }
        return cell;
    }
    /**
     * 写入表头
     * @param value
     * @return
     */
    public static PdfPCell createCellMore(String value){
        return createCellMore(value,0,0,-1);
    }
    /**
     * 写入表头
     * @param value
     * @param colspan
     * @param rowspan
     * @return
     */
    public static PdfPCell createCellMore(String value,int colspan,int rowspan){
        return createCellMore(value,colspan,rowspan,-1);
    }
    /**
     * 写入水印文字
     * @param pdfStamper
     * @param waterMarkName
     * @throws Exception
     */
    public static void addWatermark(PdfStamper pdfStamper, String waterMarkName) throws Exception {
        PdfContentByte content;
        BaseFont base = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
        Rectangle pageRect;
        PdfGState gs = new PdfGState();
        try {
            if (base == null || pdfStamper == null) {
                return;
            }
            // 设置透明度为0.4
            gs.setFillOpacity(0.3f);
            gs.setStrokeOpacity(0.3f);
            int toPage = pdfStamper.getReader().getNumberOfPages();
            for (int i = 1; i <= toPage; i++) {
                pageRect = pdfStamper.getReader().getPageSizeWithRotation(i);
                // 计算水印X,Y坐标
                float x = pageRect.getWidth() / 2;
                float y = pageRect.getHeight() / 2;
                // 获得PDF最顶层
                content = pdfStamper.getOverContent(i);
                content.saveState();
                // set Transparency
                content.setGState(gs);
                content.beginText();
                content.setColorFill(BaseColor.GRAY);
                content.setFontAndSize(base, 120);
                // 水印文字成45度角倾斜
                content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, x, y,45);
                content.endText();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    以下是测试数据//
    //表格标题
    public static PdfPCell createHeadCell(String value){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(15);
        cell.setHorizontalAlignment(15);
        cell.setColspan(5);
        cell.setPhrase(new Phrase(value,new Font(bfChinese, 12, Font.BOLD,BaseColor.BLACK)));
        cell.setHorizontalAlignment(Element.ALIGN_CENTER); //水平居中
        cell.setPadding(10.0f);
        cell.setBorder(0);
        cell.setPaddingTop(5.0f);
        cell.setPaddingBottom(18.0f);
        return cell;
    }
    public static PdfPCell createHeadCell_1(String value){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value,new Font(bfChinese, 12, Font.NORMAL,BaseColor.BLACK)));
        cell.setBackgroundColor(new BaseColor(255, 255, 255));
        return cell;
    }
    //表格表头样式1
    public static  PdfPCell createTitleCell_1(String value){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value, keyfont));
        cell.setBackgroundColor(new BaseColor(29, 181, 238));
        cell.setColspan(1);
        cell.setFixedHeight(35);
        return cell;
    }

    //表格表头样式2
    public static  PdfPCell createTitleCell_2(String value){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value, keyfont));
        cell.setBackgroundColor(new BaseColor(29, 181, 238));
        cell.setColspan(1);
        cell.setRowspan(3);
        cell.setFixedHeight(105);
        return cell;
    }

    //表格内容样式1
    public static PdfPCell createCell_1(String value){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value,textfont));
        cell.setBackgroundColor(new BaseColor(255, 255, 255));
        return cell;
    }

    //表格内容样式2
    public static PdfPCell createCell_2(String value){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value,textfont));
        cell.setBackgroundColor(new BaseColor(255, 255, 255));
        cell.setColspan(1);
        cell.setRowspan(3);
        cell.setFixedHeight(105);
        return cell;
    }    //表格内容样式2

    public static PdfPCell createCell_moreRow(String value,int rowspan){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value,textfont));
        cell.setBackgroundColor(new BaseColor(255, 255, 255));
        cell.setColspan(1);
        cell.setRowspan(rowspan);
        cell.setFixedHeight(105);
        return cell;
    }

    //表格内容样式3
    public static PdfPCell createCell_3(String value){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value,textfont));
        cell.setBackgroundColor(new BaseColor(255, 255, 255));
        cell.setColspan(2);
        cell.setFixedHeight(35);
        return cell;
    }

    //表格内容样式4
    public static PdfPCell createCell_4(String value){
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setPhrase(new Phrase(value,textfont));
        cell.setBackgroundColor(new BaseColor(255, 255, 255));
        cell.setColspan(4);
        cell.setRowspan(3);
        cell.setFixedHeight(105);
        return cell;
    }

    //生成表格
    public static PdfPTable createTable(int colNumber){
        int widths[] = { 35,40,35,35,30 };
        PdfPTable baseTable  = new PdfPTable(colNumber);
        baseTable.setWidthPercentage(100);
        baseTable.setSpacingBefore(10);
        try {
            baseTable.setWidths(widths);
        } catch (DocumentException e) {
            e.printStackTrace();
        }
        return baseTable;
    }


    public static  void addText(String input,String output,String name) throws Exception{
        File desc = new File(output);
        if (!desc.getParentFile().exists()) {
            desc.getParentFile().mkdirs();
        }
        if (!desc.exists()) {
            desc.createNewFile();
        }
        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(desc));
        PdfReader reader = new PdfReader(input);
        PdfStamper stamper = new PdfStamper(reader, out);
        addWatermark(stamper,name);
        stamper.close();
        reader.close();
    }
    public static  void addImage(String input,String output,String realPath) throws Exception{
        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(new File(output)));
        PdfReader reader = new PdfReader(input);
        PdfStamper stamper = new PdfStamper(reader, out);
        addWatermark(stamper,"测试添加水印文字");
        int total = reader.getNumberOfPages();
        try {
            Image image = Image.getInstance(realPath);
            image.setAbsolutePosition(350, 200);
            image.scaleToFit(160, 70);
            PdfContentByte content= stamper.getOverContent(total);// 在内容上方加水印
            content.addImage(image);
        }catch (Exception e){
            e.printStackTrace();
        }

        stamper.close();
        reader.close();
    }
}

public class PDFReport 可直接在里面运行main方法

package com.fc.test.util.pdf;

import com.fc.test.shiro.util.ShiroUtils;
import com.fc.test.util.DateUtils;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
/**
 * 客户端工具类
 * @author zlxls
 * @date: 2020年08月21日 下午2:10:48
 */
public class PDFReport {
    /**
     * 入口
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
        new PDFReport("test.pdf").generatePDFBase();
        PDFUtil.addText("test.pdf", "C://test1.pdf","水印");
    }
    private Document document = new Document();// 建立一个Document对象
    private int type ;
    private List<String[]> list;
    private String organize;
    public PDFReport(String out,List<String[]> list, int type,String organize) {
        this.type = type;
        this.list = list;
        this.organize = organize;
        try {
            File file = new File(out);
            file.createNewFile();
            Rectangle pageSize = new Rectangle(PageSize.A4);
            document.setPageSize(pageSize);
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
            PDFBuilder builder = new PDFBuilder();
            writer.setPageEvent(builder);
            document.open();
            PdfPTable table = generatePDF();
            document.add(table);
            document.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     * 创建9列的数组
     * \u00a0 这是空格
     * type 0借出单 1更换单 2报废单
     * @return
     */
    public PdfPTable generatePDF() {
        //设置单元格为5列
        int [] widths = widths();
        PdfPTable table = PDFUtil.createTable(widths);
        table = setHeader(table,widths.length);
        for (String [] strs:list){
            for (String str:strs){
                table.addCell(PDFUtil.createCellMore(str));
            }
        }
        table = setFooter(table,widths.length);
        return table;
    }

    /**
     * 初始化列数
     * @return
     */
    public int[] widths() {
        if(type==1){//1更换单
            int [] widths = {30,40,60,60,30,40};
            return widths;
        }else if(type==2){//2报废单
            int [] widths = {30,40,60,60,30,40};
            return widths;
        }else {//0借出单
            int [] widths = {20,30,30,30,20,50,30,20,50};
            return widths;
        }
    }
    /**
     * 写入头部
     * @param table
     * @param len
     * @return
     */
    public PdfPTable setHeader(PdfPTable table,int len){
        if(type==1){//1更换单
            table.addCell(PDFUtil.createCell(organize+"\u00a0\u00a0\u00a0\u00a0申请单",len));
            table.addCell(PDFUtil.createCellMore("申领"));
            table.addCell(PDFUtil.createCellMore("申请"));
            table.addCell(PDFUtil.createCellMore("规格型号(参数)"));
            table.addCell(PDFUtil.createCellMore("申请"));
            table.addCell(PDFUtil.createCellMore("申请日期"));
            table.addCell(PDFUtil.createCellMore("是否"));
        }else if(type==2){//2报废单
            table.addCell(PDFUtil.createCell(organize+"\u00a0\u00a0\u00a0\u00a0申请单",len));
            table.addCell(PDFUtil.createCellMore("序号"));
            table.addCell(PDFUtil.createCellMore("申请"));
            table.addCell(PDFUtil.createCellMore("规格型号(参数)"));
            table.addCell(PDFUtil.createCellMore("申请"));
            table.addCell(PDFUtil.createCellMore("申请日期"));
            table.addCell(PDFUtil.createCellMore("是否同意"));
        }else{//0借出单
            table.addCell(PDFUtil.createCell(organize+"\u00a0\u00a0\u00a0\u00a0记录表",len));
            table.addCell(PDFUtil.createCellMore("序号",1,2));
            table.addCell(PDFUtil.createCellMore("名称",1,2));
            table.addCell(PDFUtil.createCellMore("编号",1,2));
            table.addCell(PDFUtil.createCellMore("库",3,1,0));
            table.addCell(PDFUtil.createCellMore("库",3,1,0));
            //下排
            table.addCell(PDFUtil.createCellMore("日期"));
            table.addCell(PDFUtil.createCellMore("完好"));
            table.addCell(PDFUtil.createCellMore("确认"));
            table.addCell(PDFUtil.createCellMore("日期"));
            table.addCell(PDFUtil.createCellMore("是否"));
            table.addCell(PDFUtil.createCellMore("确认"));
        }
        return table;
    }
    /**
     * 写入尾部
     * @param table
     * @param len
     * @return
     */
    public PdfPTable setFooter(PdfPTable table,int len){
        if(type==1){//1更换单
            String u00a0 = "";
            for(int i=0;i<=40;i++){
                u00a0+="\u00a0";
            }
            table.addCell(PDFUtil.createCell("审批人(手签):"+u00a0+"申请人(手签):", len,0.0f));
            table.addCell(PDFUtil.createCell("注:1.", len,18.0f));
            table.addCell(PDFUtil.createCell("2.", len,34.0f));
            table.addCell(PDFUtil.createCell("3.", len,34.0f));
            table.addCell(PDFUtil.createCell("4.",len,34.0f));
        }else if(type==2){//2报废单
            String u00a0 = "";
            for(int i=0;i<=30;i++){
                u00a0+="\u00a0";
            }
            table.addCell(PDFUtil.createCell("审批人(手签):"+u00a0+"申请人(手签):", len,0.0f));
            //table.addCell(PDFUtil.createCell("注:1.", len,18.0f));
            //table.addCell(PDFUtil.createCell("2.", len,34.0f));
            //table.addCell(PDFUtil.createCell("3.", len,34.0f));
            //table.addCell(PDFUtil.createCell("4.",len,34.0f));
        }else{//0借出单
            table.addCell(PDFUtil.createCell("注:1.", len,18.0f));
            table.addCell(PDFUtil.createCell("2.", len,34.0f));
            table.addCell(PDFUtil.createCell("3.", len,34.0f));
            table.addCell(PDFUtil.createCell("4.",len,34.0f));
        }
        return table;
    }
    /**
     * 范本使用构造方法
     * @param out
     */
    public PDFReport(String out) {
        try {
            File file = new File(out);
            file.createNewFile();
            Rectangle pageSize = new Rectangle(PageSize.A4);
            document.setPageSize(pageSize);
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
            PDFBuilder builder = new PDFBuilder();
            writer.setPageEvent(builder);
            document.open();
            PdfPTable table = generatePDFBase();
            document.add(table);
            document.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     * 这是测试使用的范本pdf
     * @return
     */
    public PdfPTable generatePDFBase() {
        //设置单元格为5列
        PdfPTable table = PDFUtil.createTable(5);

        table.addCell(PDFUtil.createHeadCell("企业信息列表"));

        table.addCell(PDFUtil.createTitleCell_1("企业名称"));
        table.addCell(PDFUtil.createCell_1("tCorp.getCorp.ame()"));
        table.addCell(PDFUtil.createTitleCell_1("联系方式"));
        table.addCell(PDFUtil.createCell_1("tCorp.getCorp.el()"));
        table.addCell(PDFUtil.createCell_2("Logo"));

        table.addCell(PDFUtil.createTitleCell_1("企业邮箱"));
        table.addCell(PDFUtil.createCell_1("tCorp.getCorp.mail()"));
        table.addCell(PDFUtil.createTitleCell_1("网址"));
        table.addCell(PDFUtil.createCell_1("tCorp.getCorp.ebUrl()"));

        table.addCell(PDFUtil.createTitleCell_1("企业地址"));
        table.addCell(PDFUtil.createCell_1("tCorp.getCorp.ddr()"));
        table.addCell(PDFUtil.createTitleCell_1("注册/实缴"));
        table.addCell(PDFUtil.createCell_1(String.valueOf("tCorp.getRegCapi())万")));

        table.addCell(PDFUtil.createTitleCell_1("成立日期"));
        table.addCell(PDFUtil.createCell_1("tCorp.getStartDate()"));
        table.addCell(PDFUtil.createTitleCell_1("统一社会信用代码"));
        table.addCell(PDFUtil.createCell_3("tCorp.getUniScid()"));

        table.addCell(PDFUtil.createTitleCell_1("法定代表人"));
        table.addCell(PDFUtil.createCell_1("tCorp.getOperManName()"));
        table.addCell(PDFUtil.createTitleCell_1("纳税人识别号"));
        table.addCell(PDFUtil.createCell_3("tCorp.getTaxpayNum()"));

        table.addCell(PDFUtil.createTitleCell_1("注册号"));
        table.addCell(PDFUtil.createCell_1("tCorp.getRegNo()"));
        table.addCell(PDFUtil.createTitleCell_1("组织机构代码"));
        table.addCell(PDFUtil.createCell_3("tCorp.getOrgInstCode()"));

        table.addCell(PDFUtil.createTitleCell_1("公司类型"));
        table.addCell(PDFUtil.createCell_1("tCorp.getEconKind()"));
        table.addCell(PDFUtil.createTitleCell_1("人员规模"));
        table.addCell(PDFUtil.createCell_3("tCorp.getStaffSize()"));

        table.addCell(PDFUtil.createTitleCell_1("营业期限"));
        table.addCell(PDFUtil.createCell_1("tCorp.getFareTermStart()"));
        table.addCell(PDFUtil.createTitleCell_1("登记机关"));
        table.addCell(PDFUtil.createCell_3("tCorp.getBelongOrg()"));

        table.addCell(PDFUtil.createTitleCell_1("核准日期"));
        table.addCell(PDFUtil.createCell_1("tCorp.getCheckDate()"));
        table.addCell(PDFUtil.createTitleCell_1("所属行业"));
        table.addCell(PDFUtil.createCell_3("tCorp.getBelongTrade()"));

        table.addCell(PDFUtil.createTitleCell_1("英文名称"));
        table.addCell(PDFUtil.createCell_1("tCorp.getEnglishName()"));
        table.addCell(PDFUtil.createTitleCell_1("曾用名"));
        table.addCell(PDFUtil.createCell_3("tCorp.getFormerName()"));

        table.addCell(PDFUtil.createTitleCell_2("经营范围"));
        table.addCell(PDFUtil.createCell_4("tCorp.getFareScope()"));

        return table;
    }
}

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

生命无须向死而生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值