gfdg nhffd

"; //exit; //} else class RPDF extends FPDF { // thanks to http://www.fpdf.org/en/script/script31.php function TextWithDirection($x, $y, $txt, $direction='R') { if ($direction=='R') $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',1,0,0,1,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); elseif ($direction=='L') $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',-1,0,0,-1,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); elseif ($direction=='U') $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',0,1,-1,0,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); elseif ($direction=='D') $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',0,-1,1,0,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); else $s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); if ($this->ColorFlag) $s='q '.$this->TextColor.' '.$s.' Q'; $this->_out($s); } function TextWithRotation($x, $y, $txt, $txt_angle, $font_angle=0) { $font_angle+=90+$txt_angle; $txt_angle*=M_PI/180; $font_angle*=M_PI/180; $txt_dx=cos($txt_angle); $txt_dy=sin($txt_angle); $font_dx=cos($font_angle); $font_dy=sin($font_angle); $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',$txt_dx,$txt_dy,$font_dx,$font_dy,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); if ($this->ColorFlag) $s='q '.$this->TextColor.' '.$s.' Q'; $this->_out($s); } } $getit=""; $factor=1; $lastrepeat=""; $repeats=0; $mewd=null; $newd=null; $newdts=""; $sfm="0"; $newdtssuffix=""; if (isset($_POST['mytzn'])) { if (('' . urldecode($_POST['mytzn'])) != '') { date_default_timezone_set(urldecode($_POST['mytzn'])); } $newd=new DateTime(); //date_create(''); $newdts=$newd->format(DateTime::COOKIE); $mewd=$newd; $newdtssuffix="_" . urldecode($_POST['mytzn']); //echo "Newdts=" . $newdts; //exit; } else if (isset($_GET['mytzn'])) { if (('' . urldecode($_GET['mytzn'])) != '') { date_default_timezone_set(urldecode($_GET['mytzn'])); } $newd=new DateTime(); //date_create(''); $newdts=$newd->format(DateTime::COOKIE); $mewd=$newd; $newdtssuffix="_" . urldecode($_GET['mytzn']); //echo "newdts=" . $newdts; //exit; } else if (isset($_GET['myls1'])) { if (strpos(urldecode($_GET['myls1']), '/') > strpos(urldecode($_GET['myls1']), '_') && strpos(urldecode($_GET['myls1']), '/') !== false && strpos(urldecode($_GET['myls1']), '_') !== false) { $lstz=str_replace(explode('_', urldecode($_GET['myls1']))[0] . '_', '', urldecode($_GET['myls1'])); if (('' . $lstz) != '') { date_default_timezone_set($lstz); } $newdtssuffix="_" . $lstz; $newd=new DateTime(); //date_create(''); $newdts=$newd->format(DateTime::COOKIE); $mewd=$newd; $sfm="1"; } } else if (isset($_GET['myls2'])) { if (strpos(urldecode($_GET['myls2']), '/') > strpos(urldecode($_GET['myls2']), '_') && strpos(urldecode($_GET['myls2']), '/') !== false && strpos(urldecode($_GET['myls2']), '_') !== false) { $lstz=str_replace(explode('_', urldecode($_GET['myls2']))[0] . '_', '', urldecode($_GET['myls2'])); if (('' . $lstz) != '') { date_default_timezone_set($lstz); } $newdtssuffix="_" . $lstz; $newd=new DateTime(); //date_create(''); $newdts=$newd->format(DateTime::COOKIE); $mewd=$newd; $sfm="2"; } } else if (isset($_GET['myls3'])) { if (strpos(urldecode($_GET['myls3']), '/') > strpos(urldecode($_GET['myls1']), '_') && strpos(urldecode($_GET['myls3']), '/') !== false && strpos(urldecode($_GET['myls3']), '_') !== false) { $lstz=str_replace(explode('_', urldecode($_GET['myls3']))[0] . '_', '', urldecode($_GET['myls1'])); if (('' . $lstz) != '') { date_default_timezone_set($lstz); } $newdtssuffix="_" . $lstz; $newd=new DateTime(); //date_create(''); $newdts=$newd->format(DateTime::COOKIE); $mewd=$newd; $sfm="3"; } } else if (isset($_GET['myls'])) { if (strpos(urldecode($_GET['myls']), '/') > strpos(urldecode($_GET['myls']), '_') && strpos(urldecode($_GET['myls']), '/') !== false && strpos(urldecode($_GET['myls']), '_') !== false) { $lstz=str_replace(explode('_', urldecode($_GET['myls']))[0] . '_', '', urldecode($_GET['myls'])); if (('' . $lstz) != '') { date_default_timezone_set($lstz); } $newdtssuffix="_" . $lstz; $newd=new DateTime(); //date_create(''); $newdts=$newd->format(DateTime::COOKIE); $mewd=$newd; } } else if (isset($_POST['myls'])) { if (strpos(urldecode($_POST['myls']), '/') > strpos(urldecode($_POST['myls']), '_') && strpos(urldecode($_POST['myls']), '/') !== false && strpos(urldecode($_POST['myls']), '_') !== false) { $lstz=str_replace(explode('_', urldecode($_POST['myls']))[0] . '_', '', urldecode($_POST['myls'])); if (('' . $lstz) != '') { date_default_timezone_set($lstz); } $newd=new DateTime(); //date_create(''); $newdts=$newd->format(DateTime::COOKIE); $mewd=$newd; } } else if (!isset($_POST['pdffile'])) { $getit=" document.getElementById('mytzn').value='' + Intl.DateTimeFormat().resolvedOptions().timeZone; if (document.URL.indexOf('?') == -1) { location.href=document.URL + '?mytzn=' + encodeURIComponent(document.getElementById('mytzn').value); } "; } $ofsz=""; $ofst=""; $orot=""; $odir=""; $user_agent = $_SERVER['HTTP_USER_AGENT']; $ffnos="Text from now on Colour Size Direction Rotation Style Family ideas ...
 px  °    

