# PDFGenius **Repository Path**: yawei_wang/PDF-Genius ## Basic Information - **Project Name**: PDFGenius - **Description**: 基于springboot框架,使用itext包封装的 【表单+表格】灵活生成pdf文件。 - **Primary Language**: Java - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 1 - **Created**: 2024-07-24 - **Last Updated**: 2026-01-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: SpringBoot, itext, pdf ## README ### pdf生成工具 #### 一、简介 基于springboot框架,使用itext包封装的 【表单+表格】灵活生成pdf文件。 可生成的pdf格式如下 ##### 1、纯表单 (接口地址:ip:port/itext/export/download1) ![1](https://gitee.com/yawei_wang/pdf-demo/raw/master/images/1.png) ##### 2、表单 + 表格 (接口地址:ip:port/itext/export/download2) ![2](https://gitee.com/yawei_wang/pdf-demo/raw/master/images/2.png) ##### 3、多重 (表单 + 表格) (接口地址:ip:port/itext/export/download3) ![3](https://gitee.com/yawei_wang/pdf-demo/raw/master/images/3.png) #### 二、使用方式 (先简单说一下,具体的可以看demo) 1、pom中引入itext依赖包,本项目基于itext7。 2、引入pdfUtil包,在pdfUtil包下有annotation、entity、Enums,表示工具类PdfUtil.java需要用到的工具。 3、创建导出实体类,在实体类中的属性上加上@CellProperty注解,具体使用方式请看demo及代码注释 4、如果是非集合类型,则会出现在表单中。如果是集合类型,则要在注解中加入参数contextType = ContextTypeEnums.TABLE。 5、实体类中非集合类型的属性顺序,就是在表单中的顺序,而表格是跟在表单后面的。