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

Wrong position of text in PDTextField with multiline

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.18
    • 2.0.21, 3.0.0 PDFBox
    • AcroForm
    • None

    Description

      Hi, I'm not sure if this's the right place to ask this question.

      I've been trying to fill an email value to a PDTextField by doing this:

       

      val field = acroForm.getField(name)

      field.setValue("example+verylongemail@email.com")

       

      It works okay with short email, but for long email:

      • The text is pushed down (wrong starting position)
      • A line break is automatically added at the dot(.)'s position

       

      This is the result:

       

      When I click on the field, the text looks normal, but when I click outside, it reverts to the image above

       

      When I click on the field and edit it, the text looks normal even after I click outside.

      Attachments

        1. Original.pdf
          241 kB
          Hai Dinh
        2. image-2020-01-03-16-03-33-682.png
          5 kB
          Hai Dinh
        3. image-2020-01-03-16-01-25-319.png
          4 kB
          Hai Dinh
        4. image-2020-01-03-15-59-32-196.png
          3 kB
          Hai Dinh
        5. Filled.pdf
          232 kB
          Hai Dinh

        Activity

          People

            msahyoun Maruan Sahyoun
            dhai Hai Dinh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: