private void Fill <TObject>( IFiller <TObject> filler, PdfDictionary node ) { PdfArray kidsObject = (PdfArray)node.Resolve(PdfName.Kids); if (kidsObject == null) // Leaf node. { PdfArray namesObject = (PdfArray)node.Resolve(pairsKey); for ( int index = 0, length = namesObject.Count; index < length; index += 2 ) { filler.Add(namesObject, index); } } else // Intermediate node. { foreach (PdfDirectObject kidObject in kidsObject) { Fill(filler, (PdfDictionary)kidObject.Resolve()); } } }
private void Fill <TObject>( IFiller <TObject> filler, PdfReference nodeReference ) { PdfDictionary node = (PdfDictionary)nodeReference.DataObject; File.ResolvedObject <PdfArray> kidsObject = File.Resolve <PdfArray>( node[PdfName.Kids], nodeReference ); if (kidsObject == null) // Leaf node. { File.ResolvedObject <PdfArray> namesObject = File.Resolve <PdfArray>( node[PdfName.Names], nodeReference ); for ( int index = 0, length = namesObject.DataObject.Count; index < length; index += 2 ) { filler.Add( namesObject.DataObject, index, namesObject.Container ); } } else // Intermediate node. { foreach (PdfDirectObject kidObject in kidsObject.DataObject) { Fill(filler, (PdfReference)kidObject); } } }