Exemple #1
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 movie = Dictionary["Movie"] as PDFDictionary;

            if (movie != null)
            {
                res.AddItem("Movie", MovieBase.Copy(movie));
            }

            IPDFObject a = Dictionary["A"];

            if (a != null)
            {
                if (a is PDFBoolean)
                {
                    res.AddItem("A", a.Clone());
                }
                else if (a is PDFDictionary)
                {
                    res.AddItem("A", MovieActivationBase.Copy(a as PDFDictionary));
                }
            }

            MovieAnnotation annot = new MovieAnnotation(res, owner);

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