<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 170: Poppler::IndexIter#child doesn't seem to descend</title><link>https://sourceforge.net/p/ruby-gnome2/bugs/170/</link><description>Recent changes to 170: Poppler::IndexIter#child doesn't seem to descend</description><atom:link href="https://sourceforge.net/p/ruby-gnome2/bugs/170/feed.rss" rel="self"/><language>en</language><lastBuildDate>Sun, 03 Jul 2011 02:57:41 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ruby-gnome2/bugs/170/feed.rss" rel="self" type="application/rss+xml"/><item><title>Poppler::IndexIter#child doesn't seem to descend</title><link>https://sourceforge.net/p/ruby-gnome2/bugs/170/</link><description>Hi. I'm rather confused. I looked at the code and what I'm reporting here makes absolutely no sense to me, but I'm doing it anyway, as I believe I have no other option.
So, it seems to be impossible to reach any node within the document outline, below the toplevel nodes. This is the code I'm using to test it:
&amp;lt;pre&amp;gt;
require 'rubygems'
require 'poppler'

doc = Poppler::Document.new\("example.pdf"\)

def print\_tree\(iter\)
puts iter.action.title
if child = iter.child
puts "desc"
print\_tree\(iter\)
end
if iter.next
puts "next"
print\_tree\(iter\) 
end
end

print\_tree\(doc.index\_iter\)
&amp;lt;/pre&amp;gt;

My test document \(actually mirror.ctan.org/biblio/bibtex/utils/alphabib/example.pdf\) has one toplevel node, with several children. The code above though, prints the toplevel node until SystemStackError occurs. The child nodes are never accessed.

To verify that my understanding of the Poppler API is correct, I tried the same in python:
&amp;lt;pre&amp;gt;
import poppler

doc = poppler.document\_new\_from\_file\("file:///home/nilclass/poppler-bug/example.pdf", ""\)

def print\_tree\(iter\):
print iter.get\_action\(\).title
child = iter.get\_child\(\)
if\(child\):
print "desc"
print\_tree\(child\)
if\(iter.next\(\)\):
print "next"
print\_tree\(iter\)

print\_tree\(poppler.IndexIter\(doc\)\)
&amp;lt;/pre&amp;gt;

This works as expected, so I believe the error is somewhere within the ruby bindings.

Versions:
ruby 1.8.7 \(2010-08-16 patchlevel 302\) \[x86\_64-linux\]
poppler 0.16.4 \(ubuntu packages libpoppler13 and libpoppler-glib6\)
poppler gem 0.90.9

Anyway, thank's a lot for all the rest of ruby-gnome that works wonderfully :\)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">unlimited</dc:creator><pubDate>Sun, 03 Jul 2011 02:57:41 -0000</pubDate><guid>https://sourceforge.net8f47534e3e027c0be2b5c0502d92203469af9f5f</guid></item></channel></rss>