Reimplement fix for PDFs with content after EOF marker