Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5042

IllegalArgumentException when generation of appearances fails

    XMLWordPrintableJSON

Details

    Description

      java.lang.IllegalArgumentException: No glyph for U+0041 (A) in font BZZZZZ+Aladin-Regular
      	at org.apache.pdfbox.pdmodel.font.PDCIDFontType2.encode(PDCIDFontType2.java:372)
      	at org.apache.pdfbox.pdmodel.font.PDType0Font.encode(PDType0Font.java:422)
      	at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:332)
      	at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:363)
      	at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.calculateFontSize(AppearanceGeneratorHelper.java:859)
      	at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:494)
      	at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:422)
      	at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:232)
      	at org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:264)
      	at org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.refreshAppearances(PDAcroForm.java:327)
      	at org.apache.pdfbox.pdmodel.fixup.processor.AcroFormGenerateAppearancesProcessor.process(AcroFormGenerateAppearancesProcessor.java:54)
      	at org.apache.pdfbox.pdmodel.fixup.AcroFormDefaultFixup.apply(AcroFormDefaultFixup.java:56)
      	at org.apache.pdfbox.pdmodel.PDDocumentCatalog.getAcroForm(PDDocumentCatalog.java:132)
      	at org.apache.pdfbox.pdmodel.PDDocumentCatalog.getAcroForm(PDDocumentCatalog.java:113)
      	at org.apache.tika.parser.pdf.PDFParser.extractMetadata(PDFParser.java:267)
      

      It happens with several files, among them the two AML files of PDFBOX-4086.

      I'm not sure if it is a bug - should we catch it? Or ignore it? Or try to generate the fields that work?

      Attachments

        Issue Links

          Activity

            People

              msahyoun Maruan Sahyoun
              tilman Tilman Hausherr
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: