Added statement to close the pdf object after parsing.