For next click establish default text ...
"; function ffs($insuf) { global $ffy, $fst, $fsz, $ofsz, $ofst; if (isset($_POST['pdffamily' . $insuf])) { $ffy=str_replace('+',' ',urldecode($_POST['pdffamily' . $insuf])); } if (isset($_POST['pdffontstyle' . $insuf])) { $fst=str_replace('N',' ',substr(strtoupper(str_replace('+',' ',urldecode($_POST['pdffontstyle' . $insuf]))) . ' ',0,1)); if ($insuf != '') { $ofst=$fst; } } if (isset($_POST['pdffontsize' . $insuf])) { if (strlen(trim(str_replace('+',' ',urldecode($_POST['pdffontsize' . $insuf])))) > 0) { $fsz=str_replace('+',' ',urldecode($_POST['pdffontsize' . $insuf])); if ($insuf != '') { $ofsz=$fsz; } } } if ($ofsz == "") { $ofsz=$fsz; } if ($ofst == "") { $ofst=$fst; } } function gffs($insuf) { global $ffy, $fst, $fsz, $ofsz, $ofst; if (isset($_GET['pdffamily' . $insuf])) { $ffy=str_replace('+',' ',urldecode($_GET['pdffamily' . $insuf])); } if (isset($_GET['pdffontstyle' . $insuf])) { $fst=str_replace('N',' ',substr(strtoupper(str_replace('+',' ',urldecode($_GET['pdffontstyle' . $insuf]))) . ' ',0,1)); if ($insuf != '') { $ofst=$fst; } } if (isset($_GET['pdffontsize' . $insuf])) { if (strlen(trim(str_replace('+',' ',urldecode($_GET['pdffontsize' . $insuf])))) > 0) { $fsz=str_replace('+',' ',urldecode($_GET['pdffontsize' . $insuf])); if ($insuf != '') { $ofsz=$fsz; } } } if ($ofsz == "") { $ofsz=$fsz; } if ($ofst == "") { $ofst=$fst; } } function yoururldecode($inmd) { return urldecode($inmd); } function nuance($zrepeats,$inoth,$inrs,$negplus,$inpal,$outpal,$oone,$otwo) { global $newd, $repeats, $lastrepeat, $factor, $newdts; $altnegplus=''; $rests=''; if ($oone != $otwo && strpos($otwo, $oone) !== false) { // && $zrepeats < 0) { $rests=explode($oone, $otwo)[1]; if ($zrepeats < 0) { $altnegplus=explode(';', str_replace('+','',str_replace('=','', $rests)))[0]; } } //echo "zrepeats=". $zrepeats . "and repeats=" . $repeats; //exit; if ($rests != '') { $xi=explode($rests, $inpal)[0]; $inpal=$xi . substr($inpal, strlen($xi) + strlen($rests)); } if ($repeats < 0) { //echo "inpal=" . $inpal; //exit; $lastrepeat=$inpal; //$repeats=-$repeats; } else if ($repeats > 0) { $inpal=$lastrepeat; $repeats--; } $intd='D'; $outrs=""; //$factor=$negplus; $five=5; $negplus=explode(';', $negplus)[0]; $inpcols=explode(':', $outpal); $justdatelen=(-3 + strlen($inpcols[0])); if ($inoth == strtoupper($inoth) && trim($inrs) == '') { return $outpal; } if ($inoth == 'DATE' . strtolower(substr($inoth,0,4)) && trim($inrs) == '') { return substr($outpal,0,$justdatelen); } if ($inoth == 'date' . strtoupper(substr($inoth,0,4)) && trim($inrs) == '') { return substr($outpal,($justdatelen + 1)); } if (trim($inrs) != '' || strpos(strtoupper($inoth), 'DATE') !== false) { //echo "inrs=" . $inrs . " inoth=" . $inoth; //exit; $outrs=explode(" ", $inrs)[0]; if (trim($outrs) != '' || strpos(strtoupper($inoth), 'DATE') !== false) { if (str_replace('-','',str_replace('.','',str_replace('=','',str_replace('+','',str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',trim($outrs))))))))))))))) == '') { if (trim($outrs) != '') { $factor*=str_replace('-','',str_replace('+','',$outrs)); } if (strpos($inoth, 'DATE') !== false) { if (substr($inoth, $five) == strtolower(substr($inoth, $five, 1)) . strtoupper(substr($inoth, (1 + $five)))) { $intd='Y'; } else if (substr($inoth, $five) == strtoupper(substr($inoth, $five, 1)) . strtolower(substr($inoth, (1 + $five), 1)) . strtoupper(substr($inoth, (2 + $five)))) { $intd='M'; } else if (substr($inoth, $five) == strtoupper(substr($inoth, $five, 2)) . strtolower(substr($inoth, (2 + $five), 1)) . strtoupper(substr($inoth, (3 + $five)))) { $intd='D'; } if ($zrepeats >= 0) { if (strpos(('' . $negplus), '-') !== false) { $newd->sub(new DateInterval('P' . str_replace('-','','' . $negplus) . $intd)); } else { $newd->add(new DateInterval('P' . $negplus . $intd)); } } else if ($zrepeats < 0) { //$lastrepeat=$inpal; if (strpos(('' . $altnegplus), '-') !== false) { $newd->sub(new DateInterval('P' . str_replace('-','','' . $altnegplus) . $intd)); } else if ($altnegplus != '') { $newd->add(new DateInterval('P' . $altnegplus . $intd)); } $repeats=-$zrepeats; } return substr($outpal,0,$justdatelen); } else if (strpos($inoth, 'date') !== false) { $intd='H'; if (substr($inoth, $five) == strtolower(substr($inoth, $five, 1)) . strtoupper(substr($inoth, (1 + $five)))) { $intd='H'; } else if (substr($inoth, $five) == strtoupper(substr($inoth, $five, 1)) . strtolower(substr($inoth, (1 + $five), 1)) . strtoupper(substr($inoth, (2 + $five)))) { $intd='M'; } else if (substr($inoth, $five) == strtoupper(substr($inoth, $five, 2)) . strtolower(substr($inoth, (2 + $five), 1)) . strtoupper(substr($inoth, (3 + $five)))) { $intd='S'; } if ($zrepeats >= 0) { if (strpos(('' . $negplus), '-') !== false) { $newd->sub(new DateInterval('PT' . str_replace('-','','' . $negplus) . $intd)); } else { $newd->add(new DateInterval('PT' . $negplus . $intd)); } } else if ($zrepeats < 0) { //$lastrepeat=$inpal; if (strpos(('' . $altnegplus), '-') !== false) { $newd->sub(new DateInterval('PT' . str_replace('-','','' . $altnegplus) . $intd)); } else if ($altnegplus != '') { $newd->add(new DateInterval('PT' . $altnegplus . $intd)); } $repeats=-$zrepeats; } return substr($outpal,($justdatelen + 1)); } else { $five=0; $intd='D'; //echo "InoTH=" . $inoth . " and factor=" . $factor; //exit; if (substr($inoth, $five) == strtolower(substr($inoth, $five, 1)) . strtoupper(substr($inoth, (1 + $five)))) { $intd='Y'; //echo 'P' . $factor . $intd; //exit; if ($zrepeats >= 0) { if (strpos(('' . $negplus), '-') !== false) { $newd->sub(new DateInterval('P' . str_replace('-','','' . $negplus) . $intd)); } else { $newd->add(new DateInterval('P' . $negplus . $intd)); } } else if ($zrepeats < 0) { //$lastrepeat=$inpal; if (strpos(('' . $altnegplus), '-') !== false) { $newd->sub(new DateInterval('P' . str_replace('-','','' . $altnegplus) . $intd)); } else if ($altnegplus != '') { $newd->add(new DateInterval('P' . $altnegplus . $intd)); } $repeats=-$zrepeats; } return $outpal; } else if (substr($inoth, $five) == strtoupper(substr($inoth, $five, 1)) . strtolower(substr($inoth, (1 + $five), 1)) . strtoupper(substr($inoth, (2 + $five)))) { $intd='M'; //echo 'P' . $factor . $intd; //exit; if ($zrepeats >= 0) { if (strpos(('' . $negplus), '-') !== false) { $newd->sub(new DateInterval('P' . str_replace('-','','' . $negplus) . $intd)); } else { $newd->add(new DateInterval('P' . $negplus . $intd)); } } else if ($zrepeats < 0) { //$lastrepeat=$inpal; if (strpos(('' . $altnegplus), '-') !== false) { $newd->sub(new DateInterval('P' . str_replace('-','','' . $altnegplus) . $intd)); } else if ($altnegplus != '') { $newd->add(new DateInterval('P' . $altnegplus . $intd)); } $repeats=-$zrepeats; } return $outpal; } else if (substr($inoth, $five) == strtoupper(substr($inoth, $five, 2)) . strtolower(substr($inoth, (2 + $five), 1)) . strtoupper(substr($inoth, (3 + $five)))) { $intd='D'; //echo 'P' . $negplus . $intd; //exit; if ($zrepeats >= 0) { if (strpos(('' . $negplus), '-') !== false) { $newd->sub(new DateInterval('P' . str_replace('-','','' . $negplus) . $intd)); } else { $newd->add(new DateInterval('P' . $negplus . $intd)); } } else if ($zrepeats < 0) { //$lastrepeat=$inpal; if (strpos(('' . $altnegplus), '-') !== false) { $newd->sub(new DateInterval('P' . str_replace('-','','' . $altnegplus) . $intd)); } else if ($altnegplus != '') { $newd->add(new DateInterval('P' . $altnegplus . $intd)); } $repeats=-$zrepeats; } return $outpal; } $five=5; if (substr($inoth, $five) == strtolower(substr($inoth, $five, 1)) . strtoupper(substr($inoth, (1 + $five)))) { $intd='H'; if ($zrepeats >= 0) { if (strpos(('' . $negplus), '-') !== false) { $newd->sub(new DateInterval('PT' . str_replace('-','','' . $negplus) . $intd)); } else { $newd->add(new DateInterval('PT' . $negplus . $intd)); } } else if ($zrepeats < 0) { //$lastrepeat=$inpal; if (strpos(('' . $altnegplus), '-') !== false) { $newd->sub(new DateInterval('PT' . str_replace('-','','' . $altnegplus) . $intd)); } else if ($altnegplus != '') { $newd->add(new DateInterval('PT' . $altnegplus . $intd)); } $repeats=-$zrepeats; } return $outpal; } else if (substr($inoth, $five) == strtoupper(substr($inoth, $five, 1)) . strtolower(substr($inoth, (1 + $five), 1)) . strtoupper(substr($inoth, (2 + $five)))) { $intd='M'; if ($zrepeats >= 0) { if (strpos(('' . $negplus), '-') !== false) { $newd->sub(new DateInterval('PT' . str_replace('-','','' . $negplus) . $intd)); } else { $newd->add(new DateInterval('PT' . $negplus . $intd)); } } else if ($zrepeats < 0) { //$lastrepeat=$inpal; if (strpos(('' . $altnegplus), '-') !== false) { $newd->sub(new DateInterval('PT' . str_replace('-','','' . $altnegplus) . $intd)); } else if ($altnegplus != '') { $newd->add(new DateInterval('PT' . $altnegplus . $intd)); } $repeats=-$zrepeats; } return $outpal; } else if (substr($inoth, $five) == strtoupper(substr($inoth, $five, 2)) . strtolower(substr($inoth, (2 + $five), 1)) . strtoupper(substr($inoth, (3 + $five)))) { $intd='S'; if ($zrepeats >= 0) { if (strpos(('' . $negplus), '-') !== false) { $newd->sub(new DateInterval('PT' . str_replace('-','','' . $negplus) . $intd)); } else { $newd->add(new DateInterval('PT' . $negplus . $intd)); } } else if ($zrepeats < 0) { //$lastrepeat=$inpal; if (strpos(('' . $altnegplus), '-') !== false) { $newd->sub(new DateInterval('PT' . str_replace('-','','' . $altnegplus) . $intd)); } else if ($altnegplus != '') { $newd->add(new DateInterval('PT' . $altnegplus . $intd)); } $repeats=-$zrepeats; } return $outpal; } return $outpal; } } } } return $outpal; } function oururldecode($inmd) { global $newd, $repeats, $lastrepeat, $factor, $newdts; $inmd=str_replace(urlencode("~~"), urlencode("\n"), str_replace("~~", "\n", $inmd)); if (!$newd || strpos(strtoupper('~' . urldecode($inmd)), '~DATE') === false) { if (strpos(str_replace('+',' ',urldecode($inmd)), ' x ') !== false) { $inmd=urlencode(explode(' x ', str_replace('+',' ',urldecode($inmd)))[0]); } else if (strpos(str_replace('+',' ',urldecode($inmd)), ' * ') !== false) { $inmd=urlencode(explode(' * ', str_replace('+',' ',urldecode($inmd)))[0]); } //return mb_html_entity_decode('我好'); //return mb_html_entity_decode(str_replace('+',' ',urldecode($inmd))); //echo "

