private void addExistBookmarks(IList <PdfOutline> destOutlines, MergeItem mi, int currDestItem) { int i = currDestItem; while (!destOutlines[i].GetTitle().StartsWith(FILE_MARKER)) { addExistBookmark2(destOutlines[i], mi.mergeItems, mi.depth + 1); i++; if (i >= destOutlines.Count) { return; } } }
int findPageNumber(MergeItem mergeItem) { if (mergeItem.fileItem.isMissing) { return(-2); } if (mergeItem.pageNumber >= 0) { return(mergeItem.pageNumber); } if (mergeItem.mergeItems != null && mergeItem.mergeItems.Count > 0) { return(findPageNumber(mergeItem.mergeItems[0])); } return(-1); }
int findPageNumber(MergeItem mi) { if (mi.fileItem.isMissing) { return(-2); } if (mi.pageNumber >= 0) { return(mi.pageNumber); } if (ADD_PAGE_TO_ALL_BOOKMARKS) { return(!mi.hasChildren ? -1 : findPageNumber(mi.mergeItems[0])); } return(-1); }
private StringBuilder listMergeItem(MergeItem mi, int depth) { StringBuilder sb = new StringBuilder(); sb.Append(fmtMsg("calc'd depth| ", $"{depth, 4}")); sb.Append(" vs ").Append(fmt(mi.depth)); sb.Append(" bookmarkType| ").Append($"{mi.bookmarkType.ToString(),-8}"); sb.Append(" fileitemType| ").Append($"{mi.fileItem.ItemType.ToString(),-8}"); sb.Append(" page#| ").Append(fmt(mi.pageNumber)); sb.Append(" vs ").Append(fmt(findPageNumber(mi))); sb.Append(" bookmark title| ").Append(StringExtensions.Repeat(" ", depth * 3)).Append(mi.bookmarkTitle); sb.Append(nl); if (mi.fileItem.ItemType == FILE) { sb.Append(fmtMsg("file name| ", mi.fileItem.getName())).Append(nl); sb.Append(fmtMsg("path| ", mi.fileItem.getFullPath)).Append(nl); sb.Append(fmtMsg("outline Path| ", mi.fileItem.outlinePath)); sb.Append(nl).Append(nl); } return(sb); }