I have found one bug with startxref position counting,
and one not-a-bug with parsing AFM files, that have more
spaces between 'C' and numbers (I have some fonts with
fonts/ArialCE.afm:C 32 ; WX 333 ; N space ; B 0 0 0 0 ;
The first bug forced my xpdf to reconstruct xref table,
since xpdf serached for 'xref' string and it founds "\nxre"
all the time. It is clear now, but it took me some time
to realize that (web searching, PDF reference reading,
xpdf source hacking). The $pos variable counts length
of all the strings before 'xref' string, but misses a new line
char directly added before xref.
I submit (I'll try to submit) a small two-line patch.