private void FindSignatureNames() {
if (sigNames != null)
return;
sigNames = new Hashtable();
ArrayList sorter = new ArrayList();
foreach (DictionaryEntry entry in fields) {
Item item = (Item)entry.Value;
PdfDictionary merged = item.GetMerged(0);
if (!PdfName.SIG.Equals(merged.Get(PdfName.FT)))
continue;
PdfDictionary v = merged.GetAsDict(PdfName.V);
if (v == null)
continue;
PdfString contents = v.GetAsString(PdfName.CONTENTS);
if (contents == null)
continue;
PdfArray ro = v.GetAsArray(PdfName.BYTERANGE);
if (ro == null)
continue;
int rangeSize = ro.Size;
if (rangeSize < 2)
continue;
int length = ro.GetAsNumber(rangeSize - 1).IntValue + ro.GetAsNumber(rangeSize - 2).IntValue;
sorter.Add(new Object[]{entry.Key, new int[]{length, 0}});
}
sorter.Sort(new AcroFields.ISorterComparator());
if (sorter.Count > 0) {
if (((int[])((Object[])sorter[sorter.Count - 1])[1])[0] == reader.FileLength)
totalRevisions = sorter.Count;
else
totalRevisions = sorter.Count + 1;
for (int k = 0; k < sorter.Count; ++k) {
Object[] objs = (Object[])sorter[k];
String name = (String)objs[0];
int[] p = (int[])objs[1];
p[1] = k + 1;
sigNames[name] = p;
}
}
}