" . html_entity_decode(str_replace('+',' ',urldecode($inmd))) . "

"; //exit; return urldecode($inmd); } $dateadd=0; $xrepeats=0; $factor=1; $halfchar="_"; $retstr=""; //echo "inmd=" . str_replace('+',' ',urldecode($inmd)); // . " xRePeats=" . explode(' x ', str_replace('+',' ',urldecode($inmd)))[1] . ' '; //exit; if ($repeats == 0 || strpos(str_replace('+',' ',urldecode($inmd)), ' x ') !== false || strpos(str_replace('+',' ',urldecode($inmd)), ' * ') !== false) { if (strpos(str_replace('+',' ',urldecode($inmd)), ' x ') !== false) { $xrepeats-=floatval(explode(' x ', str_replace('+',' ',urldecode($inmd)))[1]); $xrepeats--; $inmd=urlencode(explode(' x ', str_replace('+',' ',urldecode($inmd)))[0]); } else if (strpos(str_replace('+',' ',urldecode($inmd)), ' * ') !== false) { $xrepeats-=floatval(explode(' * ', str_replace('+',' ',urldecode($inmd)))[1]); $xrepeats--; $inmd=urlencode(explode(' * ', str_replace('+',' ',urldecode($inmd)))[0]); } } if ($repeats > 0) { $inmd=$lastrepeat; $xrepeats=$repeats; } if (strpos(strtoupper('~' . urldecode($inmd)), '~DATE-') !== false) { $halfchar="-"; $factor=-1; } if (strpos(strtoupper('~' . urldecode($inmd)), '~DATE+') !== false) { $halfchar="+"; } if (strpos(strtoupper('~' . urldecode($inmd)), '~DATE ') !== false) { $halfchar=" "; } if (strpos(str_replace('+',' ',urldecode($inmd)), '--') !== false) { $factor=-1; } if (strpos(str_replace('+',' ',urldecode($inmd)), ' ') !== false) { $factor=1; } if (strpos(str_replace('+',' ',urldecode($inmd)), '-=') !== false) { $factor=-1; //echo explode(' ',explode(';',explode('-=', str_replace('+',' ',urldecode($inmd)))[1])[0])[0]; //exit; $factor*=floatval(explode(' ',explode(';',explode('-=', str_replace('+',' ',urldecode($inmd)))[1])[0])[0]); } if (strpos(str_replace('+',' ',urldecode($inmd)), ' =') !== false) { $factor*=floatval(explode(' ',explode(';',explode(' =', str_replace('+',' ',urldecode($inmd)))[1])[0])[0]); } if (strpos(strtoupper('~' . urldecode($inmd)), '~DATE' . $halfchar) !== false) { //echo "factor=" . $factor; //exit; if ($xrepeats < 0) { $repeats=$xrepeats; //$lastrepeat=$inmd; } else if ($repeats > 0) { $inmd=$lastrepeat; } $otheroth=explode(' ',explode('DATE' . $halfchar, strtoupper(urldecode($inmd)))[1])[0]; $oth=explode(' ',explode('-',explode('+',explode('DATE' . $halfchar, strtoupper(urldecode($inmd)))[1])[0])[0])[0]; $ucoth=substr(str_replace($halfchar,'_',str_replace('+',' ',urldecode($inmd))), 0, (5 + strlen($oth))); $rsoth=trim(substr(str_replace('+',' ',urldecode($inmd)), strlen($ucoth) + strlen($otheroth) - strlen($oth))); //echo $oth . ' ' . $ucoth . ' ' . $rsoth; switch ($oth) { case 'ATOM': //echo "xRepeats=" . $xrepeats . ' '; //exit; //echo $newd->format(DateTime::ATOM); //exit; //($ucoth,$rsoth,$factor,$newd); $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::ATOM),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; $xx=str_replace('DATE' . $halfchar . 'ATOM',substr($newd->format(DateTime::ATOM),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); //echo "zero=" . $zero . " retstr=" . $retstr . " xx=" . $xx . " and inmd=" . strtoupper(urldecode($inmd)) . " vs " . 'DATE' . $halfchar . 'ATOM' . " and =" . $newd->format(DateTime::ATOM); //exit; return str_replace('DATE' . $halfchar . 'ATOM',substr($newd->format(DateTime::ATOM),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'COOKIE': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::COOKIE),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'COOKIE',substr($newd->format(DateTime::DATE_COOKIE),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'ISO8601': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::ISO8601),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'ISO8601',substr($newd->format(DateTime::DATE_ISO8601),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'RFC822': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::RFC822),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'RFC822',substr($newd->format(DateTime::DATE_RFC822),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'RFC850': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::RFC850),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'RFC850',substr($newd->format(DateTime::DATE_RFC850),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'RFC1036': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::RFC1036),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'RFC1036',substr($newd->format(DateTime::DATE_RFC1036),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'RFC1123': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::RFC1123),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'RFC1123',substr($newd->format(DateTime::DATE_RFC1123),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'RFC2822': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::RFC2822),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'RFC2822',substr($newd->format(DateTime::DATE_RFC2822),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'RFC3339': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::RFC3339),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'RFC3339',substr($newd->format(DateTime::DATE_RFC3339),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'RSS': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::RSS),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE' . $halfchar . 'RSS',substr($newd->format(DateTime::DATE_RSS),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; case 'W3C': $retstr=nuance($xrepeats,$ucoth,$rsoth,$factor,str_replace('+',' ',urldecode($inmd)),$newd->format(DateTime::W3C),$oth,$otheroth); //,$newd); $zero=0; if (strpos($retstr, ':') !== false && strlen(str_replace('+',' ',urldecode($inmd))) != strlen($retstr)) { $zero=(0 - strlen($retstr)); } $inmd=substr(str_replace('+',' ',urldecode($inmd)),0,5) . explode('-',explode('+',explode(' ',substr(str_replace('+',' ',urldecode($inmd)),5))[0])[0])[0]; return str_replace('DATE_W3C',substr($newd->format(DateTime::DATE_W3C),$zero,strlen($retstr)),strtoupper(urldecode($inmd))); break; default: break; } } return urldecode($inmd); } function server_remote_addr() { $rma = $_SERVER['REMOTE_ADDR']; $ua = strtolower($_SERVER['HTTP_USER_AGENT']); // you can add different browsers with the same way .. if (1 == 2) { if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua)) $rma = '000000'.$rma; elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua)) $rma = '00000'.$rma; elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua)) $rma = '0000'.$rma; elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua)) $rma = '000'.$rma; elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua)) $rma = '00'.$rma; elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua)) $rma = '0'.$rma; } return "_" . str_replace(".", "_", str_replace(":", "_", $rma)); } if (isset($_GET['pdffile'])) { $val=str_replace('+',' ',urldecode($_GET['pdffile'])); if (strpos($val, ".") !== false) { if (strtolower(explode(".", basename($val))[-1 + sizeof(explode(".", basename($val)))]) == 'pdf') { $ourfname=str_replace('.pdf','',str_replace('.PDF','',basename($val))); if (1 == 1) { if (strpos( $user_agent, 'Safari') !== false && strpos( $user_agent, 'Chrome') === false && strpos( $user_agent, 'OPR') === false && strpos( $user_agent, 'Firefox') === false && strpos( $user_agent, 'Opera') === false) { $wobit="window.open('/" . $ourfname . ".pdf','_blank');"; echo ''; } else { echo '
' . "\n" . '
'; } } else { header('Content-Type: application/pdf'); echo file_get_contents('./' . basename($val)); } } else { header('Content-Type: image/' . strtolower(explode(".", basename($val))[1])); echo file_get_contents('./' . basename($val)); } } exit; } else if (1 == 7 && isset($_GET['justiurl'])) { echo "Image and Text Nodes PDF Creator - RJM Programming - August, 2022 "; exit; } else if (1 == 7 && isset($_POST['justiurl'])) { echo "Image and Text Nodes PDF Creator - RJM Programming - August, 2022 "; exit; } else if (strlen('' . $_SERVER['QUERY_STRING']) <= 1 || strpos('' . $_SERVER['QUERY_STRING'], '&') === false) { //strpos($_SERVER['REQUEST_URI'], '?')) if (!isset($_POST['pdfimageplustext'])) { echo " Image and Text Nodes PDF Creator - RJM Programming - August, 2022

