Class StaticResources


  • public class StaticResources
    extends Object
    Class handles static resources that need to be reset with each parsing of document.
    Author:
    Sergey Shemyakov
    • Method Detail

      • cacheCMap

        public static void cacheCMap​(String name,
                                     CMap cMap)
        Caches CMap object.
        Parameters:
        name - is string key for cached CMap.
        cMap - is CMap object for caching.
      • getCMap

        public static CMap getCMap​(String name)
        Gets CMap for this string key.
        Parameters:
        name - is key for CMap.
        Returns:
        cached CMap with this name or null if no CMap available.
      • cacheStructureNameSpace

        public static void cacheStructureNameSpace​(PDStructureNameSpace nameSpace)
        Caches structure name space. Key is chosen to be indirect reference key of this namespace dictionary.
        Parameters:
        nameSpace - is PD structure name space to cache.
      • getStructureNameSpace

        public static PDStructureNameSpace getStructureNameSpace​(COSKey key)
        Gets cached pd structure name space.
        Parameters:
        key - is COSKey of namespace to get.
        Returns:
        cached namespace with this COSKey or null if no namespace available.
      • cacheFontProgram

        public static void cacheFontProgram​(String key,
                                            FontProgram font)
      • clear

        public static void clear()
        Clears all cached static resources.
      • getcMapCache

        public static Map<String,​CMap> getcMapCache()
      • setcMapCache

        public static void setcMapCache​(Map<String,​CMap> cMapCache)
      • getFlavour

        public static PDFFlavour getFlavour()
      • setFlavour

        public static void setFlavour​(PDFFlavour flavour)