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

Border style dictionary width ignored by Adobe Reader when float

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.7
    • Fix Version/s: 2.0.8, 3.0.0 PDFBox
    • Component/s: AcroForm
    • Labels:
      None

      Description

      Text of bug report to adobe:

      Steps to reproduce bug:
      1. Assign border style width 3.0 to each field widget with Apache PDFBox
      2. Open PDF with Adobe Reader

      Results:
      Border is not of width 3

      Expected results:
      Border should be of width 3. However if the same is done programmatically with 3 as an integer (i.e. 3 instead of 3.0) it works. However the PDF 32000 specification clearly tells that the width in the border style dictionary is a "number". It does not request an integer. See Table 166 – Entries in a border style dictionary.

      Sadly I can attach only one file. Both files are also in this bug report:
      https://issues.apache.org/jira/browse/PDFBOX-3929
      The files are named
      BorderWidthTest3.0float.pdf (attach here too)
      and
      BorderWidthTest3int.pdf (displays correctly)

      I have observed this effect only for the attached file (from Garry Grosso in the user mailing list). The effect does not happen with Annotations.

      Code used:

              PDDocument doc = PDDocument.load(new File("BorderWeightTest.pdf"));
              PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
              for (PDField field : acroForm.getFieldTree())
              {
                  System.out.println(field);
                  if (field instanceof PDTextField)
                  {
                      PDBorderStyleDictionary bs = new PDBorderStyleDictionary();
                      bs.setWidth(3);
                      ((PDTextField)field).getWidgets().get(0).setBorderStyle(bs);
                  }
              }
                      
              doc.save(new File("BorderWeightTest-new.pdf"));
              doc.close();
      

        Attachments

        1. BorderWidthTest3int.pdf
          27 kB
          Tilman Hausherr
        2. BorderWidthTest3.0float.pdf
          27 kB
          Tilman Hausherr

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: