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;
}
}
如何正确地将类型键转换为迭代器?
在 Java 的源代码中看起来像这样:
for (Iterator it = stream.getKeys().iterator(); it.hasNext();)