久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

您的位置:首頁(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)文章:
主站蜘蛛池模板: 日韩在线中文字幕 | 日批免费在线观看 | 国产午夜视频 | 国产美女高潮一区二区三区 | 天天看天天爽 | 欧美一区在线视频 | 99热播在线| 五月婷婷综合激情网 | 国产精品女同一区二区久久夜 | 在线观看av国产一区二区 | 天天摸夜夜摸爽爽狠狠婷婷97 | 91久久综合亚洲鲁鲁五月天 | 久久99er6热线精品首页蜜臀 | 午夜一区二区三区在线观看 | 成人高清视频在线观看 | 久久免费视频3 | 日本一区二区三区四区视频 | 欧美一级做a爰片免费视频 亚洲精品一区在线观看 | 亚洲一区中文字幕在线观看 | 色婷婷国产精品综合在线观看 | 精品国产欧美 | 波多野结衣中文字幕在线视频 | 久久精品久久久 | 日日夜夜摸| 中文成人无字幕乱码精品 | 天天干狠狠干 | 九九热精品视频在线观看 | 国产一区二区精品丝袜 | 国产一区二区在线视频观看 | 亚洲综合精品 | www中文字幕 | 久久99一区二区 | 欧美日韩视频在线 | 国产精品69久久久久水密桃 | 日韩欧美国产精品 | 91免费观看 | 成人欧美一区二区三区黑人孕妇 | 国产精品国产三级国产aⅴ无密码 | 日韩中文不卡 | 日韩亚洲 | 亚洲在线一区二区 |