有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

在java中现有的PDF页面上添加条形码128

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文件


共 (0) 个答案