List of usage examples for com.lowagie.text.pdf PdfName TX
PdfName TX
To view the source code for com.lowagie.text.pdf PdfName TX.
Click Source Link
From source file:org.squale.welcom.outils.pdf.advanced.WPdfFieldReader.java
License:Open Source License
/** * init//from w ww.j a v a 2 s . co m */ public void init() { for (int i = 0; i < pdfReader.getAcroForm().size(); i++) { final PRAcroForm.FieldInformation p = (PRAcroForm.FieldInformation) pdfReader.getAcroForm().getFields() .get(i); final WPdfField pf = new WPdfField(); pf.setName(p.getName()); // Si ce n'est pas un champs text alors on l'ignore if (!p.getInfo().contains(PdfName.FT) || !(((PdfName) p.getInfo().get(PdfName.FT)).toString().equals(PdfName.TX.toString()))) { pf.setType(WPdfFieldType.INCONNU); } else { if (p.getInfo().contains(PdfName.DV)) { pf.setDefaultValue(((PdfString) (p.getInfo().get(PdfName.DV))).toUnicodeString()); } if (p.getInfo().contains(PdfName.V)) { pf.setValue(((PdfString) (p.getInfo().get(PdfName.V))).toUnicodeString()); } if (p.getInfo().contains(PdfName.FF)) { final PdfNumber pn = (PdfNumber) p.getInfo().get(PdfName.FF); if ((pn.intValue() & PdfFormField.FF_MULTILINE) == PdfFormField.FF_MULTILINE) { pf.setType(WPdfFieldType.MUTILINETEXT); } else { pf.setType(WPdfFieldType.TEXT); } } else { pf.setType(WPdfFieldType.TEXT); } } fields.add(pf); } }