在java中的现有PDF页面添加Barcode128

问题描述

PdfDocument pdf = new PdfDocument(new PdfReader(src),new PdfWriter(response.getoutputStream()));
PdfAcroForm form = PdfAcroForm.getAcroForm(pdf,true);
Map<String,PdfFormField> fields = form.getFormFields();
fields.get("productName").setValue(dto.getProductName());
fields.get("shipper_country").setValue(dto.getShipper_country());

Barcode128 code128 = new Barcode128(pdf);
code128.setCode(dto.getoRDER_CUSTOMERINVOICECODE());    
code128.setCodeType(Barcode128.CODE128);
fields.get("ORDER_CUSTOMERINVOICECODE").set(code128.createAwtimage(null,null));

条码显示错误。如何将条形码放入pdf文件

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)