Example #1
0
        internal ArrayList GetKids()
        {
            ArrayList kids = new ArrayList();

            foreach (int id in this.GetArrayNumbers("Kids"))
            {
                PdfFileObject pfo = PdfFile.LoadObject(id);
                if (pfo.Type == PdfObjectType.Page)
                {
                    kids.Add(pfo);
                }
                else
                {
                    kids.AddRange(pfo.GetKids());
                }
            }
            return(kids);
        }
Example #2
0
 internal void PopulateRelatedObjects(PdfFile PdfFile, Hashtable container)
 {
     if (!container.ContainsKey(this.number))
     {
         container.Add(this.number, this);
         Match m = Regex.Match(this.text, @"(?'parent'(/Parent)*)\s*(?'id'\d+) 0 R[^G]", RegexOptions.ExplicitCapture);
         while (m.Success)
         {
             int  num       = int.Parse(m.Groups["id"].Value);
             bool notparent = m.Groups["parent"].Length == 0;
             if (notparent & !container.Contains(num))
             {
                 PdfFileObject pfo = PdfFile.LoadObject(num);
                 if (pfo != null & !container.Contains(pfo.number))
                 {
                     pfo.PopulateRelatedObjects(PdfFile, container);
                 }
             }
             m = m.NextMatch();
         }
     }
 }
 internal void PopulateRelatedObjects(PdfFile PdfFile,Hashtable container)
 {
     if (!container.ContainsKey(this.number))
     {
         container.Add(this.number, this);
         Match m = Regex.Match(this.text, @"(?'parent'(/Parent)*)\s*(?'id'\d+) 0 R[^G]", RegexOptions.ExplicitCapture);
         while (m.Success)
         {
             int num = int.Parse(m.Groups["id"].Value);
             bool notparent = m.Groups["parent"].Length == 0;
             if (notparent & !container.Contains(num))
             {
                 PdfFileObject pfo = PdfFile.LoadObject(num);
                 if (pfo != null & !container.Contains(pfo.number))
                 {
                     pfo.PopulateRelatedObjects(PdfFile, container);
                 }
             }
             m = m.NextMatch();
         }
     }
 }