... or ...


Image and Text Nodes PDF Creation

RJM Programming - August, 2022

... or ...


"; exit; } } $ourfname="filename" . server_remote_addr(); $dru="http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/"; $linkemailshare=$dru . $ourfname . ".pdf#Your Image and Text PDF#Via RJM Programming"; $sharehtmlbit="

"; $safarisharehtmlbit='open "' . str_replace("rjmprogramming.com.au/","rjmprogramming.com.au/HTMLCSS/",$dru) . 'web_share_api_test.html?suggestion=' . urlencode($linkemailshare) . '"'; $furl=((isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER[HTTP_HOST] . str_replace("HTTP:","http:",$_SERVER[REQUEST_URI])); $dpath=str_replace("$#$","//", explode("/",str_replace("//","$#$",$furl))[0] ) . "/"; $frest=explode(((isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER[HTTP_HOST] . "/"), ((isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER[HTTP_HOST] . str_replace("HTTP:","http:",$_SERVER[REQUEST_URI])) )[1]; if (strpos(($frest . '*'), '=*') === false && strpos($frest, "=") !== false) { $frest=explode("=", $frest)[0] . "="; } //echo $furl . " ... " . $dpath . " ... " . $frest; //exit; $sincebefore=""; $prefix=""; $notprefix=""; for ($i=0; $i<(-1 + sizeof(explode("/",$frest))); $i++) { $notprefix=explode($frest,$furl)[0]; $prefix.="../"; } if ($prefix == "") $notprefix=""; $first=true; $outputto=""; $outputsofar=""; $outputpdf=null; $top=1; $title=""; $wastitle=""; $istitle=""; $cpn=1; $emailto=""; $pdfis=""; $outputpdf_hgt=100.0; $lh=6; $loffset=0; $fpdfs=",Arial,Courier,Helvetica,Symbol,Times,ZapfDingbats,"; $scale=floatval(1.0); $scalep=floatval(100.0); if (isset($_POST['pdfimageplustext'])) { if (isset($_POST['mytzn'])) { if (('' . urldecode($_POST['mytzn'])) != '') { date_default_timezone_set(urldecode($_POST['mytzn'])); } } if (!$newd) { $newd=new DateTime(); $mewd=$newd; $newdts=$newd->format(DateTime::COOKIE); } //date_create(''); $w=0; $h=0; $outputpdf = new RPDF('P','pt'); //$outputpdf->AddFont('DeJaVuSansMono','','DeJaVuSansMono.php'); //$outputpdf->AddFont('DeJaVuSansCondensed','','DeJaVuSansCondensed.php'); //if (isset($_POST['pdfrtext']) && isset($_POST['pdfgtext']) && isset($_POST['pdfbtext'])) { //$outputpdf->SetTextColor(urldecode($_POST['pdfrtext']), urldecode($_POST['pdfgtext']), urldecode($_POST['pdfbtext'])); //} $outputpdf->SetTopMargin(0.0); //$outputpdf->AddPage('L'); if (isset($_POST['pdfimage'])) { $inval=$_POST['pdfimage']; //if (strpos(urldecode($inval), "data:image/") === false && strpos(urldecode($inval), "data:") !== false && strpos(urldecode($inval), ";base64,") !== false) { // $inval=urlencode('data:image/jpeg;base64,' . explode(";base64,", urldecode($inval))); //} if (strpos(urldecode($inval), "data:image/") !== false && strpos(urldecode($inval), ";base64,") !== false) { $fname='./' . $ourfname . '.' . strtolower(explode(";", explode("data:image/", urldecode($inval))[1])[0]); file_put_contents($fname, base64_decode(str_replace(' ','+',explode(";base64,", urldecode($inval))[1]))); list($w, $h) = getimagesize($fname); if ($w > $h) { $outputpdf->AddPage('L', 'A4'); if ($w > 830) { $scale=floatval(830.0 / $w); $scalep=floatval($scale * 100.0); //$outputpdf->_out('q'); //Scale(floatval($scalep), floatval($scalep)); $newh=($h * (830.0 / $w)); $outputpdf->Image($fname, 0, 0, 830, floatval($newh)); //, 33.78); //$outputpdf->_out('Q'); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } else { $outputpdf->AddPage('P', 'A4'); if ($h > 830) { $scale=floatval(830.0 / $h); $scalep=floatval($scale * 100.0); //Scale(floatval($scalep), floatval($scalep)); $neww=($w * (830.0 / $h)); $outputpdf->Image($fname, 0, 0, floatval($neww), 830); //, 33.78); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } } else if (strpos(urldecode($_POST['pdfimage']), "rjmprogramming.com.au/") !== false) { $fname="./" . explode(')',explode('"',explode("rjmprogramming.com.au/", urldecode($_POST['pdfimage']))[1])[0])[0]; //$outputpdf->Image("./" . explode("rjmprogramming.com.au/", urldecode($_POST['pdfimage']))[1], 0, 0); //, 33.78); list($w, $h) = getimagesize($fname); if ($w > $h) { $outputpdf->AddPage('L', 'A4'); if ($w > 830) { $scale=floatval(830.0 / $w); $scalep=floatval($scale * 100.0); //$outputpdf->_out('q'); //Scale(floatval($scalep), floatval($scalep)); $newh=($h * (830.0 / $w)); $outputpdf->Image($fname, 0, 0, 830, floatval($newh)); //, 33.78); //$outputpdf->_out('Q'); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } else { $outputpdf->AddPage('P', 'A4'); if ($h > 830) { $scale=floatval(830.0 / $h); $scalep=floatval($scale * 100.0); //Scale(floatval($scalep), floatval($scalep)); $neww=($w * (830.0 / $h)); $outputpdf->Image($fname, 0, 0, floatval($neww), 830); //, 33.78); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } } else { if (strpos(urldecode($_POST['pdfimage']), 'url(') !== false) { $fname=str_replace('"','',explode(')',explode('url(',urldecode($_POST['pdfimage']))[1])[0]); } else { $fname=urldecode($_POST['pdfimage']); } //file_put_contents('x.x', $fname); //$outputpdf->Image(urldecode($_POST['pdfimage']), 0, 0); //, 33.78); list($w, $h) = getimagesize($fname); if ($w > $h) { $outputpdf->AddPage('L', 'A4'); if ($w > 830) { $scale=floatval(830.0 / $w); $scalep=floatval($scale * 100.0); //$outputpdf->_out('q'); //Scale(floatval($scalep), floatval($scalep)); $newh=($h * (830.0 / $w)); $outputpdf->Image($fname, 0, 0, 830, floatval($newh)); //, 33.78); //$outputpdf->_out('Q'); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } else { $outputpdf->AddPage('P', 'A4'); if ($h > 830) { $scale=floatval(830.0 / $h); $scalep=floatval($scale * 100.0); //Scale(floatval($scalep), floatval($scalep)); $neww=($w * (830.0 / $h)); $outputpdf->Image($fname, 0, 0, floatval($neww), 830); //, 33.78); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } } } else { $outputpdf->AddPage('L','A4'); } if (isset($_POST['pdftext1'])) { $texti=1; $ffy='Arial'; $fst='B'; $fsz=16; if (1 == 1) { ffs(''); } else { if (isset($_POST['pdffamily'])) { $ffy=str_replace('+',' ',urldecode($_POST['pdffamily'])); } if (isset($_POST['pdffontstyle'])) { $fst=str_replace('N',' ',substr(strtoupper(str_replace('+',' ',urldecode($_POST['pdffontstyle']))) . ' ',0,1)); } if (isset($_POST['pdffontsize'])) { if (strlen(trim(str_replace('+',' ',urldecode($_POST['pdffontsize'])))) > 0) { $fsz=str_replace('+',' ',urldecode($_POST['pdffontsize'])); } } $ofsz=$fsz; $ofst=$fst; } while (isset($_POST['pdftext' . $texti]) && isset($_POST['pdfx' . $texti]) && isset($_POST['pdfy' . $texti])) { ffs('' . $texti); $exc="~"; if (strpos(urldecode($_POST['pdfx' . $texti]), '.') !== false && strpos(urldecode($_POST['pdfy' . $texti]), '.') === false) { $fsz=explode('.', urldecode($_POST['pdfx' . $texti]))[1]; if (substr('' . $fsz . ' ',4) == '0000') { $fst='B'; $fsz=substr($fsz,4); if ($fsz == '') { $fsz=$ofsz; } } else if (substr('' . $fsz . ' ',3) == '000') { $fst='U'; $fsz=substr($fsz,3); if ($fsz == '') { $fsz=$ofsz; } } else if (substr('' . $fsz . ' ',2) == '00') { $fst='I'; $fsz=substr($fsz,2); if ($fsz == '') { $fsz=$ofsz; } } else if (substr('' . $fsz . ' ',1) == '0') { $fst=' '; $fsz=substr($fsz,1); if ($fsz == '') { $fsz=$ofsz; } } $exc="."; } if (strlen(trim(urldecode($_POST['pdftext' . $texti]))) > 0) { //echo "yesooo"; //exit; $outputpdf->SetFont($ffy,trim($fst),$fsz); $ourx=floatval($scale * floatval(explode($exc, urldecode($_POST['pdfx' . $texti]))[0])); $oury=floatval($scale * floatval(urldecode($_POST['pdfy' . $texti]))); if ($repeats == 1) { $stris=str_replace('^%&',' + ',str_replace('+',' ',str_replace('+++','^%&', oururldecode($_POST['pdftext' . $texti])))); if ($mewd) { $newd=$mewd; } else { $newd=new DateTime(); $newdts=$newd->format(DateTime::COOKIE); $mewd=$newd; } } else { $stris=str_replace('^%&',' + ',str_replace('+',' ',str_replace('+++','^%&', oururldecode($_POST['pdftext' . $texti])))); } if (isset($_POST['pdfrtext' . $texti]) && isset($_POST['pdfgtext' . $texti]) && isset($_POST['pdfbtext' . $texti])) { $outputpdf->SetTextColor(urldecode($_POST['pdfrtext' . $texti]), urldecode($_POST['pdfgtext' . $texti]), urldecode($_POST['pdfbtext' . $texti])); if (isset($_POST['pdfrtext'])) { // because means "from here on" $_POST['pdfrtext']=$_POST['pdfrtext' . $texti]; $_POST['pdfgtext']=$_POST['pdfgtext' . $texti]; $_POST['pdfbtext']=$_POST['pdfbtext' . $texti]; } } else if (isset($_POST['pdfrtext']) && isset($_POST['pdfgtext']) && isset($_POST['pdfbtext'])) { $outputpdf->SetTextColor(urldecode($_POST['pdfrtext']), urldecode($_POST['pdfgtext']), urldecode($_POST['pdfbtext'])); } $str_is=explode("\n", $stris); $xfsz=0; $yfsz=floatval($fsz); for ($ii=0; $iiSetXY($ourx,$oury); //,''); $outputpdf->Write(5, html_entity_decode($str_is[$ii])); } else { $outputpdf->Text($ourx,$oury,$str_is[$ii]); } if (isset($_POST['pdfdirectiontext'])) { $_POST['pdfdirectiontext']="R"; // because means "from here on" } } else { //file_put_contents('xx.xx',$_POST['pdfdirectiontext' . $texti]); $outputpdf->TextWithDirection($ourx,$oury,$str_is[$ii],$_POST['pdfdirectiontext' . $texti]); if (isset($_POST['pdfdirectiontext'])) { $_POST['pdfdirectiontext']=$_POST['pdfdirectiontext' . $texti]; // because means "from here on" if ($_POST['pdfdirectiontext' . $texti] == "U") { $xfsz=floatval($fsz); $yfsz=0; } else if ($_POST['pdfdirectiontext' . $texti] == "D") { $xfsz=-floatval($fsz); $yfsz=0; } } else { $odir=$_POST['pdfdirectiontext' . $texti]; if ($odir == "U") { $xfsz=floatval($fsz); $yfsz=0; } else if ($odir == "D") { $xfsz=-floatval($fsz); $yfsz=0; } } } } else if (isset($_POST['pdfrotatetextdeg' . $texti])) { if (('' . urldecode($_POST['pdfrotatetextdeg' . $texti])) == '') { $outputpdf->Text($ourx,$oury,$str_is[$ii]); if (isset($_POST['pdfrotatetextdeg'])) { $_POST['pdfrotatetextdeg']="0"; // because means "from here on" } } else { $outputpdf->TextWithRotation($ourx,$oury,$str_is[$ii],$_POST['pdfrotatetextdeg' . $texti],0); if (isset($_POST['pdfrotatetextdeg'])) { $_POST['pdfrotatetextdeg']=$_POST['pdfrotatetextdeg' . $texti]; // bdecause means "from here on" $xfsz=sin(floatval($_POST['pdfrotatetextdeg' . $texti]) * pi() / 180.0) * floatval($fsz); $yfsz=cos(floatval($_POST['pdfrotatetextdeg' . $texti]) * pi() / 180.0) * floatval($fsz); } else { $orot=$_POST['pdfrotatetextdeg' . $texti]; $xfsz=sin(floatval($orot) * pi() / 180.0) * floatval($fsz); $yfsz=cos(floatval($orot) * pi() / 180.0) * floatval($fsz); } } } else if ($odir != "") { //file_put_contents('xxxx.xx',$odir . ' for ' . $texti); $outputpdf->TextWithDirection($ourx,$oury,$str_is[$ii],$odir); if ($odir == "U") { $xfsz=floatval($fsz); $yfsz=0; } else if ($odir == "D") { $xfsz=-floatval($fsz); $yfsz=0; } } else if (isset($_POST['pdfdirectiontext'])) { //file_put_contents('xxxxx.xx',$_POST['pdfdirectiontext'] . ' For ' . $texti); $outputpdf->TextWithDirection($ourx,$oury,$str_is[$ii],$_POST['pdfdirectiontext']); if ($_POST['pdfdirectiontext'] == "U") { $xfsz=floatval($fsz); $yfsz=0; } else if ($_POST['pdfdirectiontext'] == "D") { $xfsz=-floatval($fsz); $yfsz=0; } } else if ($orot != "") { $outputpdf->TextWithRotation($ourx,$oury,$str_is[$ii],$orot,0); } else if (isset($_POST['pdfrotatetextdeg'])) { $outputpdf->TextWithRotation($ourx,$oury,$str_is[$ii],$_POST['pdfrotatetextdeg'],0); $xfsz=sin(floatval($_POST['pdfrotatetextdeg']) * pi() / 180.0) * floatval($fsz); $yfsz=cos(floatval($_POST['pdfrotatetextdeg']) * pi() / 180.0) * floatval($fsz); } else { if (1 == 8 && strpos($str_is[$ii], "\n") !== false) { $outputpdf->SetXY($ourx,$oury); //,''); $outputpdf->Write($fsz, html_entity_decode($str_is[$ii])); } else { $outputpdf->Text($ourx,$oury,$str_is[$ii]); } } $ourx+=$xfsz; $oury+=$yfsz; } } $texti++; $fsz=$ofsz; $fst=$ofst; } } if (file_exists('./' . $ourfname . '.pdf')) { unlink('./' . $ourfname . '.pdf'); } $outputpdf->Output("./" . $ourfname . ".pdf", "F"); $result = 0; if (strpos($_SERVER['SERVER_NAME'], 'rjmprogramming.com.au') !== false) { exec( "/usr/local/cpanel/3rdparty/bin/convert -density 300 " . dirname(__FILE__) . DIRECTORY_SEPARATOR . $ourfname . ".pdf " . dirname(__FILE__) . DIRECTORY_SEPARATOR . $ourfname . ".jpg"); //, null, $result ); // Thanks to https://stackoverflow.com/questions/8624886/pdf-to-jpg-conversion-using-php } else { exec( "/usr/local/bin/convert -density 300 " . dirname(__FILE__) . DIRECTORY_SEPARATOR . $ourfname . ".pdf " . dirname(__FILE__) . DIRECTORY_SEPARATOR . $ourfname . ".jpg"); //, null, $result ); // Thanks to https://stackoverflow.com/questions/8624886/pdf-to-jpg-conversion-using-php } if (strpos( $user_agent, 'Safari') !== false && strpos( $user_agent, 'Chrome') === false && strpos( $user_agent, 'OPR') === false && strpos( $user_agent, 'Firefox') === false && strpos( $user_agent, 'Opera') === false) { if (1 == 1) { $wobit="window.open('/" . $ourfname . ".pdf','_blank');"; echo ''; } else { header('Content-Type: application/pdf'); echo file_get_contents('./' . $ourfname . '.pdf'); exec($safarisharehtmlbit); } } else { echo '
' . "\n" . '
' . $sharehtmlbit . ''; } exit; } else if (isset($_GET['pdfimageplustext'])) { $w=0; $h=0; $outputpdf = new RPDF('P','pt'); //if (isset($_GET['pdfrtext']) && isset($_GET['pdfgtext']) && isset($_GET['pdfbtext'])) { //$outputpdf->SetTextColor(urldecode($_GET['pdfrtext']), urldecode($_GET['pdfgtext']), urldecode($_GET['pdfbtext'])); //} $outputpdf->SetTopMargin(0.0); //$outputpdf->AddPage('L'); if (isset($_GET['pdfimage'])) { if (strpos(urldecode($_GET['pdfimage']), "data:image/") !== false && strpos(urldecode($_GET['pdfimage']), ";base64,") !== false) { $fname='./' . $ourfname . '.' . strtolower(explode(";", explode("data:image/", urldecode($_GET['pdfimage']))[1])[0]); file_put_contents($fname, base64_decode(str_replace(' ','+',explode(";base64,", urldecode($_GET['pdfimage']))[1]))); list($w, $h) = getimagesize($fname); if ($w > $h) { $outputpdf->AddPage('L', 'A4'); if ($w > 830) { $scale=floatval(830.0 / $w); $scalep=floatval($scale * 100.0); //$outputpdf->_out('q'); //Scale(floatval($scalep), floatval($scalep)); $newh=($h * (830.0 / $w)); $outputpdf->Image($fname, 0, 0, 830, floatval($newh)); //, 33.78); //$outputpdf->_out('Q'); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } else { $outputpdf->AddPage('P', 'A4'); if ($h > 830) { $scale=floatval(830.0 / $h); $scalep=floatval($scale * 100.0); //Scale(floatval($scalep), floatval($scalep)); $neww=($w * (830.0 / $h)); $outputpdf->Image($fname, 0, 0, floatval($neww), 830); //, 33.78); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } } else if (strpos(urldecode($_GET['pdfimage']), "rjmprogramming.com.au/") !== false) { $fname="./" . explode(')',explode('"',explode("rjmprogramming.com.au/", urldecode($_GET['pdfimage']))[1])[0])[0]; //$outputpdf->Image("./" . explode("rjmprogramming.com.au/", urldecode($_GET['pdfimage']))[1], 0, 0); //, 33.78); list($w, $h) = getimagesize($fname); if ($w > $h) { $outputpdf->AddPage('L', 'A4'); if ($w > 830) { $scale=floatval(830.0 / $w); $scalep=floatval($scale * 100.0); //$outputpdf->_out('q'); //Scale(floatval($scalep), floatval($scalep)); $newh=($h * (830.0 / $w)); $outputpdf->Image($fname, 0, 0, 830, floatval($newh)); //, 33.78); //$outputpdf->_out('Q'); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } else { $outputpdf->AddPage('P', 'A4'); if ($h > 830) { $scale=floatval(830.0 / $h); $scalep=floatval($scale * 100.0); //Scale(floatval($scalep), floatval($scalep)); $neww=($w * (830.0 / $h)); $outputpdf->Image($fname, 0, 0, floatval($neww), 830); //, 33.78); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } } else { if (strpos(urldecode($_GET['pdfimage']), 'url(') !== false) { $fname=str_replace('"','',explode(')',explode('url(',urldecode($_GET['pdfimage']))[1])[0]); } else { $fname=urldecode($_GET['pdfimage']); } //$outputpdf->Image(urldecode($_GET['pdfimage']), 0, 0); //, 33.78); list($w, $h) = getimagesize($fname); if ($w > $h) { $outputpdf->AddPage('L', 'A4'); if ($w > 830) { $scale=floatval(830.0 / $w); $scalep=floatval($scale * 100.0); //$outputpdf->_out('q'); //Scale(floatval($scalep), floatval($scalep)); $newh=($h * (830.0 / $w)); $outputpdf->Image($fname, 0, 0, 830, floatval($newh)); //, 33.78); //$outputpdf->_out('Q'); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } else { $outputpdf->AddPage('P', 'A4'); if ($h > 830) { $scale=floatval(830.0 / $h); $scalep=floatval($scale * 100.0); //Scale(floatval($scalep), floatval($scalep)); $neww=($w * (830.0 / $h)); $outputpdf->Image($fname, 0, 0, floatval($neww), 830); //, 33.78); } else { $outputpdf->Image($fname, 0, 0); //, 33.78); } } } } else { $outputpdf->AddPage('L','A4'); } if (isset($_GET['pdftext1'])) { $texti=1; $ffy='Arial'; $fst='B'; $fsz=16; if (isset($_GET['pdffamily'])) { $ffy=str_replace('+',' ',urldecode($_GET['pdffamily'])); } if (isset($_GET['pdffontstyle'])) { $fst=str_replace('N',' ',substr(strtoupper(str_replace('+',' ',urldecode($_GET['pdffontstyle']))) . ' ',0,1)); } if (isset($_GET['pdffontsize'])) { if (strlen(trim(str_replace('+',' ',urldecode($_GET['pdffontsize'])))) > 0) { $fsz=str_replace('+',' ',urldecode($_GET['pdffontsize'])); } } $ofsz=$fsz; $ofsz=$fst; while (isset($_GET['pdftext' . $texti]) && isset($_GET['pdfx' . $texti]) && isset($_GET['pdfy' . $texti])) { $exc="~"; if (strpos(urldecode($_GET['pdfx' . $texti]), '.') !== false && strpos(urldecode($_GET['pdfy' . $texti]), '.') === false) { $fsz=explode('.', urldecode($_GET['pdfx' . $texti]))[1]; if (substr('' . $fsz . ' ',4) == '0000') { $fst='B'; $fsz=substr($fsz,4); if ($fsz == '') { $fsz=$ofsz; } } else if (substr('' . $fsz . ' ',3) == '000') { $fst='U'; $fsz=substr($fsz,3); if ($fsz == '') { $fsz=$ofsz; } } else if (substr('' . $fsz . ' ',2) == '00') { $fst='I'; $fsz=substr($fsz,2); if ($fsz == '') { $fsz=$ofsz; } } else if (substr('' . $fsz . ' ',1) == '0') { $fst=' '; $fsz=substr($fsz,1); if ($fsz == '') { $fsz=$ofsz; } } $exc="."; } if (strlen(trim(urldecode($_GET['pdftext' . $texti]))) > 0) { //echo "yesooo"; //exit; $outputpdf->SetFont($ffy,trim($fst),$fsz); $ourx=floatval($scale * floatval(explode($exc, urldecode($_GET['pdfx' . $texti]))[0])); $oury=floatval($scale * floatval(urldecode($_GET['pdfy' . $texti]))); $stris=str_replace('^%&',' + ',str_replace('+',' ',str_replace('+++','^%&',urldecode($_GET['pdftext' . $texti])))); if (isset($_GET['pdfrtext' . $texti]) && isset($_GET['pdfgtext' . $texti]) && isset($_GET['pdfbtext' . $texti])) { $outputpdf->SetTextColor(urldecode($_GET['pdfrtext' . $texti]), urldecode($_GET['pdfgtext' . $texti]), urldecode($_GET['pdfbtext' . $texti])); if (isset($_GET['pdfrtext'])) { // because means "from here on" $_GET['pdfrtext']=$_GET['pdfrtext' . $texti]; $_GET['pdfgtext']=$_GET['pdfgtext' . $texti]; $_GET['pdfbtext']=$_GET['pdfbtext' . $texti]; } } else if (isset($_GET['pdfrtext']) && isset($_GET['pdfgtext']) && isset($_GET['pdfbtext'])) { $outputpdf->SetTextColor(urldecode($_GET['pdfrtext']), urldecode($_GET['pdfgtext']), urldecode($_GET['pdfbtext'])); } if (isset($_GET['pdfdirectiontext' . $texti])) { if (strlen($_GET['pdfdirectiontext' . $texti]) == 0) { $outputpdf->Text($ourx,$oury,$stris); if (isset($_GET['pdfdirectiontext'])) { $_GET['pdfdirectiontext']="L"; // because means "from here on" } } else { $outputpdf->TextWithDirection($ourx,$oury,$stris,$_GET['pdfdirectiontext' . $texti]); if (isset($_GET['pdfdirectiontext'])) { $_GET['pdfdirectiontext']=$_GET['pdfdirectiontext' . $texti]; // because means "from here on" } } } else if (isset($_GET['pdfrotatetextdeg' . $texti])) { if (strlen($_GET['pdfrotatetextdeg' . $texti]) == 0) { $outputpdf->Text($ourx,$oury,$stris); if (isset($_GET['pdfrotatetextdeg'])) { $_GET['pdfrotatetextdeg']="0"; // because means "from here on" } } else { $outputpdf->TextWithRotation($ourx,$oury,$stris,$_GET['pdfrotatetextdeg' . $texti],0); if (isset($_GET['pdfrotatetextdeg'])) { $_GET['pdfrotatetextdeg']=$_GET['pdfrotatetextdeg' . $texti]; // bdecause means "from here on" } } } else if (isset($_GET['pdfdirectiontext'])) { $outputpdf->TextWithDirection($ourx,$oury,$stris,$_GET['pdfdirectiontext']); } else if (isset($_GET['pdfrotatetextdeg'])) { $outputpdf->TextWithRotation($ourx,$oury,$stris,$_GET['pdfrotatetextdeg'],0); } else { $outputpdf->Text($ourx,$oury,$stris); } } $texti++; $fsz=$ofsz; $fst=$ofst; } } if (file_exists('./' . $ourfname . '.pdf')) { unlink('./' . $ourfname . '.pdf'); } $outputpdf->Output("./" . $ourfname . ".pdf", "F"); $result = 0; if (strpos($_SERVER['SERVER_NAME'], 'rjmprogramming.com.au') !== false) { exec( "/usr/local/cpanel/3rdparty/bin/convert -density 300 " . dirname(__FILE__) . DIRECTORY_SEPARATOR . $ourfname . ".pdf " . dirname(__FILE__) . DIRECTORY_SEPARATOR . $ourfname . ".jpg"); //, null, $result ); // Thanks to https://stackoverflow.com/questions/8624886/pdf-to-jpg-conversion-using-php } else { exec( "/usr/local/bin/convert -density 300 " . dirname(__FILE__) . DIRECTORY_SEPARATOR . $ourfname . ".pdf " . dirname(__FILE__) . DIRECTORY_SEPARATOR . $ourfname . ".jpg"); //, null, $result ); // Thanks to https://stackoverflow.com/questions/8624886/pdf-to-jpg-conversion-using-php } if (strpos( $user_agent, 'Safari') !== false && strpos( $user_agent, 'Chrome') === false && strpos( $user_agent, 'OPR') === false && strpos( $user_agent, 'Firefox') === false && strpos( $user_agent, 'Opera') === false) { if (1 == 1) { $wobit="window.open('/" . $ourfname . ".pdf','_blank');"; echo '' . $sharehtmlbit . ''; } else { header('Content-Type: application/pdf'); echo file_get_contents('./' . $ourfname . '.pdf'); exec($safarisharehtmlbit); } } else { echo '
' . "\n" . '
' . $sharehtmlbit . ''; } exit; } ?>