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

Helv vs. Helvetica font names cause PDField.setValue to fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.0
    • 2.0.0
    • AcroForm
    • Mac OS X 10.8.3
      Oracle Java 1.7.0_15-b03

    Description

      I have a PDF form using AcroForm that generates a "Don't know how to calculate the position for non-simple fonts" exception when calling setValue on a textbox field. After running it in a debugger, it appears the problem is that the font inside the AcroForm resources is named "Helv" but PDFBox gets "Helvetica" as the cosFontName on line 434 of PDAppearance.java. So then when it tries to get the font from the formResources on line 439 (formResources.getFonts().get( fontName ), it returns null because there is no "Helvetica" font, only "Helv". I changed the fontName variable's value to "Helv" in the debugger and that allowed setValue to complete without error.

      Is this a problem with the form? I didn't see any way to fix it in Acrobat Pro's UI.

      Attachments

        1. co_absentee.en.filled.pdf
          69 kB
          Maruan Sahyoun
        2. co_absentee.en.pdf
          58 kB
          John Hewson

        Issue Links

          Activity

            People

              msahyoun Maruan Sahyoun
              cap10morgan Wes Morgan
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: