Use pdf_getpageref instead of touching xref directly