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

Font appears twice in resources of field widget

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.14
    • 2.0.16, 3.0.0 PDFBox
    • AcroForm
    • None

    Description

      See Root/Pages/Kids/[0]/Annots/[0]/AP/N/Resources/Font in the attached file, it has Helv and F2. The file was produced with the CreateSimpleForm example, reloaded and modified and saved.

      The cause is that when the content stream is created, the "Helv" font is added to the resources. In a classic "create a PDF" scenario, PDFBox would notice that the font is already there, but this fails, because the dictionary contains the font, but as an indirect object so it doesn't get found (see COSDictionary.containsValue().

      Solution: check the resource dictionary the hard way in PDResources. I'll do it only for fonts for now.

      Attachments

        1. SimpleForm-Updated.pdf
          21 kB
          Tilman Hausherr

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: