protected function _unescape($s)
        {
            $out = '';
            for ($count = 0, $n = strlen($s); $count < $n; $count++) {
                if ($s[$count] != '\\' || $count == $n-1) {
                    $out .= $s[$count];
                } else {
                    switch ($s[++$count]) {
                        case ')':
                        case '(':
                        case '\\':
                            $out .= $s[$count];
                            break;
                        case 'f':
                            $out .= chr(0x0C);
                            break;
                        case 'b':
                            $out .= chr(0x08);
                            break;
                        case 't':
                            $out .= chr(0x09);
                            break;
                        case 'r':
                            $out .= chr(0x0D);
                            break;
                        case 'n':
                            $out .= chr(0x0A);
                            break;
                        case "\r":
                            if ($count != $n-1 && $s[$count+1] == "\n")
                                $count++;
                            break;
                        case "\n":
                            break;
                        default:
                            // Octal-Values
                            if (ord($s[$count]) >= ord('0') &&
                                ord($s[$count]) <= ord('9')) {
                                $oct = ''. $s[$count];

                                if (ord($s[$count+1]) >= ord('0') &&
                                    ord($s[$count+1]) <= ord('9')) {
                                    $oct .= $s[++$count];

                                    if (ord($s[$count+1]) >= ord('0') &&
                                        ord($s[$count+1]) <= ord('9')) {
                                        $oct .= $s[++$count];
                                    }
                                }

                                $out .= chr(octdec($oct));
                            } else {
                                $out .= $s[$count];
                            }
                    }
                }
            }
            return $out;
        }
protected function _unescape($s)
        {
            $out = '';
            for ($count = 0, $n = strlen($s); $count < $n; $count++) {
                if ($s[$count] != '\\' || $count == $n-1) {
                    $out .= $s[$count];
                } else {
                    switch ($s[++$count]) {
                        case ')':
                        case '(':
                        case '\\':
                            $out .= $s[$count];
                            break;
                        case 'f':
                            $out .= chr(0x0C);
                            break;
                        case 'b':
                            $out .= chr(0x08);
                            break;
                        case 't':
                            $out .= chr(0x09);
                            break;
                        case 'r':
                            $out .= chr(0x0D);
                            break;
                        case 'n':
                            $out .= chr(0x0A);
                            break;
                        case "\r":
                            if ($count != $n-1 && $s[$count+1] == "\n")
                                $count++;
                            break;
                        case "\n":
                            break;
                        default:
                            // Octal-Values
                            if (ord($s[$count]) >= ord('0') &&
                                ord($s[$count]) <= ord('9')) {
                                $oct = ''. $s[$count];

                                if (ord($s[$count+1]) >= ord('0') &&
                                    ord($s[$count+1]) <= ord('9')) {
                                    $oct .= $s[++$count];

                                    if (ord($s[$count+1]) >= ord('0') &&
                                        ord($s[$count+1]) <= ord('9')) {
                                        $oct .= $s[++$count];
                                    }
                                }

                                $out .= chr(octdec($oct));
                            } else {
                                $out .= $s[$count];
                            }
                    }
                }
            }
            return $out;
        }
protected function _unescape ( $ s ) { $ out = '' ; for ( $ count = 0 , $ n = strlen ( $ s ) ; $ count < $ n ; $ count ++ ) { if ( $ s [ $ count ] != '\\' || $ count == $ n - 1 ) { $ out .= $ s [ $ count ] ; } else { switch ( $ s [ ++ $ count ] ) { case ')' : case '(' : case '\\' : $ out .= $ s [ $ count ] ; break ; case 'f' : $ out .= chr ( 0x0C ) ; break ; case 'b' : $ out .= chr ( 0x08 ) ; break ; case 't' : $ out .= chr ( 0x09 ) ; break ; case 'r' : $ out .= chr ( 0x0D ) ; break ; case 'n' : $ out .= chr ( 0x0A ) ; break ; case "\r" : if ( $ count != $ n - 1 && $ s [ $ count + 1 ] == "\n" ) $ count ++ ; break ; case "\n" : break ; default : // Octal-Values if ( ord ( $ s [ $ count ] ) >= ord ( '0' ) && ord ( $ s [ $ count ] ) <= ord ( '9' ) ) { $ oct = '' . $ s [ $ count ] ; if ( ord ( $ s [ $ count + 1 ] ) >= ord ( '0' ) && ord ( $ s [ $ count + 1 ] ) <= ord ( '9' ) ) { $ oct .= $ s [ ++ $ count ] ; if ( ord ( $ s [ $ count + 1 ] ) >= ord ( '0' ) && ord ( $ s [ $ count + 1 ] ) <= ord ( '9' ) ) { $ oct .= $ s [ ++ $ count ] ; } } $ out .= chr ( octdec ( $ oct ) ) ; } else { $ out .= $ s [ $ count ] ; } } } } return $ out ; }
Un-escapes a PDF string

@param string $s
@return string
Un - escapes a PDF string