public string GetPageLabel(int pageindex)
 {
     foreach (PDFPageNumberRegistration reg in this._registrations)
     {
         if (reg.FirstPageIndex <= pageindex && (reg.IsClosed == false || reg.LastPageIndex >= pageindex))
         {
             return(reg.GetPageLabel(pageindex));
         }
     }
     return(_default.GetPageLabel(pageindex));
 }
        //
        // private implementation
        //

        private PDFPageNumberData GetPageDataWithGroup(int pageIndex, PDFPageNumberGroup grp)
        {
            string label             = grp.GetPageLabel(pageIndex);
            string lastLabel         = grp.GetPageLabel(this.TotalPages);
            int    grpNum            = pageIndex + grp.NumberStart;
            int    lastGrpNum        = this.TotalPages + 1;
            int    globalPageNum     = pageIndex + 1;
            int    globalLastPageNum = _totalpages + 1;

            PDFPageNumberData data = new PDFPageNumberData(grp)
            {
                Label           = label,
                LastLabel       = lastLabel,
                GroupNumber     = grpNum,
                GroupLastNumber = lastGrpNum,
                PageNumber      = globalPageNum,
                LastPageNumber  = globalLastPageNum
            };

            return(data);
        }