itextpdf生成PDF

package com.xzff.qt;

import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * 设置页面附加属性
 *
 * @author hongli.zhang
 * @create 2020/5/18 21:00
 **/
@Component
public class PDFBuilder extends PdfPageEventHelper {

    private static final Logger LOGGER = LoggerFactory.getLogger(PDFBuilder.class);

    public Phrase header;

    public Phrase footer;

    // 模板
    public PdfTemplate total;

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

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

    public PDFBuilder() {

    }

    public PDFBuilder(Phrase header, Phrase footer) {
        this.header = header;
        this.footer = footer;
    }

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

    public void setFooter(Phrase footer) {
        this.foo
上一篇:【Elasticsearch Postman版】完全匹配(精准匹配)


下一篇:Centos使用kubeadm安装kubernetes 1.17.2 集群