本文整理匯總了C#中iTextSharp.text.pdf.IntHashtable.GetKeys方法的典型用法代碼示例。如果您正苦於以下問題:C# IntHashtable.GetKeys方法的具體用法?C# IntHashtable.GetKeys怎麽用?C# IntHashtable.GetKeys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.IntHashtable
的用法示例。
在下文中一共展示了IntHashtable.GetKeys方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddComments
/**
* @param fdf
* @throws IOException
*/
virtual public void AddComments(FdfReader fdf) {
if (readers2intrefs.ContainsKey(fdf))
return;
PdfDictionary catalog = fdf.Catalog;
catalog = catalog.GetAsDict(PdfName.FDF);
if (catalog == null)
return;
PdfArray annots = catalog.GetAsArray(PdfName.ANNOTS);
if (annots == null || annots.Size == 0)
return;
RegisterReader(fdf, false);
IntHashtable hits = new IntHashtable();
Dictionary<String, PdfObject> irt = new Dictionary<string,PdfObject>();
List<PdfObject> an = new List<PdfObject>();
for (int k = 0; k < annots.Size; ++k) {
PdfObject obj = annots[k];
PdfDictionary annot = (PdfDictionary)PdfReader.GetPdfObject(obj);
PdfNumber page = annot.GetAsNumber(PdfName.PAGE);
if (page == null || page.IntValue >= reader.NumberOfPages)
continue;
FindAllObjects(fdf, obj, hits);
an.Add(obj);
if (obj.Type == PdfObject.INDIRECT) {
PdfObject nm = PdfReader.GetPdfObject(annot.Get(PdfName.NM));
if (nm != null && nm.Type == PdfObject.STRING)
irt[nm.ToString()] = obj;
}
}
int[] arhits = hits.GetKeys();
for (int k = 0; k < arhits.Length; ++k) {
int n = arhits[k];
PdfObject obj = fdf.GetPdfObject(n);
if (obj.Type == PdfObject.DICTIONARY) {
PdfObject str = PdfReader.GetPdfObject(((PdfDictionary)obj).Get(PdfName.IRT));
if (str != null && str.Type == PdfObject.STRING) {
PdfObject i;
irt.TryGetValue(str.ToString(), out i);
if (i != null) {
PdfDictionary dic2 = new PdfDictionary();
dic2.Merge((PdfDictionary)obj);
dic2.Put(PdfName.IRT, i);
obj = dic2;
}
}
}
AddToBody(obj, GetNewObjectNumber(fdf, n, 0));
}
for (int k = 0; k < an.Count; ++k) {
PdfObject obj = an[k];
PdfDictionary annot = (PdfDictionary)PdfReader.GetPdfObject(obj);
PdfNumber page = annot.GetAsNumber(PdfName.PAGE);
PdfDictionary dic = reader.GetPageN(page.IntValue + 1);
PdfArray annotsp = (PdfArray)PdfReader.GetPdfObject(dic.Get(PdfName.ANNOTS), dic);
if (annotsp == null) {
annotsp = new PdfArray();
dic.Put(PdfName.ANNOTS, annotsp);
MarkUsed(dic);
}
MarkUsed(annotsp);
annotsp.Add(obj);
}
}