0
PdfReader reader = new PdfReader(path);
for (int i = 0; i < reader.XrefSize; i++)
{
PdfObject pdfobj = reader.GetPdfObject(i);
if (pdfobj == null || !pdfobj.IsStream())
{
continue;
}
PdfStream stream = (PdfStream) pdfobj;
for (TernaryTree.Iterator it = (TernaryTree.Iterator)stream.Keys; it.HasMoreElements();)// Error
{
PdfName name = (PdfName)it.NextElement();
PdfObject pdobj = stream.Get(name);
if (pdobj is PRIndirectReference)
{
PRIndirectReference inref = (PRIndirectReference)pdobj;
}
}
如何正確地將類型轉換爲迭代器的鍵?C#中的Itextsharp TernaryTree.Iterator
在Java的源代碼看起來是這樣的:
for (Iterator it = stream.getKeys().iterator(); it.hasNext();)