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

LegacyPDFStreamEngine.glyphList loaded from disk on each instantiation rather than static final?

    XMLWordPrintableJSON

Details

    Description

      I might be wrong on this one, but I can't seem to see how the private final GlyphList glyphList member of LegacyPDFStreamEngine is ever modified, however each instance of LegacyPDFStreamEngine has its own instance of glyphList .

      It is loaded from resources in the constructor on every instantiation, however, is only ever used (passed as an argument) to:

       

      String unicodeMapping = font.toUnicode(code, glyphList);
       
      

      which in turn, I can't seem to see that it is modified.

      An application using many instances of LegacyPDFStreamEngine (which may be a common use-case) would load this disk resource each time it is instantiated. Perhaps it can be made a static final?

       

      Apologies if I was unable to catch the reason for each instance of this list. If there is a reason to have a separate instance, maybe then its worth considering copying from a static final List in memory rather than reloading the same file over and over?...

       

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            alistairo Alistair Oldfield
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: