well, so maybe there can be a luatex binding to replace original xpdf?
and we can remove cpp code completely in LuaTeX...
(and that enable the plan 9 guys to compile luatex on those exotic systems.)
until know, the most attractive thing is $> pdfdraw -x a.pdf -x xml dump of display tree