fix crash in pdf format