Exemple #1
0
        public string AddResources(ResourceType type, IPDFObject obj)
        {
            string key = resourceTypeToString(type);

            addDictionaryType(key);

            PDFDictionary res = _dictionary[key] as PDFDictionary;
            string        name;

            if (res.Contains(obj, out name))
            {
                return(name);
            }

            name = getVacantResourseName(res, type);
            res.AddItem(name, obj);
            if (type == ResourceType.XObject)
            {
                PDFDictionaryStream stream = obj as PDFDictionaryStream;
                if (stream != null)
                {
                    PDFName imagename = stream.Dictionary["Subtype"] as PDFName;
                    if (imagename != null)
                    {
                        if (imagename.GetValue() == "Image")
                        {
                            _images.AddItem(new Image(stream));
                        }
                    }
                }
            }
            return(name);
        }