From b83690ebd873abc29a3f365b0cc69125eb6021a1 Mon Sep 17 00:00:00 2001 From: tcitworld Date: Mon, 4 Aug 2014 21:34:44 +0200 Subject: removing examples for mpdf --- .../libraries/mpdf/examples/formsubmit.php | 94 ---------------------- 1 file changed, 94 deletions(-) delete mode 100644 inc/3rdparty/libraries/mpdf/examples/formsubmit.php (limited to 'inc/3rdparty/libraries/mpdf/examples/formsubmit.php') diff --git a/inc/3rdparty/libraries/mpdf/examples/formsubmit.php b/inc/3rdparty/libraries/mpdf/examples/formsubmit.php deleted file mode 100644 index f13a3951..00000000 --- a/inc/3rdparty/libraries/mpdf/examples/formsubmit.php +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - -

Submitted data from PDF Form

-

(See formsubmit.php in the Examples folder for details)

-'; - - -if (count($_POST)) { - // To display HTML output from PDF form - echo '

HTML format data sent as POST

'; - foreach($_POST AS $name=>$val) { - $t = mb_convert_encoding(PDFDocEncodingToWin1252($val), 'UTF-8', 'Windows-1252' ); // If from core fonts doc - echo '

PDFDocEnc: '.$name.' => '.htmlspecialchars($t).'

'; - } -} -else if (count($_GET)) { - // To display HTML output from PDF form - echo '

HTML format data sent as GET

'; - foreach($_GET AS $name=>$val) { - $t = mb_convert_encoding(PDFDocEncodingToWin1252($val), 'UTF-8', 'Windows-1252' ); // If from core fonts doc - echo '

PDFDocEnc: '.$name.' => '.htmlspecialchars($t).'

'; - } -} - -else { - $postdata = file_get_contents("php://input"); - - if ($postdata) { - echo '

XFDF format data detected

'; - // To parse XFDF - if (preg_match_all('/\s*((.*?)<\/value\s*>)\s*<\/field\s*>/s', $postdata, $m)) { - for($i=0; $i(.*?)<\/value\s*>/s', $m[2][$i], $v); - if (count($v[0])>1) { - $values = array(); - foreach($v[1] AS $val) { $values[] = $val; } - //foreach($v[1] AS $val) { $values[] = htmlspecialchars_decode($val); } - echo '

Field: '.$m[1][$i].' => [array of values] ('.implode(', ',$values).')

'; - } - else { - //echo '

Field: '.$m[1][$i].' => '.htmlspecialchars_decode($m[3][$i]).'

'; - echo '

Field: '.$m[1][$i].' => '.$m[3][$i].'

'; - } - } - } - if (preg_match_all('/\s*\s*<\/field\s*>/s', $postdata, $m)) { - for($i=0; $iField: '.$m[1][$i].' => [blank]

'; - } - } - if (preg_match_all('//s', $postdata, $m)) { - for($i=0; $iField: '.$m[1][$i].' => [no value]

'; - } - } - - - // To display whole XFDF - //$postdata = preg_replace("/[\n\r]/", "", $postdata); - //$postdata = preg_replace('/>\s*\n<", $postdata); - //echo nl2br(htmlspecialchars($postdata)); - } - else { echo "No form data detected"; } -} - - - -echo ''; - -exit; - -function PDFDocEncodingToWin1252($txt) { - $Win1252ToPDFDocEncoding = array( - chr(0200) => chr(0240), chr(0214) => chr(0226), chr(0212) => chr(0227), chr(0237) => chr(0230), - chr(0225) => chr(0200), chr(0210) => chr(0032), chr(0206) => chr(0201), chr(0207) => chr(0202), - chr(0205) => chr(0203), chr(0227) => chr(0204), chr(0226) => chr(0205), chr(0203) => chr(0206), - chr(0213) => chr(0210), chr(0233) => chr(0211), chr(0211) => chr(0213), chr(0204) => chr(0214), - chr(0223) => chr(0215), chr(0224) => chr(0216), chr(0221) => chr(0217), chr(0222) => chr(0220), - chr(0202) => chr(0221), chr(0232) => chr(0235), chr(0230) => chr(0037), chr(0231) => chr(0222), - chr(0216) => chr(0231) - ); - return strtr($txt, array_flip($Win1252ToPDFDocEncoding) ); -} - - -?> \ No newline at end of file -- cgit v1.2.3