close pdf after parsing is complete