Return error in pdf_open when internal error happens