Beispiel #1
0
        public PdfPageObject Create(FPDF_PAGE page, FPDF_PAGEOBJECT pageObject)
        {
            if (pageObject.IsNull)
            {
                return(null);
            }

            PageObjTypes pageObjectType = GetPageObjectType(pageObject);

            if (_list.ContainsKey(pageObject))
            {
                PDFPageObjectTypeKeyValuePair mgrIntObjVal = _list[pageObject];
                if (mgrIntObjVal.objType == pageObjectType)
                {
                    return(mgrIntObjVal.obj);
                }
                _list.Remove(pageObject);
            }

            PDFPageObjectTypeKeyValuePair mgrIntObjVal2 = new PDFPageObjectTypeKeyValuePair
            {
                obj     = PdfPageObject.Create(page, pageObject),
                objType = pageObjectType
            };

            this._list.Add(pageObject, mgrIntObjVal2);

            return(mgrIntObjVal2.obj);
        }
Beispiel #2
0
        internal void Add(PdfPageObject item)
        {
            if (item == null)
            {
                return;
            }
            if (this._list.ContainsKey(item.PageObjectHandle))
            {
                return;
            }
            PDFPageObjectTypeKeyValuePair value = new PDFPageObjectTypeKeyValuePair
            {
                obj     = item,
                objType = item.ObjectType
            };

            this._list.Add(item.PageObjectHandle, value);
        }