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

Performance issue when filling the first PDTextField of an AcroForm

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • AcroForm

    Description

      When filling the first PDTextField in a form the performance is slow. All other PDTextFields in the form are handled quickly.

      This code

      PDTextField field = (PDTextField) doc.getDocumentCatalog().getAcroForm().getField("Textfield01");
      long start = System.nanoTime();
      field.setValue("ABCD");
      long end = System.nanoTime();
      double difference = (end - start)/1e6;
      System.out.println(difference);
      
      field = (PDTextField) doc.getDocumentCatalog().getAcroForm().getField("Textfield02");
      start = System.nanoTime();
      field.setValue("ABCD");
      end = System.nanoTime();
      difference = (end - start)/1e6;
      System.out.println(difference);
      

      produces the following output

      9713.38
      3.904
      

      Attachments

        1. ProfilingOutput.png
          113 kB
          Maruan Sahyoun
        2. PDTextField.pdf
          15 kB
          Maruan Sahyoun

        Activity

          People

            jahewson John Hewson
            msahyoun Maruan Sahyoun
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: