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

Text moves when using SetField and then selecting field

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: AcroForm
    • Labels:

      Description

      [imported from SourceForge]
      http://sourceforge.net/tracker/index.php?group_id=78314&atid=552832&aid=1118054
      Originally submitted by benlitchfield on 2005-02-07 10:44.

      Look at pdf_with_lots_of_fields.pdf

      Ran

      java org.pdfbox.examples.fdf.SetField
      tmp\pdf_with_lots_of_fields.pdf "Feld.2" "Test"

      When you select the field with the "Test" text in it, the
      text shifts slightly to the left. It should not do that.

      While looking at this PDF, there are a lot of fields on it,
      should test setting each field to test all the various field
      types. Then add it as a junit test.

      Ben

      [comment on SourceForge]
      Originally sent by pedropuchalski.
      Logged In: YES
      user_id=1463773

      I have similar problem, usually my text is bigger then
      field's "bounding box" so I can see only the lower part of
      chars. As I have researched the sources, I think the problem
      is with org.pdfbox.pdmodel.interactive.form.PDAppearance.
      calculateFontSize(...) method. If it will be implemented
      correct for Type0Fonts(and probably others) text won't
      "move" and (in my case) I will see the whole chars(font size
      will be set properly).

      [comment on SourceForge]
      Originally sent by daniel_.
      Logged In: YES
      user_id=1323827

      I put a sample on the ftp site. The filename is: pdfbox-Bugs-
      1118054_Daniel_testoutput.pdf.

      Daniel

      [comment on SourceForge]
      Originally sent by benlitchfield.
      Logged In: YES
      user_id=601708

      Daniel,

      Can you upload a sample PDF. The PDFBox FTP site
      ftp.pdfbox.org is write only, so you can upload a sample and
      only I will be able to access it.

      Ben Litchfield

      [comment on SourceForge]
      Originally sent by daniel_.
      Logged In: YES
      user_id=1323827

      I have the same problem with my PDFs. The PDF contains a
      text field that is supposed to display a bar code roated by 90
      degrees. The bar code will be displayed by using a special
      font (i.e. Code-39-30). After creating the PDF with PDFBox,
      the bar code is displayed, however not rotated. Only after
      clicking into the text field, the bar code is rotated. Similar
      behaviour as descibed below.
      As we plan to use this in a customer portal and the printed
      documents have to be scanned automatically with the rotated
      bar code, you can imagine that a bugfix for this problem is
      very important and urgent for us.

      Thanks in advance for your help
      Daniel

      [comment on SourceForge]
      Originally sent by benlitchfield.
      Logged In: YES
      user_id=601708

      The problem is that PDFBox is not correctly generating the
      appearance stream for the field. When you click in the field
      Acrobat will regenerate it, which is why it switches back and
      forth between correct and incorrect.

      Thanks for the example docs, I will let you know when I get a
      chance to look at it.

      Ben

      [comment on SourceForge]
      Originally sent by seafoxx.
      Logged In: YES
      user_id=305823

      I think that my problem posted 3 weeks ago is the same as
      this bug.

      when selecting the field the style changes to "as it should
      be", when leaving the style changes back to "how it not
      should be". I added two example-pdf files. the first one is
      the original (template-pdf) with some fields having the
      "comb of x characters" option enabled (did it with adobe,
      not with pdfbox). the second file is the filled pdf, read it
      with pdfbox, filled some fields with "setText()" and then
      saved it back to disk.

      I didn't add the two files to the bug, because they are
      quite big (420k each).

      original text form my forum post:

      One defines, how many letters should be placed inside the
      text field and the letters will all have the same distance
      between each other. I need this option because i have
      several fixed-length input fields and need to place the
      letters on the correct positions.
      an examlpe of the template-pdf placed at
      http://kaempfe.net/pdf/pdfboxexample_before.pdf
      when filling the form fields with pdfbox everyting works
      fine, but the comb-option gets almost lost. the output pdf
      does not display the form fields correctly, the comb-option
      seems to be activated when focussing one form field and
      deactivated on leaving that field. the fields are not
      read-only, so one can edit them in the output-pdf also. when
      doing that, the comp-options comes back and the letters stay
      in place when leaving the form field.
      an example of the output-pdf is placed at
      http://kaempfe.net/pdf/pdfboxexample_after.pdf

      [comment on SourceForge]
      Originally sent by seafoxx.
      Logged In: YES
      user_id=305823

      I have the same problem when using PDField.setComb(true) -
      currently posted to the help-forum, added two links to the
      example-files. forum thread is ->
      http://sourceforge.net/forum/forum.php?thread_id=1294072&forum_id=267205

      cya.
      bastian kaempfe

      [comment on SourceForge]
      Originally sent by benlitchfield.
      Logged In: YES
      user_id=601708

      Also verify pdf_with_fields2.pdf!

      Ben

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Anonymous
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: