I have a template with textbox placeholder.I need to ad text this placeholder and align it center.(code below).The below code is working fine in my system(windows 10) but when i move to the server (linux) the text is aligned to left by default.when i clickk on the text thhe text gets center aligned.otherwise left aligned
if (field instanceof PdfTextBoxFieldWidget) {
PdfTextBoxFieldWidget textBoxField = (PdfTextBoxFieldWidget) field;
PdfTextAlignment align = textBoxField.getTextAlignment();
if(textBoxField.getName().equalsIgnoreCase("Insert Start date")){
Dimension2D dim = textBoxField.getSize();
textBoxField.setSize(dim);
textBoxField.setText(fileConversionDto.getCta1());
textBoxField.setTextAlignment(align);
textBoxField.setFlatten(true);
}