Recover mildly corrupted PDFs locally by rebuilding their structure and validating the output before download.
Output filename control.
Best-effort byte cleanup around the PDF header and EOF marker.
Cross-reference rebuild through a fresh PDF save.
Readable-output validation before download.