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); } } $ofsz=""; $ofst=""; $orot=""; $odir=""; $user_agent = $_SERVER['HTTP_USER_AGENT']; $ffnos="Text from now on Colour Size Direction Rotation Style Family ideas ...
 px  °    "; 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 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['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'])) { $w=0; $h=0; $outputpdf = new RPDF('P','pt'); //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]))); $stris=str_replace('^%&',' + ',str_replace('+',' ',str_replace('+++','^%&',urldecode($_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'])); } if (isset($_POST['pdfdirectiontext' . $texti])) { //file_put_contents('xxx.xxx',$_POST['pdfdirectiontext' . $texti]); if (('' . urldecode($_POST['pdfdirectiontext' . $texti])) == '') { //file_put_contents('xx.xxx',$_POST['pdfdirectiontext' . $texti]); $outputpdf->Text($ourx,$oury,$stris); if (isset($_POST['pdfdirectiontext'])) { $_POST['pdfdirectiontext']="L"; // because means "from here on" } } else { //file_put_contents('xx.xx',$_POST['pdfdirectiontext' . $texti]); $outputpdf->TextWithDirection($ourx,$oury,$stris,$_POST['pdfdirectiontext' . $texti]); if (isset($_POST['pdfdirectiontext'])) { $_POST['pdfdirectiontext']=$_POST['pdfdirectiontext' . $texti]; // because means "from here on" } else { $odir=$_POST['pdfdirectiontext' . $texti]; } } } else if (isset($_POST['pdfrotatetextdeg' . $texti])) { if (('' . urldecode($_POST['pdfrotatetextdeg' . $texti])) == '') { $outputpdf->Text($ourx,$oury,$stris); if (isset($_POST['pdfrotatetextdeg'])) { $_POST['pdfrotatetextdeg']="0"; // because means "from here on" } } else { $outputpdf->TextWithRotation($ourx,$oury,$stris,$_POST['pdfrotatetextdeg' . $texti],0); if (isset($_POST['pdfrotatetextdeg'])) { $_POST['pdfrotatetextdeg']=$_POST['pdfrotatetextdeg' . $texti]; // bdecause means "from here on" } else { $orot=$_POST['pdfrotatetextdeg' . $texti]; } } } else if ($odir != "") { //file_put_contents('xxxx.xx',$odir . ' for ' . $texti); $outputpdf->TextWithDirection($ourx,$oury,$stris,$odir); } else if (isset($_POST['pdfdirectiontext'])) { //file_put_contents('xxxxx.xx',$_POST['pdfdirectiontext'] . ' For ' . $texti); $outputpdf->TextWithDirection($ourx,$oury,$stris,$_POST['pdfdirectiontext']); } else if ($orot != "") { $outputpdf->TextWithRotation($ourx,$oury,$stris,$orot,0); } else if (isset($_POST['pdfrotatetextdeg'])) { $outputpdf->TextWithRotation($ourx,$oury,$stris,$_POST['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 ''; } 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; } ?>