Improving memory usage for PDF files loaded by chunks

as described in #5329, this significantly reduces memory usage for large files loaded by chunking
Nit: please increase the indentation here, so that `MissingDataException` lines up with `expect` on the previous line.