摘要: 使用自定义字体 package aoye import com.itextpdf.text.BaseColor import com.itextpdf.text.Font import com.itextpdf.text.FontFactory import com.itextpdf.text.pd 阅读全文
posted @ 2022-11-28 10:59 duchaoqun 阅读(160) 评论(0) 推荐(0) 编辑
摘要: com.itextpdf.text.PdfPTable Demo 注意:表格中的列必须填满,否则表格不显示。 PdfPTable table = new PdfPTable(3) // 设置表格的填充宽度百分比,在当前 Table 和其父级的左右宽度微调的时候使用。 table.setWidthPe 阅读全文
posted @ 2022-11-28 10:58 duchaoqun 阅读(310) 评论(0) 推荐(0) 编辑
摘要: com.itextpdf.text.Paragraph 注意:声明对象的时候最好默认指定 leading // 可以直接制定行间距。 Paragraph paragraph = new Paragraph(10) // 行间距,对应小四号字(12),20磅刚刚好 paragraph.setLeadi 阅读全文
posted @ 2022-11-28 10:55 duchaoqun 阅读(686) 评论(0) 推荐(0) 编辑
摘要: com.itextpdf.text.Image 在插入图像到指定位置的时候,我们最好使用表格进行布局,不要直接设置图像的相对位置。 在相对位置上插入图片 // 在文件中插入图像: String imgURL = "https://blog-static.cnblogs.com/files/ducha 阅读全文
posted @ 2022-11-28 10:52 duchaoqun 阅读(850) 评论(0) 推荐(0) 编辑
摘要: // 创建 Document 对象,就是对应的文档对象。 Document document =new Document() // 使用默认的 A4 尺寸创建:import com.itextpdf.text.PageSize -> RectangleReadOnly(595,842) Docume 阅读全文
posted @ 2022-11-28 10:50 duchaoqun 阅读(392) 评论(0) 推荐(0) 编辑
摘要: // 文字块,中文字体需要指定。 Chunk c1 = new Chunk("文字文字", customFont.font12) // 加上下划线: // 第一个参数是线的厚度 // 第二个参数是线的位置,如果是 0 就紧贴在文字下面,-2 就沿着 y 轴向下移动2 c1.setUnderline( 阅读全文
posted @ 2022-11-28 10:44 duchaoqun 阅读(269) 评论(0) 推荐(0) 编辑
摘要: each方法用来循环一个集合对象,接收一个闭包来处理这个对象,但当需要终止这个循环的时候就有问题了,这个时候需要使用传统的for(x in list){if return} 的方式来做。 files.each { Attachments attachments -> attachments?.typ 阅读全文
posted @ 2022-05-30 17:11 duchaoqun 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 错误信息如下: 点击查看代码 17-May-2022 15:57:07.913 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/opt/t 阅读全文
posted @ 2022-05-18 08:54 duchaoqun 阅读(504) 评论(0) 推荐(0) 编辑
摘要: JSON 数据 可以将JSON对象直接赋值给指定的变量 let data = { "status": "success", "type": "new", "list1": [{ "name": "投标保函申请", "x": 300, "y": 100, "value": 58249, "userNa 阅读全文
posted @ 2021-02-01 13:30 duchaoqun 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 前言 每个脚本或者命令行程序都可以输入一些参数,通常有两种规范。 python main.py -o python main.py -oa python main.py -oabcd python main.py -o abcde python main.py -o "abcdef" python 阅读全文
posted @ 2020-12-03 10:48 duchaoqun 阅读(399) 评论(0) 推荐(0) 编辑