I am trying to set PDFields (in pdAcroForm) file with data containing Unicode Latin Extended-A character.
Getting below error:
java.lang.IllegalArgumentException: U+0154 is not available in this font's encoding: WinAnsiEncoding
We use linux and mac machines to generate pdf.
Sample Code:
try(PDDocument document = PDDocument.load(this.getClass().getClassLoader().getResourceAsStream("template/xyz.pdf"))){
PDDocumentCatalog pdCatalog = document.getDocumentCatalog();
PDAcroForm pdAcroForm = pdCatalog.getAcroForm();
if(pdAcroForm.getField(DATA) != null && StringUtils.isNotEmpty(DATA))
pdAcroForm.getField(DATA).setValue("Ŕaym");