We're getting PDFs from a vendor that have 58,000+ null characters following the legal end of the document %%EOF. We're working with the vendor to see if they can correct it, but I want to get ahead of the issue in case they can't.
Using PHP (or classic ASP, though I doubt that's possible) I want to
find the EOF marker
strip anything after
and resave the file as a valid PDF.
I've not worked with binary files before and have only a vague idea of where to even start.