Exemplo n.º 1
0
        internal static void CopyTo(PDFDictionary sourceDict, PDFDictionary destinationDict)
        {
            string[] keys = { "H", "FT", "T", "TU", "TM", "Ff", "V", "DV" };
            for (int i = 0; i < keys.Length; ++i)
            {
                IPDFObject obj = sourceDict[keys[i]];
                if (obj != null)
                {
                    destinationDict.AddItem(keys[i], obj.Clone());
                }
            }

            PDFDictionary bs = sourceDict["BS"] as PDFDictionary;

            if (bs != null)
            {
                destinationDict.AddItem("BS", AnnotationBorderStyle.Copy(bs));
            }

            PDFDictionary mk = sourceDict["MK"] as PDFDictionary;

            if (mk != null)
            {
                destinationDict.AddItem("MK", AppearanceCharacteristics.Copy(mk));
            }
        }
Exemplo n.º 2
0
        private void loadAppearanceCharacteristics()
        {
            PDFDictionary mk = Dictionary["MK"] as PDFDictionary;

            if (mk != null)
            {
                _appearanceCharacteristics = new AppearanceCharacteristics(mk);
            }
            else
            {
                _appearanceCharacteristics = new AppearanceCharacteristics();
                Dictionary.AddItem("MK", _appearanceCharacteristics.GetDictionary());
            }
        }
Exemplo n.º 3
0
        internal override Annotation Clone(IDocumentEssential owner, Page page)
        {
            if (Page == null)
            {
                ApplyOwner(owner);
                SetPage(page, true);
                return(this);
            }

            PDFDictionary res = AnnotationBase.Copy(Dictionary);

            IPDFObject t = Dictionary["T"];

            if (t != null)
            {
                res.AddItem("T", t.Clone());
            }

            PDFDictionary mk = Dictionary["MK"] as PDFDictionary;

            if (mk != null)
            {
                res.AddItem("MK", AppearanceCharacteristics.Copy(mk));
            }

            ScreenAnnotation annot = new ScreenAnnotation(res, owner);

            annot.SetPage(Page, false);
            annot.SetPage(page, true);

            annot.OnActivated     = OnActivated;
            annot.OnMouseDown     = OnMouseDown;
            annot.OnMouseEnter    = OnMouseEnter;
            annot.OnMouseExit     = OnMouseExit;
            annot.OnMouseUp       = OnMouseUp;
            annot.OnPageClose     = OnPageClose;
            annot.OnPageInvisible = OnPageInvisible;
            annot.OnPageOpen      = OnPageOpen;
            annot.OnPageVisible   = OnPageVisible;

            return(annot);
        }