This sorts the xref table by object id instead of offset. I'm not sure to what extent this relies on object ids being distributed sequentially starting with 1.
I have verified that this fixes the generated PDF to work with Mozilla's PDF.js, though, and Preview.app is still happy.
Fixes #49 (compare https://github.com/mozilla/pdf.js/issues/10326#issuecomment-444076445).
This sorts the xref table by object id instead of offset. I'm not sure to what extent this relies on object ids being distributed sequentially starting with 1.
I have verified that this fixes the generated PDF to work with Mozilla's PDF.js, though, and Preview.app is still happy.