Before i used to get the value like that :
AcroFields fields = pdf.getAcroFields();
Set<String> fldNames = (Set) fields.getFields().keySet();
for (String fldName : fldNames)
logger.debug(fldName + " : " + fields.getField(fldName));
But now getFields is deprecated so I wanted to go like :
AcroFields fields = pdf.getAcroFields();
Map<String, AcroFields.Item> fldItems = fields.getAllFields();
fldItems.forEach((key, value) -> {
logger.debug(key + " : " + value.toString());
});
But that print the memory adress of the Item Object.
It is the good way to handle this ?
getAllFields return exactly the same map as getFields does, merely the announced type differs. Thus, you can simply replace getFields by getAllFields in your original code and be done with this deprecation.
Thanks that working.
Maybe give the possibility to get the value field from the Map ??
Most helpful comment
getAllFieldsreturn exactly the same map asgetFieldsdoes, merely the announced type differs. Thus, you can simply replacegetFieldsbygetAllFieldsin your original code and be done with this deprecation.