more error checking in pdf and pdf_and_swf conversions