def decodeString(string):
 decodedString = string
 octalNumbers = re.findall('\\\\([0-7]{1-3})', decodedString, re.DOTALL)
 for octal in octalNumbers:
  try:
   decodedString = decodedString.replace(('\\\\' + octal), chr(int(octal, 8)))
  except:
   return ((-1), 'Error decoding string')
 return (0, decodedString)

def decodeString ( string ) : decodedString = string octalNumbers = re . findall ( '\\\\([0-7]{1-3})' , decodedString , re . DOTALL ) for octal in octalNumbers : try : decodedString = decodedString . replace ( ( '\\\\' + octal ) , chr ( int ( octal , 8 ) ) ) except : return ( ( - 1 ) , 'Error decoding string' ) return ( 0 , decodedString )
decode the given pdf string .