fix pdf stalling issue

hi
#1339