Beispiel #1
0
        public object Clone()
        {
            k_Tree lk_Clone = new k_Tree(mb_AllowDuplicateKeys, mk_Comparer);

            lk_Clone.mi_Count = mi_Count;
            CloneRecursive(mk_Head, null, ref lk_Clone.mk_Head);
            lk_Clone.mk_Left  = k_Tree.LeftMost(lk_Clone.mk_Head);
            lk_Clone.mk_Right = k_Tree.RightMost(lk_Clone.mk_Head);

            return(lk_Clone);
        }
Beispiel #2
0
 // constructors
 /**
 * Constructs a new <CODE>PdfBody</CODE>.
 * @param writer
 */
 internal PdfBody(PdfWriter writer)
 {
     xrefs = new k_Tree();
     xrefs[new PdfCrossReference(0, 0, 65535)] = null;
     position = writer.Os.Counter;
     refnum = 1;
     this.writer = writer;
 }
Beispiel #3
0
 /**
 * Adds the local destinations to the body of the document.
 * @param dest the <CODE>Hashtable</CODE> containing the destinations
 * @throws IOException on error
 */
 internal void AddLocalDestinations(k_Tree dest)
 {
     foreach (String name in dest.Keys) {
         Object[] obj = (Object[])dest[name];
         PdfDestination destination = (PdfDestination)obj[2];
         if (destination == null)
             throw new Exception("The name '" + name + "' has no local destination.");
         if (obj[1] == null)
             obj[1] = PdfIndirectReference;
         AddToBody(destination, (PdfIndirectReference)obj[1]);
     }
 }
Beispiel #4
0
 public k_PinnedNodeIterator(k_Tree ak_Tree, k_Node ak_Node)
     : base(ak_Tree, ak_Node)
 {
 }
Beispiel #5
0
 public k_NodeIterator(k_Tree ak_Tree, k_Node ak_Node)
 {
     mk_Tree = ak_Tree;
     mk_Current = ak_Node;
 }
Beispiel #6
0
        public object Clone()
        {
            k_Tree lk_Clone = new k_Tree(mb_AllowDuplicateKeys, mk_Comparer);
            lk_Clone.mi_Count = mi_Count;
            CloneRecursive(mk_Head, null, ref lk_Clone.mk_Head);
            lk_Clone.mk_Left = k_Tree.LeftMost(lk_Clone.mk_Head);
            lk_Clone.mk_Right = k_Tree.RightMost(lk_Clone.mk_Head);

            return lk_Clone;
        }
Beispiel #7
0
 public k_NodeIterator(k_Tree ak_Tree, k_Node ak_Node)
 {
     mk_Tree    = ak_Tree;
     mk_Current = ak_Node;
 }
Beispiel #8
0
 public k_PinnedNodeIterator(k_Tree ak_Tree, k_Node ak_Node)
     : base(ak_Tree, ak_Node)
 {
 }
Beispiel #9
0
 /**
 * Adds the names of the named destinations to the catalog.
 * @param localDestinations the local destinations
 * @param documentJavaScript the javascript used in the document
 * @param writer the writer the catalog applies to
 */
 internal void AddNames(k_Tree localDestinations, ArrayList documentJavaScript, Hashtable documentFileAttachment, PdfWriter writer)
 {
     if (localDestinations.Count == 0 && documentJavaScript.Count == 0 && documentFileAttachment.Count == 0)
         return;
     PdfDictionary names = new PdfDictionary();
     if (localDestinations.Count > 0) {
         PdfArray ar = new PdfArray();
         foreach (DictionaryEntry entry in localDestinations) {
             String name = (String)entry.Key;
             Object[] obj = (Object[])entry.Value;
             PdfIndirectReference refi = (PdfIndirectReference)obj[1];
             ar.Add(new PdfString(name));
             ar.Add(refi);
         }
         PdfDictionary dests = new PdfDictionary();
         dests.Put(PdfName.NAMES, ar);
         names.Put(PdfName.DESTS, writer.AddToBody(dests).IndirectReference);
     }
     if (documentJavaScript.Count > 0) {
         String[] s = new String[documentJavaScript.Count];
         for (int k = 0; k < s.Length; ++k)
             s[k] = k.ToString("X");
         Array.Sort(s);
         PdfArray ar = new PdfArray();
         for (int k = 0; k < s.Length; ++k) {
             ar.Add(new PdfString(s[k]));
             ar.Add((PdfIndirectReference)documentJavaScript[k]);
         }
         PdfDictionary js = new PdfDictionary();
         js.Put(PdfName.NAMES, ar);
         names.Put(PdfName.JAVASCRIPT, writer.AddToBody(js).IndirectReference);
     }
     if (documentFileAttachment.Count > 0) {
         names.Put(PdfName.EMBEDDEDFILES, writer.AddToBody(PdfNameTree.WriteTree(documentFileAttachment, writer)).IndirectReference);
     }
     Put(PdfName.NAMES, writer.AddToBody(names).IndirectReference);
 }
Beispiel #10
0
 /** Creates a new PdfPageLabel with a default logical page 1
  */
 public PdfPageLabels()
 {
     map = new k_Tree(false, this);
     AddPageLabel(1, DECIMAL_ARABIC_NUMERALS, null, 1);
 }