我想将条形码居中,因为我的所有文字都居中。我该怎么做?
para = new Paragraph(nom_ecole,FontFactory.getFont(FontFactory.TIMES_BOLD,45));
para.setAlignment(Element.ALIGN_CENTER);
document.add(para);
para = new Paragraph(nom_eleve1+" "+prenom_eleve1,FontFactory.getFont(FontFactory.TIMES_BOLD,45));
para.setAlignment(Element.ALIGN_CENTER);
document.add(para);
codebarre.setCodeType(Barcode.EAN8);
codebarre.setCode(id_doss1);
document.add(codebarre.createImageWithBarcode(cb,BaseColor.BLACK,BaseColor.BLACK));