itext 向pdf模板中添加文字 并设置文字加粗
时间: 2024-05-13 20:19:11
浏览: 45
使用 iText 添加文字到 PDF 模板中并设置加粗字体的步骤如下:
1. 加载 PDF 模板:
PdfReader reader = new PdfReader("template.pdf");
PdfStam[per](https://geek.csdn.net/educolumn/2c6ed1be7edac16b3c9a0c3228eaff0c?spm=1055.2569.3001.10083) stam[per](https://geek.csdn.net/educolumn/2c6ed1be7edac16b3c9a0c3228eaff0c?spm=1055.2569.3001.10083) = new PdfStam[per](https://geek.csdn.net/educolumn/2c6ed1be7edac16b3c9a0c3228eaff0c?spm=1055.2569.3001.10083)(reader, new File[output](https://geek.csdn.net/educolumn/3fa40697d361ab41848a3d891b656e90?spm=1055.2569.3001.10083)Stream("[output](https://geek.csdn.net/educolumn/3fa40697d361ab41848a3d891b656e90?spm=1055.2569.3001.10083).pdf"));
```