problem with your patch is that it only handles 'old style' xref tables, but fails on xref streams. See XRef.cc:435. Can you rewrite your patch to handle that? E.g. by searching for 'endobj' and than skipping over whitespace? Hib Eris