apache pdfbox setValue报错 UnsupportedOperationException

java.lang.UnsupportedOperationException: null
    at org.apache.pdfbox.pdmodel.font.PDCIDFontType0.encode(PDCIDFontType0.java:400)
    at org.apache.pdfbox.pdmodel.font.PDType0Font.encode(PDType0Font.java:429)
    at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:333)
    at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:364)
    at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.calculateFontSize(AppearanceGeneratorHelper.java:823)
    at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:487)
    at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:424)
    at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:248)
    at org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:264)
    at org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:227)
    at org.apache.pdfbox.pdmodel.interactive.form.PDTextField.setValue(PDTextField.java:219)
  • 原因: 字体不支持
  • 解决方案:调整字体
image.png

你可能感兴趣的:(apache pdfbox setValue报错 UnsupportedOperationException)