4

を使用してフィールドにキリル文字の値を追加する方法についてサポートが必要PDFBox APIです。これが私がこれまでに持っているものです:

PDDocument document = PDDocument.load(file);
PDDocumentCatalog dc = document.getDocumentCatalog();
PDAcroForm acroForm = dc.getAcroForm();
PDField naziv = acroForm.getField("naziv");
naziv.setValue("Наслов"); // this part right here
naziv.setValue("Naslov"); // it works like this

私の入力がラテンアルファベットである場合、それは完璧に機能します。しかし、キリル文字の入力も処理する必要があります。どうすればいいですか?

ps これは私が得る例外です: 原因: java.lang.IllegalArgumentException: U+043D ('afii10079') is not available in this font Helvetica encoding: WinAnsiEncoding

4

1 に答える 1