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"));
```
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)