internal override Action Clone(IDocumentEssential owner) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("Type", new PDFName("Action")); dict.AddItem("S", new PDFName("ImportData")); PDFDictionary fs = _dictionary["F"] as PDFDictionary; if (fs != null) { dict.AddItem("F", fs); } ImportDataAction action = new ImportDataAction(dict, owner); IPDFObject next = _dictionary["Next"]; if (next != null) { for (int i = 0; i < Next.Count; ++i) { action.Next.Add(Next[i]); } } return(action); }
//TODO : IT internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { PointF[] points = Vertices.ToArray(); ApplyOwner(owner); SetPage(page, true); Vertices.Clear(); Vertices.Page = page; Vertices.AddRange(points); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); MarkupAnnotationBase.CopyTo(Dictionary, res); PolygonPolylineAnnotation.CopyTo(Dictionary, res, Page, page); PolylineAnnotation annot = new PolylineAnnotation(res, owner); annot.SetPage(Page, false); annot.SetPage(page, true); return(annot); }
internal override Action Clone(IDocumentEssential owner) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("Type", new PDFName("Action")); dict.AddItem("S", new PDFName("JavaScript")); IPDFObject js = _dictionary["JS"]; if (js != null) { dict.AddItem("JS", js.Clone()); } JavaScriptAction action = new JavaScriptAction(dict, owner); IPDFObject next = _dictionary["Next"]; if (next != null) { for (int i = 0; i < Next.Count; ++i) { action.Next.Add(Next[i]); } } return(action); }
internal override Action Clone(IDocumentEssential owner) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("Type", new PDFName("Action")); dict.AddItem("S", new PDFName("SetOCGState")); string[] keys = { "State", "PreserveRB" }; for (int i = 0; i < keys.Length; ++i) { IPDFObject obj = _dictionary[keys[i]]; if (obj != null) { dict.AddItem(keys[i], obj.Clone()); } } SetOptionalContentGroupsStateAction action = new SetOptionalContentGroupsStateAction(dict, owner); IPDFObject next = _dictionary["Next"]; if (next != null) { for (int i = 0; i < Next.Count; ++i) { action.Next.Add(Next[i]); } } return(action); }
internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { ApplyOwner(owner); SetPage(page, true); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); MarkupAnnotationBase.CopyTo(Dictionary, res); IPDFObject name = Dictionary["Name"]; if (name != null) { res.AddItem("Name", name.Clone()); } IPDFObject fs = Dictionary["FS"]; if (fs != null) { res.AddItem("FS", fs.Clone()); } FileAttachmentAnnotation annot = new FileAttachmentAnnotation(res, owner); annot.SetPage(Page, false); annot.SetPage(page, true); return(annot); }
internal override Action Clone(IDocumentEssential owner) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("Type", new PDFName("Action")); dict.AddItem("S", new PDFName("Trans")); PDFDictionary trans = _dictionary["Trans"] as PDFDictionary; if (trans != null) { dict.AddItem("Trans", TransitionBase.Copy(trans)); } TransitionAction action = new TransitionAction(dict, owner); IPDFObject next = _dictionary["Next"]; if (next != null) { for (int i = 0; i < Next.Count; ++i) { action.Next.Add(Next[i]); } } return(action); }
internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { ApplyOwner(owner); SetPage(page, true); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); MarkupAnnotationBase.CopyTo(Dictionary, res); IPDFObject name = Dictionary["Name"]; if (name != null) { res.AddItem("Name", name.Clone()); } IPDFObject sound = Dictionary["Sound"]; if (sound != null) { res.AddItem("Sound", sound); } SoundAnnotation annot = new SoundAnnotation(res, owner); annot.SetPage(Page, false); annot.SetPage(page, true); return(annot); }
internal override Action Clone(IDocumentEssential owner) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("Type", new PDFName("Action")); dict.AddItem("S", new PDFName("ResetForm")); string[] keys = { "Flags", "Fields" }; for (int i = 0; i < keys.Length; ++i) { IPDFObject obj = _dictionary[keys[i]]; if (obj != null) { dict.AddItem(keys[i], obj.Clone()); } } ResetFormAction action = new ResetFormAction(dict, owner); IPDFObject next = _dictionary["Next"]; if (next != null) { for (int i = 0; i < Next.Count; ++i) { action.Next.Add(Next[i]); } } return(action); }
internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { ApplyOwner(owner); SetPage(page, true); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); Field.CopyTo(Dictionary, res); PushButton annot = new PushButton(res, owner, false); annot.SetPage(Page, false); annot.SetPage(page, true); annot._fontColor = _fontColor; annot._font = _font; annot._font.ChangedFontSize += annot.changedFontSize; Field.SetActions(this, annot); return(annot); }
internal AnnotationCollections(PDFArray arr, IDocumentEssential owner, Page page) { _array = arr; _owner = owner; _page = page; parseAnnotations(); }
internal Page(PDFDictionary dict, IDocumentEssential owner) { _dictionary = dict; _owner = owner; Watermarks = new WatermarkCollection(); }
internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { ApplyOwner(owner); SetPage(page, true); float l = Left; float t = Top; float w = Width; float h = Height; float a = RotationAngle; Rectangle = null; Rectangle.Left = l; Rectangle.Top = t; Rectangle.Width = w; Rectangle.Height = h; Rectangle.Angle = a; return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); MarkupAnnotationBase.CopyTo(Dictionary, res); TextMarkupAnnotation.CopyTo(Dictionary, res, Page, page); UnderlineAnnotation annot = new UnderlineAnnotation(res, owner); annot.SetPage(page, true); return(annot); }
private void parsePage(PDFArray arr, IDocumentEssential owner) { IPDFObject page = arr[0]; if (page == null) { return; } if (page is PDFNumber) { _page = owner.GetPage((int)(page as PDFNumber).GetValue()); } else if (page is PDFDictionary) { _page = owner.GetPage(page as PDFDictionary); } else { _page = null; } arr.RemoveItem(0); if (_page != null) { arr.Insert(0, _page.GetDictionary()); } else { arr.Insert(0, new PDFNull()); } }
internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { ApplyOwner(owner); SetPage(page, true); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); IPDFObject threeDD = Dictionary["3DD"]; if (threeDD != null) { res.AddItem("3DD", ThreeDData.Copy(threeDD)); } string[] keys = { "3DV", "3DA", "3DI", "3DB" }; for (int i = 0; i < keys.Length; ++i) { IPDFObject obj = Dictionary[keys[i]]; if (obj != null) { res.AddItem(keys[i], obj.Clone()); } } ThreeDAnnotation annot = new ThreeDAnnotation(res, owner); annot.SetPage(Page, false); annot.SetPage(page, true); return(annot); }
internal Destination(IPDFObject dest, IDocumentEssential owner) { PDFString s = dest as PDFString; if (s != null) { dest = owner.GetDestinationFromNames(s.GetValue()); if (dest == null) { dest = new PDFArray(); } } PDFArray array = dest as PDFArray; if (array != null) { parsePage(array, owner); parseZoomMode(array); parseProperties(array, owner); } else { dest = new PDFArray(); } _array = dest as PDFArray; }
internal Outline(PDFDictionary dict, IDocumentEssential owner) { _owner = owner; _dictionary = dict; loadDestination(); loadAction(); }
internal RadioButton(PDFDictionary dict, IDocumentEssential owner) : base(dict, owner) { PDFDictionary ap = dict["AP"] as PDFDictionary; if (ap != null) { PDFDictionary n = ap["N"] as PDFDictionary; if (n != null) { string[] keys = n.GetKeys(); if (keys.Length == 0) { _exportValue = "value1"; } else if (keys.Length == 1) { _exportValue = keys[0]; } else { _exportValue = keys[0] == "Off" ? keys[1] : keys[0]; } } else { _exportValue = "value1"; } } else { _exportValue = "value1"; } }
internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { ApplyOwner(owner); SetPage(page, true); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); MarkupAnnotationBase.CopyTo(Dictionary, res); string[] keys = { "RD", "Sy" }; for (int i = 0; i < keys.Length; ++i) { IPDFObject obj = Dictionary[keys[i]]; if (obj != null) { res.AddItem(keys[i], obj.Clone()); } } CaretAnnotation annot = new CaretAnnotation(res, owner); annot.SetPage(Page, false); annot.SetPage(page, true); return(annot); }
internal Annotation(IDocumentEssential owner) { _dictionary = new PDFDictionary(); _dictionary.AddItem("Type", new PDFName("Annot")); Print = true; Owner = owner; }
internal override Action Clone(IDocumentEssential owner) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("Type", new PDFName("Action")); dict.AddItem("S", new PDFName("Hide")); IPDFObject t = _dictionary["T"]; if (t != null) { dict.AddItem("T", t.Clone()); } HideAction action = new HideAction(dict, owner); action.Hide = Hide; IPDFObject next = _dictionary["Next"]; if (next != null) { for (int i = 0; i < Next.Count; ++i) { action.Next.Add(Next[i]); } } return(action); }
// TODO: //internal PointsArray CoordinatesLines //{ // get // { // if (m_coordinatesLines == null) // { // PDFArray array = Dictionary["CL"] as PDFArray; // if (array == null) // { // m_coordinatesLines = new PointsArray(); // m_coordinatesLines.AddPoint(new PointF(Left, Top + Height / 2)); // m_coordinatesLines.AddPoint(new PointF(Left, Top + Height / 2)); // Dictionary.AddItem("CL", m_coordinatesLines.Array); // } // else // m_coordinatesLines = new PointsArray(array, Page); // } // return m_coordinatesLines; // } //} //internal PDFLineEndingStyle EndLineStyle //{ // get { return TypeConverter.PDFNameToPDFLineEndingStyle(Dictionary["LE"] as PDFName); } // set { Dictionary.AddItem("LE", TypeConverter.PDFLineEndingStyleToPDFName(value)); } //} //TODO IT internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { ApplyOwner(owner); SetPage(page, true); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); MarkupAnnotationBase.CopyTo(Dictionary, res); string[] keys = { "DA", "Q", "RC", "DS", "IT", "BE", "RD", "LE" }; for (int i = 0; i < keys.Length; ++i) { IPDFObject obj = Dictionary[keys[i]]; if (obj != null) { res.AddItem(keys[i], obj.Clone()); } } PDFArray cl = Dictionary["CL"] as PDFArray; if (cl != null) { RectangleF oldRect; if (Page == null) { oldRect = new RectangleF(); } else { oldRect = Page.PageRect; } res.AddItem("CL", CloneUtility.CopyArrayCoordinates(cl, oldRect, page.PageRect, Page == null)); } PDFDictionary bs = Dictionary["BS"] as PDFDictionary; if (bs != null) { res.AddItem("BS", AnnotationBorderStyle.Copy(bs)); } FreeTextAnnotation annot = new FreeTextAnnotation(res, owner, false); annot.SetPage(Page, false); annot.SetPage(page, true); annot._font = _font; annot._font.ChangedFontSize += annot.changedFontSize; annot._fontColor = _fontColor; annot.setTextAttributes(); return(annot); }
internal PageCollection(IDocumentEssential owner) { _dictionary = new PDFDictionary(); _dictionary.AddItem("Type", new PDFName("Pages")); _dictionary.AddItem("Count", new PDFNumber(0)); _dictionary.AddItem("Kids", new PDFArray()); _owner = owner; }
internal EditBox(PDFDictionary dict, IDocumentEssential owner, bool parseFont) : base(dict, owner) { if (parseFont) { parseFontAndColor(); } }
internal override void ApplyOwner(IDocumentEssential owner) { base.ApplyOwner(owner); if (_fields != null) { _fields.Owner = owner; } }
internal FreeTextAnnotation(PDFDictionary dict, IDocumentEssential owner, bool parseFont) : base(dict, owner) { if (parseFont) { parseFontAndColor(); } }
internal override void ApplyOwner(IDocumentEssential owner) { Owner = owner; if (_action != null) { _action.ApplyOwner(owner); } }
internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { ApplyOwner(owner); SetPage(page, true); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); IPDFObject h = Dictionary["H"]; if (h != null) { res.AddItem("H", h.Clone()); } PDFArray quadPoints = Dictionary["QuadPoints"] as PDFArray; if (quadPoints != null) { RectangleF oldRect; if (Page == null) { oldRect = new RectangleF(); } else { oldRect = Page.PageRect; } res.AddItem("QuadPoints", CloneUtility.CopyArrayCoordinates(quadPoints, oldRect, page.PageRect, Page == null)); } IPDFObject pa = Dictionary["PA"]; if (pa != null) { res.AddItem("PA", pa.Clone()); } LinkAnnotation annot = new LinkAnnotation(res, owner); if (_destination != null) { annot.Destination = Destination; } if (_action != null) { annot.Action = _action; } annot.SetPage(Page, false); annot.SetPage(page, true); return(annot); }
internal PushButton(PDFDictionary dict, IDocumentEssential owner, bool createFont) : base(dict, owner) { if (createFont) { _font = new Font(StandardFonts.Helvetica, 12); _font.ChangedFontSize += changedFontSize; _fontColor = new ColorRGB(0, 0, 0); } }
internal virtual void ApplyOwner(IDocumentEssential owner) { _owner = owner; if (GetDictionary()["Next"] != null) { ActionCollection next = Next; for (int i = 0; i < next.Count; ++i) { next[i].ApplyOwner(owner); } } }
internal AnnotationCollections Clone(IDocumentEssential owner, Page page) { AnnotationCollections annots = new AnnotationCollections(owner, _page); annots._page = page; for (int i = 0; i < _annotations.Count; ++i) { annots.Add(_annotations[i]); } return(annots); }