亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

java使用Abobe Acrobat DC生成模板

瀏覽:2日期:2022-08-14 09:18:22
一、利用word生成一個(gè)文檔轉(zhuǎn)成pdf

java使用Abobe Acrobat DC生成模板

說(shuō)明:轉(zhuǎn)換成pdf格式

二、Abobe Acrobat DC圖解

利用Abobe Acrobat DC打開(kāi)pdf

步驟:文件 ---->創(chuàng)建------>創(chuàng)建表單----->選擇文件(你轉(zhuǎn)換成pdf文件)

這里是所要增加的文本域、圖片域等功能按鈕

java使用Abobe Acrobat DC生成模板

在你需要的位置增加你說(shuō)要的功能完成之后進(jìn)行保存

java使用Abobe Acrobat DC生成模板

三、java后臺(tái)代碼

環(huán)境maven

<dependency><groupId>com.itextpdf</groupId><artifactId>itext7-core</artifactId><version>7.1.13</version><type>pom</type></dependency>

生成的模板文件放到適當(dāng)?shù)奈恢?/b>

java使用Abobe Acrobat DC生成模板

所需要生成新的pdf代碼

public @ResponseBody Object getFaceVerificationPdf(GzFaceVerification gzFaceVerification, HttpServletRequest request) throws IOException {try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { try (PdfDocument document = new PdfDocument(new PdfReader( new ClassPathResource('static/moban.pdf').getInputStream()), new PdfWriter(outputStream))) { PdfAcroForm pdfAcroForm = PdfAcroForm.getAcroForm(document, true); //對(duì)圖片進(jìn)行處理(如果不處理在模板中顯示不出圖片) PdfFormField pdfFormField = pdfAcroForm.getField('frontIdCardUrl'); InputStream is = new FileInputStream(new File(gzFaceVerification.getFrontIdCardUrl())); String str = Base64.encodeBytes(StreamUtil.inputStreamToArray(is)); pdfFormField.setValue(str); pdfAcroForm.addField(pdfFormField); PdfFormField pdfFormField1 = pdfAcroForm.getField('reverseIdCardUrl'); InputStream is1 = new FileInputStream(new File(gzFaceVerification.getReverseIdCardUrl())); String str1 = Base64.encodeBytes(StreamUtil.inputStreamToArray(is1)); pdfFormField1.setValue(str1); pdfAcroForm.addField(pdfFormField1); PdfFormField pdfFormField2 = pdfAcroForm.getField('photo'); InputStream is2 = new FileInputStream(new File(gzFaceVerification.getPhoto())); String str2 = Base64.encodeBytes(StreamUtil.inputStreamToArray(is2)); pdfFormField2.setValue(str2); pdfAcroForm.addField(pdfFormField2); pdfAcroForm.getField('frontIdCardUrl').setValue(gzFaceVerification.getFrontIdCardUrl()); pdfAcroForm.getField('reverseIdCardUrl').setValue(gzFaceVerification.getReverseIdCardUrl()); pdfAcroForm.getField('photo').setValue(gzFaceVerification.getPhoto()); pdfAcroForm.getField('comparisonResults').setValue(gzFaceVerification.getComparisonResults()); pdfAcroForm.getField('createTime').setValue(gzFaceVerification.getCreateTime()); pdfAcroForm.flattenFields(); } HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.setContentType(MediaType.APPLICATION_PDF); httpHeaders.setContentDispositionFormData('attachment', 'test.pdf', Charset.forName('UTF-8')); return ResponseEntity.ok().headers(httpHeaders).body(outputStream.toByteArray());} }

到此這篇關(guān)于java使用Abobe Acrobat DC生成模板的文章就介紹到這了,更多相關(guān)Abobe Acrobat DC生成模板內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: Java
相關(guān)文章:
主站蜘蛛池模板: 国产精品亚洲va在线观看 | 国产综合在线视频 | 国产欧美综合一区二区 | 国产精品福利在线播放 | 国产黄色片网站 | 老司机观看精品一区二区 | 亚洲qingse中文字幕久久 | 成人在线不卡视频 | 亚洲美女免费视频 | 欧美一区二区三区视频 | 香蕉视频免费在线观看 | 国产专区一区 | 国产精品入口麻豆免费 | 欧美韩国日本在线 | 中文字幕在线永久在线视频2020 | 拍真实国产伦偷精品 | 伊人久久丁香色婷婷啪啪 | 亚洲青青青网伊人精品 | 精品精品国产欧美在线观看 | 国产精品第一页在线 | 一级毛片在线全部免费播放 | 毛片大全免费观看 | 性爽交免费视频 | 特级做人爱c级特级aav毛片 | 亚洲人成黄网在线观看 | 美国一级片在线 | 99久免费精品视频在线观看2 | 国产一区二区三区日韩欧美 | 免费一区二区三区在线视频 | 欧美高清色视频在线播放 | 97超视频在线观看 | 国产a精品 | 人人九九精| 中文字幕亚洲欧美日韩不卡 | 澳门一级毛片免费播放 | 国产人在线成免费视频麻豆 | 免费观看情趣v视频网站 | 国产老女人 | 玖玖爱在线观看视频在线 | 中文字幕有码热在线视频 | 欧美精品大片 |