I am using pdfbox-2.0.2 and I wanted to change colour of fonts of PDField.
I can find examples for pdfbox-1.8.0 but not for pdfbox-2.0.2.
I am getting PDFields using below code -
PDDocument doc = PDDocument.load(inputTemplateNameFile);
PDDocumentCatalog catalog = doc.getDocumentCatalog();
PDAcroForm form = catalog.getAcroForm();
List<PDField> acroFormfieldsTemplateList = form.getFields();
for(PDField field: acroFormfieldsTemplateList){
if(field.getFullyQualifiedName().equals("TEST_FIELD_NAME")){
field.setValue("TEST_TEXT");
}
}
In the above code I want to change font colour of TEST_TEXT.
Jar files used - pdfbox-2.0.2.jar pdfbox-app-2.0.2.jar
Appreciate your help. Thank you.