5) { //file_put_contents('xxx04.xxx01', $cis . ' vs ' . sys_get_temp_dir()); if (sys_get_temp_dir() == substr($huhs[5], 0, strlen(sys_get_temp_dir()))) { //file_put_contents('xxx05.xxx01', $cis); if (PHP_OS == "Darwin") { //file_put_contents('xxx06.xxx01', $cis); putenv('PATH=/usr/local/bin'); exec(explode(';',$cis)[0] . ' 2> pdfunite.bad'); //file_put_contents('xxx07.xxx01', $cis); } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { exec(explode(';', $cis)[0] . ' 2> pdfunite.bad'); } } } } exit; } if (isset($_POST['rmzip'])) { $cis=str_replace('+',' ',urldecode($_POST['rmzip'])); $precis=explode('-', $cis)[0]; sleep(120); $xx='' . rand(456, 78534432); if (file_exists($cis) && strpos(($cis . $xx . '~'), '.zip' . $xx . '~') !== false && strpos($cis, '-') !== false) { if (file_exists($precis . '.mp4') && trim($precis) != '') { unlink($precis . '.mp4'); } if (file_exists($precis . '.gif') && trim($precis) != '') { unlink($precis . '.gif'); } if (file_exists($precis . '.pdf') && trim($precis) != '') { unlink($precis . '.pdf'); } unlink($cis); } exit; } if (isset($_GET['inurl'])) { $mt="image"; $mprefix='' . str_replace('video', 'source>'; if (strtolower($outext) == 'pdf') { sleep(3); echo "" . str_replace('+',' ',basename($filename)) . ""; } else { echo "" . str_replace('+',' ',basename($filename)) . ""; } } exit; } else if (isset($_GET['nopdfurl'])) { sleep(37); foreach (glob('pdfcopy-0-local-' . '*.pdf') as $filename) { try { unlink($filename); } catch (Exception $werty) { } } foreach (glob('pdfcopy-0-local-*' . DIRECTORY_SEPARATOR . '*.pdf') as $filename) { try { unlink($filename); } catch (Exception $werty) { } try { rmdir(explode(basename($filename), $filename)[0]); } catch (Exception $werty) { } } exit; } $pdfprotocol='file://'; function oururlencode($whata) { global $pdfprotocol, $dn; if (strpos('~' . strtolower($whata), '~http') !== false) { return str_replace(urlencode(DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, urlencode($whata)); } $newwhata=str_replace($_SERVER['DOCUMENT_ROOT'], "http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))), $whata); if ($newwhata == $whata || 1 == 1) { //file_put_contents('xaa.xaa', 'whata=' . $whata . ' and retval=' . urlencode($whata) . ' versus ' . str_replace(urlencode(DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, urlencode($whata))); if (1 == 1) { $pdfprotocol='file://'; $pdfprotocol='./'; return 'php_calls_pdfimages.php?inurl=' . 'file://' . str_replace(urlencode(DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, urlencode($whata)); } else { $pdfprotocol='file://'; return str_replace(urlencode(DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, urlencode($whata)); //return urlencode($whata); } } $pdfprotocol=explode($_SERVER['SERVER_NAME'], $newwhata)[0]; return str_replace(urlencode(DIRECTORY_SEPARATOR), '/', str_replace(urlencode('/'), '/', urlencode(explode($pdfprotocol, $newwhata)[1]))); } function ourtouch($fp1, $fp2) { if (file_exists($fp1)) { file_put_contents($fp1, file_get_contents($fp1) . ' '); //file_put_contents('xx0.xx0', file_get_contents($fp1)); return filesize($fp1); } return ''; } function ourunlink($what) { global $followupwhat, $olmore, $dn; $huhpis=explode('.', $what); foreach (glob($huhpis[0] . '-*') as $filename) { try { if (strpos($filename, '.zip') !== false && $followupwhat == '') { // && (isset($_GET['pdfbighp']) || isset($_POST['pdfbighp']))) { $followupwhat=$filename; $olmore=" parent.rmzipit('" . $followupwhat . "'); "; } else if (strpos($filename, '.zip') !== false) { // && (isset($_GET['pdfbighp']) || isset($_POST['pdfbighp']))) { $followupwhat=$filename; } else { unlink($filename); } } catch (Exception $werty) { } } if (isset($_GET['pdfbighp'])) { if (file_exists(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp'])))) { foreach (glob(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . DIRECTORY_SEPARATOR . '*.*') as $filename) { try { unlink($filename); } catch (Exception $werty) { } } exec('rmdir ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp']))); } } else if (isset($_POST['pdfbighp'])) { if (file_exists(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp'])))) { foreach (glob(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . DIRECTORY_SEPARATOR . '*.*') as $filename) { try { unlink($filename); } catch (Exception $werty) { } } exec('rmdir ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp']))); } } unlink($what); } $pdfh=''; $pdfbigh=''; $defdef=''; $autoplay=''; $fextra=''; $infile='"input_pdf.pdf"'; $pathp='.' . DIRECTORY_SEPARATOR; if (isset($_GET['inpath'])) { if (trim(str_replace('+',' ',urldecode($_GET['inpath']))) != '') { $pathp=str_replace('+',' ',urldecode($_GET['inpath'])); if (substr(strrev($pathp),0,1) != DIRECTORY_SEPARATOR) { $pathp.=DIRECTORY_SEPARATOR; } } } else if (isset($_POST['inpath'])) { if (trim(str_replace('+',' ',urldecode($_POST['inpath']))) != '') { $pathp=str_replace('+',' ',urldecode($_POST['inpath'])); if (substr(strrev($pathp),0,1) != DIRECTORY_SEPARATOR) { $pathp.=DIRECTORY_SEPARATOR; } } } if (isset($_GET['convertthis'])) { $cbi=' '; $infile='"' . $pathp . str_replace('+',' ',urldecode($_GET['convertthis'])) . '"'; $fextra=' ' . basename(str_replace('"','',$infile)) . ''; //file_put_contents('xa.xa', $fextra); } else if (isset($_POST['convertthis'])) { $cbi=' '; $infile='"' . $pathp . str_replace('+',' ',urldecode($_POST['convertthis'])) . '"'; $fextra=' ' . basename(str_replace('"','',$infile)) . ''; //file_put_contents('xa2.xa2', $fextra); } $olstuff=''; $comparep=''; $comparev=''; $comparea=''; $komparep=''; $komparev=''; $komparea=''; if (isset($_POST['dela']) && !isset($_POST['touch'])) { if (file_exists(basename(str_replace('+',' ', urldecode($_POST['dela']))))) { $comparea=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['dela']))))); $komparea=filesize(basename(str_replace('+',' ', urldecode($_POST['dela'])))); } } if (isset($_POST['delv']) && !isset($_POST['touch'])) { $_GET['delv']='video.bad'; //if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delv']))))) { // $comparev=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delv']))))); // $komparev=filesize(basename(str_replace('+',' ', urldecode($_POST['delv'])))); //} if (file_exists(basename(str_replace('+',' ', urldecode($_GET['delv']))))) { $comparev=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_GET['delv']))))); $komparev=filesize(basename(str_replace('+',' ', urldecode($_GET['delv'])))); } } if (isset($_POST['delp']) && !isset($_POST['touch'])) { if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delp']))))) { $comparep=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delp']))))); $komparep=filesize(basename(str_replace('+',' ', urldecode($_POST['delp'])))); } } if (isset($_POST['delh']) && !isset($_POST['touch'])) { if (file_exists('pdftohtml.bad')) { $comparep=date("F d Y H:i:s.", filemtime('pdftohtml.bad')); $komparep=filesize('pdftohtml.bad'); } } if (isset($_POST['delx']) && !isset($_POST['touch'])) { if (file_exists('pdftoxml.bad')) { $comparep=date("F d Y H:i:s.", filemtime('pdftoxml.bad')); $komparep=filesize('pdftoxml.bad'); } } if (isset($_POST['delv'])) { if ($_POST['delv'] != '') { $_GET['delv']='video.bad'; if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delv']))))) { if (strpos(strtolower(str_replace('+',' ', urldecode($_POST['delv'])) . "?"), ".mp4?") !== false) { if (isset($_POST['touch'])) { //file_put_contents('xx0.xx0', 'y'); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delv']))))) { if (PHP_OS == "Darwin" || 1 == 1) { //file_put_contents('xx1.xx1', filesize(basename(str_replace('+',' ', urldecode($_GET['delv'])))) . '/' . date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_GET['delv']))))) . ' '); //$time = time()+15000; $xx=ourtouch(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . basename(str_replace('+',' ', urldecode($_GET['delv']))), null); //exec("touch " . basename(str_replace('+',' ', urldecode($_POST['delv'])))); //sleep(3); //file_put_contents('xx1.xx1', file_get_contents('xx1.xx1') . ' ' . $xx . ' ' . filesize(basename(str_replace('+',' ', urldecode($_GET['delv'])))) . '/' .date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_GET['delv']))))) . ' '); if (!isset($_POST['delp']) && !isset($_POST['dela']) && !isset($_POST['delh']) && !isset($_POST['delx'])) { exit; } } else { if (!isset($_POST['delp']) && !isset($_POST['dela']) && !isset($_POST['delh']) && !isset($_POST['delx'])) { exit; } } } } else { //$comparev=''; //if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delv']))))) { // $comparev=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delv']))))); //} sleep(20); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delv']))))) { if ($comparev == 'HUH' || ($komparev == filesize(basename(str_replace('+',' ', urldecode($_GET['delv'])))) && $comparev == date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_GET['delv']))))))) { //file_put_contents('xxx1.xxx1', $comparev); ourunlink(basename(str_replace('+',' ', urldecode($_POST['delv'])))); $olstuff.=" if (parent.document.getElementById('vemail')) { parent.document.getElementById('vemail').style.display='none'; } if (parent.document.getElementById('vsms')) { parent.document.getElementById('vsms').style.display='none'; } "; } } } } } if (!isset($_POST['delp']) && !isset($_POST['dela']) && !isset($_POST['delh']) && !isset($_POST['delx'])) { if ($olstuff != '') { echo ""; } exit; } } } if (isset($_POST['dela'])) { if ($_POST['dela'] != '') { if (file_exists(basename(str_replace('+',' ', urldecode($_POST['dela']))))) { if (strpos(strtolower(str_replace('+',' ', urldecode($_POST['dela'])) . "?"), ".gif?") !== false) { if (isset($_POST['touch'])) { //file_put_contents('xx2.xx2', 'y'); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['dela']))))) { if (PHP_OS == "Darwin" || 1 == 1) { //file_put_contents('xx3.xx3', 'y'); $time = time()+15000; touch(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . basename(str_replace('+',' ', urldecode($_POST['dela']))), null); //exec("touch " . basename(str_replace('+',' ', urldecode($_POST['dela'])))); if (!isset($_POST['delp']) && !isset($_POST['delh']) && !isset($_POST['delx'])) { exit; } } else { if (!isset($_POST['delp']) && !isset($_POST['delh']) && !isset($_POST['delx'])) { exit; } } } } else { //$comparea=''; //if (file_exists(basename(str_replace('+',' ', urldecode($_POST['dela']))))) { // $comparea=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['dela']))))); //} sleep(20); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['dela']))))) { if ($comparea == 'HUH' || $comparea == date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['dela'])))))) { //file_put_contents('xxx3.xxx3', $comparea); ourunlink(basename(str_replace('+',' ', urldecode($_POST['dela'])))); $olstuff.=" if (parent.document.getElementById('aemail')) { parent.document.getElementById('aemail').style.display='none'; } if (parent.document.getElementById('asms')) { parent.document.getElementById('asms').style.display='none'; } "; } } } } } if (!isset($_POST['delp'])) { if ($olstuff != '') { echo ""; } exit; } } } if (isset($_POST['delp'])) { if ($_POST['delp'] != '') { if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delp']))))) { if (strpos(strtolower(str_replace('+',' ', urldecode($_POST['delp'])) . "?"), ".pdf?") !== false) { if (isset($_POST['touch'])) { //file_put_contents('xx4.xx4', 'y'); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delp']))))) { if (PHP_OS == "Darwin" || 1 == 1) { //file_put_contents('xx5.xx5', 'y'); $time = time()+15000; touch(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . basename(str_replace('+',' ', urldecode($_POST['delp']))), null); //exec("touch " . basename(str_replace('+',' ', urldecode($_POST['delp'])))); if (!isset($_POST['delh']) && !isset($_POST['delx'])) { exit; } } else { if (!isset($_POST['delh']) && !isset($_POST['delx'])) { exit; } } } } else { //$comparep=''; //if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delp']))))) { // $comparep=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delp']))))); //} sleep(20); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delp']))))) { if ($comparep == 'HUH' || $comparep == date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delp'])))))) { //file_put_contents('xxx5.xxx5', $comparep); ourunlink(basename(str_replace('+',' ', urldecode($_POST['delp'])))); $olstuff.=" if (parent.document.getElementById('pemail')) { parent.document.getElementById('pemail').style.display='none'; } if (parent.document.getElementById('psms')) { parent.document.getElementById('psms').style.display='none'; } "; } } } } } if ($olstuff != '') { echo ""; } exit; } } if (isset($_POST['delh'])) { if ($_POST['delh'] != '') { $_POST['delh']='pdftohtml.bad'; if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delh']))))) { if (strpos(strtolower(str_replace('+',' ', urldecode($_POST['delh'])) . "?"), ".pdf?") !== false) { if (isset($_POST['touch'])) { //file_put_contents('xx4.xx4', 'y'); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delh']))))) { if (PHP_OS == "Darwin" || 1 == 1) { //file_put_contents('xx5.xx5', 'y'); $time = time()+15000; touch(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . basename(str_replace('+',' ', urldecode($_POST['delh']))), null); //exec("touch " . basename(str_replace('+',' ', urldecode($_POST['delh'])))); if (!isset($_POST['delx'])) { exit; } } else { if (!isset($_POST['delx'])) { exit; } } } } else { //$comparep=''; //if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delh']))))) { // $comparep=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delh']))))); //} sleep(20); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delh']))))) { if ($comparep == 'HUH' || $comparep == date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delh'])))))) { //file_put_contents('xxx5.xxx5', $comparep); ourunlink(basename(str_replace('+',' ', urldecode($_POST['delh'])))); $olstuff.=" if (parent.document.getElementById('hemail')) { parent.document.getElementById('hemail').style.display='none'; } if (parent.document.getElementById('hsms')) { parent.document.getElementById('hsms').style.display='none'; } "; } } } } } if ($olstuff != '') { echo ""; } exit; } } if (isset($_POST['delx'])) { if ($_POST['delx'] != '') { $_POST['delx']='pdftoxml.bad'; if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delx']))))) { if (strpos(strtolower(str_replace('+',' ', urldecode($_POST['delx'])) . "?"), ".pdf?") !== false) { if (isset($_POST['touch'])) { //file_put_contents('xx4.xx4', 'y'); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delx']))))) { if (PHP_OS == "Darwin" || 1 == 1) { //file_put_contents('xx5.xx5', 'y'); $time = time()+15000; touch(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . basename(str_replace('+',' ', urldecode($_POST['delx']))), null); //exec("touch " . basename(str_replace('+',' ', urldecode($_POST['delx'])))); if (1 == 1) { exit; } } else { if (1 == 1) { exit; } } } } else { //$comparep=''; //if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delx']))))) { // $comparep=date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delx']))))); //} sleep(20); if (file_exists(basename(str_replace('+',' ', urldecode($_POST['delx']))))) { if ($comparep == 'HUH' || $comparep == date("F d Y H:i:s.", filemtime(basename(str_replace('+',' ', urldecode($_POST['delx'])))))) { //file_put_contents('xxx5.xxx5', $comparep); ourunlink(basename(str_replace('+',' ', urldecode($_POST['delx'])))); $olstuff.=" if (parent.document.getElementById('xemail')) { parent.document.getElementById('xemail').style.display='none'; } if (parent.document.getElementById('xsms')) { parent.document.getElementById('xsms').style.display='none'; } "; } } } } } if ($olstuff != '') { echo ""; } exit; } } $vsw=0; $vw=720; $vh=540; $dovideo=false; $doag=false; $dopdf=false; $dohtml=false; $doxml=false; $sparepdf=""; if (isset($_GET['dovideo']) || isset($_POST['dovideo'])) { $dovideo=true; } if (isset($_GET['doag']) || isset($_POST['doag'])) { $doag=true; } if (isset($_GET['dopdf']) || isset($_POST['dopdf'])) { $dopdf=true; } if (isset($_GET['dohtml']) || isset($_POST['dohtml'])) { $dohtml=true; } if (isset($_GET['doxml']) || isset($_POST['doxml'])) { $doxml=true; } $vsw=0; $vw=720; $vh=540; if (isset($_GET['sw'])) { $vsw=intval($_GET['sw']); $vh=(540 * (720 / ($vsw * 0.46))); $vw=($vsw * 0.46); $vh=explode(".", "$vh")[0]; $vh /= 2; $vh=explode(".", "$vh")[0]; $vh *= 2; $vh=explode(".", "$vh")[0]; $vw=explode(".", "$vw")[0]; $vw /= 2; $vw=explode(".", "$vw")[0]; $vw *= 2; $vh=intval("$vh"); $vw=intval("$vw"); //echo $vh . ',' . $vw . ' via ' . $vsw; //exit; } else if (isset($_POST['sw'])) { $vsw=intval($_POST['sw']); $vh=(540 * (720 / ($vsw * 0.46))); $vw=($vsw * 0.46); $vh=explode(".", "$vh")[0]; $vh /= 2; $vh=explode(".", "$vh")[0]; $vh *= 2; $vh=explode(".", "$vh")[0]; $vw=explode(".", "$vw")[0]; $vw /= 2; $vw=explode(".", "$vw")[0]; $vw *= 2; $vh=intval("$vh"); $vw=intval("$vw"); //echo $vh . ',' . $vw . ' via ' . $vsw; //exit; } if (isset($_GET['install'])) { if ($_GET['install'] == 'pdfimages') { if (PHP_OS == "Darwin") { putenv('PATH=/usr/local/bin'); $x="Regarding ...brew install popperIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install poppler 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "" . $x . ""; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $x="Regarding ...sudo apt-get update sudo apt-get install poppler-utilsIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt-get update'); $x.=shell_exec('sudo apt-get install poppler-utils'); echo "" . $x . ""; } } else if ($_GET['install'] == 'ffmpeg') { if (PHP_OS == "Darwin") { putenv('PATH=/usr/local/bin'); $x="Regarding ...brew install ffmpegIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install ffmpeg 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "" . $x . ""; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $x="Regarding ...sudo apt update -y sudo apt install ffmpeg -yIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt update -y'); $x.=shell_exec('sudo apt install ffmpeg -y'); echo "" . $x . ""; } } else if ($_GET['install'] == 'imagemagick') { if (PHP_OS == "Darwin") { putenv('PATH=/usr/local/bin'); $x="Regarding ...brew install imagemagickIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install imagemagick 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "" . $x . ""; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $x="Regarding ...sudo apt updatesudo apt install imagemagickIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt update'); $x.=shell_exec('sudo apt install imagemagick'); echo "" . $x . ""; } } exit; } if (isset($_POST['install'])) { if ($_POST['install'] == 'pdfimages') { if (PHP_OS == "Darwin") { putenv('PATH=/usr/local/bin'); $x="Regarding ...brew install popperIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install poppler 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "" . $x . ""; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $x="Regarding ...sudo apt-get update sudo apt-get install poppler-utilsIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt-get update'); $x.=shell_exec('sudo apt-get install poppler-utils'); echo "" . $x . ""; } } else if ($_POST['install'] == 'ffmpeg') { if (PHP_OS == "Darwin") { putenv('PATH=/usr/local/bin'); $x="Regarding ...brew install ffmpegIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install ffmpeg 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "" . $x . ""; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $x="Regarding ...sudo apt update -y sudo apt install ffmpeg -yIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt update -y'); $x.=shell_exec('sudo apt install ffmpeg -y'); echo "" . $x . ""; } } else if ($_POST['install'] == 'imagemagick') { if (PHP_OS == "Darwin") { putenv('PATH=/usr/local/bin'); $x="Regarding ...brew install imagemagickIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install imagemagick 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "" . $x . ""; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $x="Regarding ...sudo apt updatesudo apt install imagemagickIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt update'); $x.=shell_exec('sudo apt install imagemagick'); echo "" . $x . ""; } } exit; } $filepath=''; $rest=""; $restfrom=""; $restto=" ... or ... Video Animated GIF Image PDF HTML XML "; function rsearch($folder, $pattern, $size) { // thanks, anyway, to https://stackoverflow.com/questions/17160696/php-glob-scan-in-subfolders-for-a-file $didea=''; if (PHP_OS == "Darwin") { //file_put_contents("x.ksh", "find " . $folder . " -type f -name \"" . $pattern . "\" 2> /dev/null -exec wc -c {} + | egrep '^ " . $size . " ' | sed '/ " . $size . " /s///g'"); if ($folder == DIRECTORY_SEPARATOR) { $didea=shell_exec("find \$HOME/Downloads -type f -name \"" . $pattern . "\" 2> /dev/null -exec wc -c {} + | egrep '^ " . $size . " ' | sed '/ " . $size . " /s///g'"); //file_put_contents("xx.ksh", $didea); if ($didea != '') { return $didea; } $didea=shell_exec("find " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . " -type f -name \"" . $pattern . "\" 2> /dev/null -exec wc -c {} + | egrep '^ " . $size . " ' | sed '/ " . $size . " /s///g'"); //file_put_contents("xxx.ksh", $didea); if ($didea != '') { return $didea; } } return shell_exec("find " . $folder . " -type f -name \"" . $pattern . "\" 2> /dev/null -exec wc -c {} + | egrep '^ " . $size . " ' | sed '/ " . $size . " /s///g'"); } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $didea=shell_exec('forfiles /P ' . $_SERVER['DOCUMENT_ROOT'] . ' /S /M * /C “cmd /c if @fsize EQU ' . $size . ' if @file EQU ' . $pattern . " echo @path 2>nul"); if ($didea != '') { return $didea; } //$didea=shell_exec('forfiles /P C:' . substr("\\",0,1) . 'Downloads /S /M * /C “cmd /c if @fsize EQU ' . $size . ' if @file EQU ' . $pattern . " echo @path"); //if ($didea != '') { return $didea; } $didea=shell_exec('forfiles /P C:' . substr("\\",0,1) . ' /S /M * /C “cmd /c if @fsize EQU ' . $size . ' if @file EQU ' . $pattern . " echo @path 2>nul"); if ($didea != '') { return $didea; } } //$iti = new RecursiveDirectoryIterator($folder); //foreach (new RecursiveIteratorIterator($iti) as $file) { //foreach (glob($folder . $pattern) as $file) { // if (strpos($file , $pattern) !== false && filesize($file) == $size) { // return $file; // } //} return ''; } if (isset($_GET['filename']) && isset($_GET['filesize']) && !isset($_GET['filepath'])) { if (file_exists(str_replace('+',' ',urldecode($_GET['filename'])))) { if (filesize(str_replace('+',' ',urldecode($_GET['filename']))) == $_GET['filesize']) { $filepath=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['filename'])); } } if ($filepath == '') { $filepath = rsearch(DIRECTORY_SEPARATOR, str_replace('+',' ',urldecode($_GET['filename'])), $_GET['filesize']); } echo ""; exit; } else if (isset($_GET['filename']) && isset($_GET['filesize']) && $_GET['filepath'] == '') { if (file_exists(str_replace('+',' ',urldecode($_GET['filename'])))) { if (filesize(str_replace('+',' ',urldecode($_GET['filename']))) == $_GET['filesize']) { $filepath=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['filename'])); } } if ($filepath == '') { $filepath = rsearch(DIRECTORY_SEPARATOR, str_replace('+',' ',urldecode($_GET['filename'])), $_GET['filesize']); } echo ""; exit; } else if (isset($_GET['filename']) && isset($_GET['filesize']) && isset($_GET['filepath'])) { $anyextrac=''; if (substr(str_replace('+',' ',urldecode($_GET['filepath'])), -1, 1) != DIRECTORY_SEPARATOR) { $anyextrac=DIRECTORY_SEPARATOR; } echo ""; exit; } $outp='ideas'; if (isset($_GET['outprefix'])) { $outp=str_replace('+',' ',urldecode($_GET['outprefix'])); if (trim($outp) == "") { $outp='ideas'; } } else if (isset($_POST['outprefix'])) { $outp=str_replace('+',' ',urldecode($_POST['outprefix'])); if (trim($outp) == "") { $outp='ideas'; } } $bigp=''; if (PHP_OS == "Darwin") { $bigp='/usr/local/bin/'; } if ($dohtml) { if (isset($_GET['dohtml']) && isset($_GET['pdfbighp'])) { if (!is_dir(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp'])))) { mkdir(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp']))); } $pdfh='pdftohtml -c ' . $infile . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . DIRECTORY_SEPARATOR . "index 2> pdftohtml.bad ; "; $pdfbigh=$bigp . $pdfh; } else if (isset($_POST['dohtml']) && isset($_POST['pdfbighp'])) { if (!is_dir(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp'])))) { mkdir(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp']))); } $pdfh='pdftohtml -c ' . $infile . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . DIRECTORY_SEPARATOR . "index 2> pdftohtml.bad ; "; $pdfbigh=$bigp . $pdfh; } } if ($doxml) { if (isset($_GET['doxml']) && isset($_GET['pdfbighp'])) { if (!is_dir(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp'])))) { mkdir(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp']))); } $pdfh.='pdftohtml -c -xml ' . $infile . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . DIRECTORY_SEPARATOR . $outp . " 2> pdftoxml.bad ;"; $pdfbigh.=$bigp . 'pdftohtml -c -xml ' . $infile . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . DIRECTORY_SEPARATOR . $outp . " 2> pdftoxml.bad ;"; } else if (isset($_POST['doxml']) && isset($_POST['pdfbighp'])) { if (!is_dir(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp'])))) { mkdir(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp']))); } $pdfh.='pdftohtml -c -xml ' . $infile . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . DIRECTORY_SEPARATOR . $outp . " 2> pdftoxml.bad ;"; $pdfbigh.=$bigp . 'pdftohtml -c -xml ' . $infile . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . DIRECTORY_SEPARATOR . $outp . " 2> pdftoxml.bad ;"; } } $origoutp=$outp; $hashbit=""; $olhashbit=""; if ($outp != strtoupper($outp)) { if ($doag && $dovideo) { $autoplay=' autoplay'; $hashbit=" + '#" . strtoupper($outp) . ".mp4#" . strtoupper($outp) . ".gif'"; } else if ($dovideo) { $autoplay=' autoplay'; $hashbit=" + '#" . strtoupper($outp) . ".mp4'"; } else if ($doag) { $hashbit=" + '#" . strtoupper($outp) . ".gif'"; } if ($dohtml) { if ($hashbit == '') { $hashbit=" + '#" . strtoupper($outp) . ".html'"; } else { $hashbit.=" + '#" . strtoupper($outp) . ".html'"; } } if ($doxml) { if ($hashbit == '') { $hashbit=" + '#" . strtoupper($outp) . ".xml'"; } else { $hashbit.=" + '#" . strtoupper($outp) . ".xml'"; } } } else { $defdef=' '; } if (!$dopdf && $hashbit != '' && $outp != strtoupper($outp)) { $olhashbit=''; } else if ($dopdf && $hashbit != '' && $outp != strtoupper($outp)) { $olhashbit=''; } else if ($dopdf && $hashbit == '' && $outp != strtoupper($outp)) { $olhashbit=''; } $outp=strtoupper($outp); $proposedtable=" var outpaths=[], outnames=[]; var bo='3px dashed orange'; var boo=null; var ourwording='&wording=Pdfimages%20images%2E%20'; var ajdone=false; var dmode='ltor'; var lastpath='', lastfilename=''; var gfirstparam=false, gsecondparam='', defem='" . $defdef . "', defs='" . $defdef . "', gblurb=''; var zf=''; function rmzipit(zwhat) { zf=zwhat; var zhr = new XMLHttpRequest(); var zform=new FormData(); zform.append('rmzip', zf); zhr.open('post', document.URL.split('?')[0].split('#')[0], true); zhr.send(zform); } function booit() { if (bo.indexOf(' orange') != -1) { bo=bo.replace(' orange', ' red'); document.getElementById('mysbut').style.border=bo; //boo.style.border=bo; } else { bo=bo.replace(' red', ' orange'); document.getElementById('mysbut').style.border=bo; //boo.style.border=bo; } setTimeout(booit, 3000); } function woit(ioo) { var wo=null; if (ioo.src.indexOf('data:') == 0) { wo=window.open('', '_blank'); wo.document.write(''); wo.document.title=ioo.title; } else { window.open(ioo.src, '_blank'); } } function appit(cbthis) { //alert(cbthis.getAttribute('data-append')); commandit(cbthis.getAttribute('data-append')); outpaths=[]; outnames=[]; document.getElementById('thewords').value=cbthis.getAttribute('data-append').split('" . DIRECTORY_SEPARATOR . "')[eval(-1 + cbthis.getAttribute('data-append').split('" . DIRECTORY_SEPARATOR . "').length)].replace(String.fromCharCode(34),''); document.getElementById('path').value=cbthis.getAttribute('data-append').split(String.fromCharCode(34))[5].split(document.getElementById('thewords').value)[0]; cbthis.checked=false; cbthis.style.display='none'; document.getElementById('sappend').innerHTML=''; } function checkf() { var bcols=['#0000ff','#00ff00','#ff0000','#ffff00','#ff00ff','#00ffff','#777777','#000077','#007700','#770000','#777700','#770077','#007777']; var bids=['vemail', 'vsms', 'aemail', 'asms', 'pemail', 'psms', 'hemail', 'hsms', 'hemail', 'hsms']; if (document.getElementById('justputpdffilename')) { if (document.getElementById('justputpdffilename').innerHTML.toLowerCase().indexOf('.pdf') != -1) { document.getElementById('justputpdffilename').title=document.getElementById('justputpdffilename').innerHTML; document.getElementById('justputpdffilename').innerHTML=''; if (document.getElementById('thewords').value.trim() == '' || document.getElementById('thewords').value == lastfilename) { document.getElementById('thewords').value=document.getElementById('justputpdffilename').title; if (document.getElementById('cbi') && document.getElementById('justputpdffilesize').innerHTML.trim() != document.getElementById('justputpdffilesize').innerHTML) { document.getElementById('cbi').style.height='252px'; } lastfilename=document.getElementById('justputpdffilename').title; outnames.push(lastfilename); } if (document.getElementById('justputpdfpath').innerHTML == '' && document.getElementById('justputpdfpath').title == '') { if (document.getElementById('justputpdffilesize').innerHTML != '') { //alert('am going away to look for filename=' + lastfilename + ' of size ' + document.getElementById('justputpdffilesize').innerHTML.trim()); document.getElementById('justputpdfpath').title=' '; //var xx=prompt(document.URL.split('?')[0].split('#')[0] + '?filepath=&filesize=' + document.getElementById('justputpdffilesize').innerHTML.trim() + '&filename=' + encodeURIComponent(lastfilename), document.URL.split('?')[0].split('#')[0] + '?filepath=&filesize=' + document.getElementById('justputpdffilesize').innerHTML.trim() + '&filename=' + encodeURIComponent(lastfilename)); document.getElementById('path').style.cursor='progress'; lastpath=''; document.getElementById('gifif').src='./php_calls_pdfimages.php?filepath=&filesize=' + document.getElementById('justputpdffilesize').innerHTML.trim() + '&filename=' + encodeURIComponent(lastfilename); } } } else if (document.getElementById('justputpdffilename').innerHTML != '') { document.getElementById('justputpdffilename').innerHTML=''; document.getElementById('justputpdffilesize').innerHTML=''; } if (document.getElementById('justputpdfpath').innerHTML != '') { document.getElementById('justputpdfpath').title=document.getElementById('justputpdfpath').innerHTML; document.getElementById('justputpdfpath').innerHTML=''; if (document.getElementById('justputpdfpath').title.indexOf('/') != -1) { if (document.getElementById('justputpdfpath').title.slice(-1) != '/') { document.getElementById('justputpdfpath').title+='/'; } } else { if (document.getElementById('justputpdfpath').title.slice(-1) != String.fromCharCode(92)) { document.getElementById('justputpdfpath').title+=String.fromCharCode(92); } } if (document.getElementById('path').value.trim() == '' || document.getElementById('path').value == lastpath) { document.getElementById('path').value=document.getElementById('justputpdfpath').title; lastpath=document.getElementById('justputpdfpath').title; outpaths.push(lastpath); if (eval('' + outnames.length) > 1 && eval('' + outpaths.length) > 1) { //alert('okay'); document.getElementById('sappend').innerHTML=' ... versus \"' + '" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . "' + outnames[eval(-2 + outnames.length)].split('.')[0] + outnames[eval(-1 + outnames.length)].split('.')[0] + '.pdf\"'; } } else if (document.getElementById('path').value.trim() != '') { //alert('oops'); } } if (document.getElementById('path').value != '') { if (lastpath == '') { //alert('okaY'); lastpath=''; lastpath=document.getElementById('path').value; outpaths.push(lastpath); if (eval('' + outnames.length) > 1 && eval('' + outpaths.length) > 1) { //alert('okay'); document.getElementById('sappend').innerHTML=' ... versus \"' + '" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . "' + outnames[eval(-2 + outnames.length)].split('.')[0] + outnames[eval(-1 + outnames.length)].split('.')[0] + '.pdf\"'; } lastpath=' '; } document.getElementById('path').style.cursor='pointer'; } } for (var ii=0; ii input[type=file]::file-selector-button { background-color: pink; } '; aconto.getElementById('files').accept='.pdf'; aconto.getElementById('files').multiple=false; aconto.getElementById('files').style.border='5px solid yellow'; arect=aconto.getElementById('files').getBoundingClientRect(); //alert(2); //aconto.getElementById('files').click(); } } } } function toggle() { document.getElementById('myh4').scrollIntoView(); // location.href='#myh4'; if (dmode == 'ltor') { dmode='ttob'; document.getElementById('smode').innerHTML='⬇'; document.getElementById('mydflex').style.display='none'; document.getElementById('mytable').style.display='none'; document.getElementById('mytabletwo').style.display='table'; } else if (dmode == 'ttob') { dmode='fill'; document.getElementById('smode').innerHTML='➡'; document.getElementById('mydflex').style.display='none'; document.getElementById('mytabletwo').style.display='none'; document.getElementById('mytable').style.display='table'; } else { dmode='ltor'; document.getElementById('smode').innerHTML='↘'; document.getElementById('mytable').style.display='none'; document.getElementById('mytabletwo').style.display='none'; document.getElementById('mydflex').style.display='block'; } } function stayex() { if (defem == '' && defs == '') { defem=' '; if (gfirstparam) { delit(gfirstparam, gsecondparam); } } return true; } function emailit(inais) { event.stopPropagation(); if (gfirstparam) { delit(gfirstparam, gsecondparam); } var ext='.mp4'; if (defem == '') { defem=' '; } var ouroutp='" . strtoupper($outp) . "'; if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'h') { ext='.html'; ouroutp='" . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . "' + '" . DIRECTORY_SEPARATOR . "' + 'index'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'x') { ext='.xml'; ouroutp='" . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . "' + '" . DIRECTORY_SEPARATOR . "' + '" . $outp . "'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'a') { ext='.gif'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'p') { ext='.pdf ( or perhaps you want original PDF at " . $infile . " )'; } //var em=prompt('Please enter email address to send to for an email message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "' + ext, ''); var em=prompt('Please enter email address to send to for an email message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "' + ouroutp + ext + ' (or other " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "*.* prefixing' + ' image or other media files, and note that right clicking images below is another sharing possibility)' + gblurb, defem.trim()); if (em == null) { em=''; } if (em.indexOf('@') != -1) { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } defem=em.trim(); document.getElementById('dimap').innerHTML=\"Email\"; document.getElementById('theaemail').click(); } else if (em.trim() == '' && em != '') { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } } return false; } function smsit(inais) { event.stopPropagation(); if (gfirstparam) { delit(gfirstparam, gsecondparam); } var ext='.mp4'; if (defs == '') { defs=' '; } var ouroutp='" . strtoupper($outp) . "'; if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'h') { ext='.html'; ouroutp='" . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . "' + '" . DIRECTORY_SEPARATOR . "' + 'index'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'x') { ext='.xml'; ouroutp='" . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . "' + '" . DIRECTORY_SEPARATOR . "' + '" . $outp . "'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'a') { ext='.gif'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'p') { ext='.pdf ( or perhaps you want original PDF at " . $infile . " )'; } var em=prompt('Please enter SMS number to send to for an SMS message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "' + ouroutp + ext + ' (or other " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "*.* prefixing' + ' image or other media files, and note that right clicking images below is another sharing possibility)' + gblurb, defs.trim()); if (em == null) { em=''; } if (em.trim() != '') { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } if (em.trim() != '') { defs=em.trim(); document.getElementById('dimap').innerHTML=\"SMS\"; document.getElementById('theasms').click(); } } return false; } function oldsmsit(inais) { event.stopPropagation(); if (gfirstparam) { delit(gfirstparam, gsecondparam); } var ext='.mp4'; if (defs == '') { defs=' '; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'a') { ext='.gif'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'p') { ext='.pdf ( or perhaps you want original PDF at " . $infile . " )'; } var em=prompt('Please enter SMS number to send to for an SMS message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "' + ext + ' (or other " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "*.* prefixing' + ' image or other media files, and note that right clicking images below is another sharing possibility)' + gblurb, defs.trim()); if (em == null) { em=''; } if (em.trim() != '') { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } if (em.trim() != '') { defs=em.trim(); document.getElementById('dimap').innerHTML=\"SMS\"; document.getElementById('theasms').click(); } } return false; } function tryagain() { ajdone=false; delit(false, gsecondparam); } function commandit(whatc) { var zhr = new XMLHttpRequest(); var zform=new FormData(); zform.append('pdfunitec', whatc); zhr.open('post', document.URL.split('?')[0].split('#')[0], true); zhr.send(zform); } function delit(istouch, ioissrc) { var doit=false; var thingos=ioissrc.split('#'); var zhr = new XMLHttpRequest(); var zform=new FormData(); var dgebih=''; if (!istouch && gblurb == '') { gfirstparam=true; gsecondparam=ioissrc; gblurb='. Add spaces to say that it is okay, that in two minutes, will tidy up media files, as first requested.'; } if (thingos[0].length > 0) { doit=true; zform.append('delp', ioissrc.split('#')[0]); dgebih=dgebih.replace(' 1) { if (thingos[ijk].indexOf('.mp4') != -1) { doit=true; zform.append('delv', thingos[ijk]); dgebih=dgebih.replace(' Extract the Images Within a PDF File" . $fextra . " via Pdfimages then Ffmpeg and/or ImageMagick RJM Programming ➡ April, 2023 " . $olhashbit . " "; if (isset($_GET['convertthis'])) { $infile='"' . $pathp . str_replace('+',' ',urldecode($_GET['convertthis'])) . '"'; //$fextra=' ' . basename(str_replace('"','',$infile)) . ''; $fextra=' ' . basename(str_replace('"','',$infile)) . ''; //file_put_contents('xa3.xa3', $fextra); } else if (isset($_POST['convertthis'])) { $infile='"' . $pathp . str_replace('+',' ',urldecode($_POST['convertthis'])) . '"'; //$fextra=' ' . basename(str_replace('"','',$infile)) . ''; $fextra=' ' . basename(str_replace('"','',$infile)) . ''; //file_put_contents('xa4.xa4', $fextra); } else if (strpos(('' . $_SERVER['SERVER_NAME']), "localhost") === false) { echo " " . str_replace(explode('>', explode('', explode("', '', explode('', explode(" "; echo str_replace($rest, $restto, $proposedtable); //exit; } else { echo " var ourwording='&wording=Pdfimages%20images%2E%20'; var ajdone=false; var bo='3px dashed orange'; var boo=null; var lastpath='', lastfilename=''; var gfirstparam=false, gsecondparam='', defem='" . $defdef . "', defs='" . $defdef . "', gblurb=''; var outnames=[], outpaths=[]; var zf=''; function rmzipit(zwhat) { zf=zwhat; var zhr = new XMLHttpRequest(); var zform=new FormData(); zform.append('rmzip', zf); zhr.open('post', document.URL.split('?')[0].split('#')[0], true); zhr.send(zform); } function booit() { if (bo.indexOf(' orange') != -1) { bo=bo.replace(' orange', ' red'); document.getElementById('mysbut').style.border=bo; //boo.style.border=bo; } else { bo=bo.replace(' red', ' orange'); document.getElementById('mysbut').style.border=bo; //boo.style.border=bo; } setTimeout(booit, 3000); } function appit(cbthis) { //alert(cbthis.getAttribute('data-append')); commandit(cbthis.getAttribute('data-append')); outpaths=[]; outnames=[]; document.getElementById('thewords').value=cbthis.getAttribute('data-append').split('" . DIRECTORY_SEPARATOR . "')[eval(-1 + cbthis.getAttribute('data-append').split('" . DIRECTORY_SEPARATOR . "').length)].replace(String.fromCharCode(34),''); document.getElementById('path').value=cbthis.getAttribute('data-append').split(String.fromCharCode(34))[5].split(document.getElementById('thewords').value)[0]; cbthis.checked=false; cbthis.style.display='none'; document.getElementById('sappend').innerHTML=''; } function checkf() { var bcols=['#0000ff','#00ff00','#ff0000','#ffff00','#ff00ff','#00ffff','#777777','#000077','#007700','#770000','#777700','#770077','#007777']; var bids=['vemail', 'vsms', 'aemail', 'asms', 'pemail', 'psms', 'hemail', 'hsms', 'hemail', 'hsms']; if (document.getElementById('justputpdffilename')) { if (document.getElementById('justputpdffilename').innerHTML.toLowerCase().indexOf('.pdf') != -1) { document.getElementById('justputpdffilename').title=document.getElementById('justputpdffilename').innerHTML; document.getElementById('justputpdffilename').innerHTML=''; if (document.getElementById('thewords').value.trim() == '' || document.getElementById('thewords').value == lastfilename) { document.getElementById('thewords').value=document.getElementById('justputpdffilename').title; if (document.getElementById('cbi') && document.getElementById('justputpdffilesize').innerHTML.trim() != document.getElementById('justputpdffilesize').innerHTML) { document.getElementById('cbi').style.height='252px'; } lastfilename=document.getElementById('justputpdffilename').title; outnames.push(lastfilename); } if (document.getElementById('justputpdfpath').innerHTML == '' && document.getElementById('justputpdfpath').title == '') { if (document.getElementById('justputpdffilesize').innerHTML != '') { //alert('am going away to look for filename=' + lastfilename + ' of size ' + document.getElementById('justputpdffilesize').innerHTML.trim()); document.getElementById('justputpdfpath').title=' '; //var xx=prompt(document.URL.split('?')[0].split('#')[0] + '?filepath=&filesize=' + document.getElementById('justputpdffilesize').innerHTML.trim() + '&filename=' + encodeURIComponent(lastfilename), document.URL.split('?')[0].split('#')[0] + '?filepath=&filesize=' + document.getElementById('justputpdffilesize').innerHTML.trim() + '&filename=' + encodeURIComponent(lastfilename)); document.getElementById('path').style.cursor='progress'; lastpath=''; document.getElementById('gifif').src='./php_calls_pdfimages.php?filepath=&filesize=' + document.getElementById('justputpdffilesize').innerHTML.trim() + '&filename=' + encodeURIComponent(lastfilename); } } } else if (document.getElementById('justputpdffilename').innerHTML != '') { document.getElementById('justputpdffilename').innerHTML=''; document.getElementById('justputpdffilesize').innerHTML=''; } if (document.getElementById('justputpdfpath').innerHTML != '') { document.getElementById('justputpdfpath').title=document.getElementById('justputpdfpath').innerHTML; document.getElementById('justputpdfpath').innerHTML=''; if (document.getElementById('justputpdfpath').title.indexOf('/') != -1) { if (document.getElementById('justputpdfpath').title.slice(-1) != '/') { document.getElementById('justputpdfpath').title+='/'; } } else { if (document.getElementById('justputpdfpath').title.slice(-1) != String.fromCharCode(92)) { document.getElementById('justputpdfpath').title+=String.fromCharCode(92); } } if (document.getElementById('path').value.trim() == '' || document.getElementById('path').value == lastpath) { document.getElementById('path').value=document.getElementById('justputpdfpath').title; lastpath=document.getElementById('justputpdfpath').title; outpaths.push(lastpath); if (eval('' + outnames.length) > 1 && eval('' + outpaths.length) > 1) { //alert('Okay'); document.getElementById('sappend').innerHTML=' ... versus \"' + '" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . "' + outnames[eval(-2 + outnames.length)].split('.')[0] + outnames[eval(-1 + outnames.length)].split('.')[0] + '.pdf\"'; } } else if (document.getElementById('path').value.trim() != '') { //alert('Oops'); } } if (document.getElementById('path').value != '') { if (lastpath == '') { //alert('OkaY'); lastpath=''; lastpath=document.getElementById('path').value; outpaths.push(lastpath); if (eval('' + outnames.length) > 1 && eval('' + outpaths.length) > 1) { //alert('okay'); document.getElementById('sappend').innerHTML=' ... versus \"' + '" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . "' + outnames[eval(-2 + outnames.length)].split('.')[0] + outnames[eval(-1 + outnames.length)].split('.')[0] + '.pdf\"'; } lastpath=' '; } document.getElementById('path').style.cursor='pointer'; } } for (var ii=0; ii input[type=file]::file-selector-button { background-color: pink; } '; aconto.getElementById('files').accept='.pdf'; aconto.getElementById('files').multiple=false; aconto.getElementById('files').style.border='5px solid yellow'; arect=aconto.getElementById('files').getBoundingClientRect(); //alert(2); //aconto.getElementById('files').click(); } } } } function stayex() { if (defem == '' && defs == '') { defem=' '; if (gfirstparam) { delit(gfirstparam, gsecondparam); } } return true; } function outemailit(inais) { event.stopPropagation(); if (gfirstparam) { delit(gfirstparam, gsecondparam); } var ext='.mp4'; if (defem == '') { defem=' '; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'a') { ext='.gif'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'p') { ext='.pdf ( or perhaps you want original PDF at " . $infile . " )'; } //var em=prompt('Please enter email address to send to for an email message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "' + ext, ''); var em=prompt('Please enter email address to send to for an email message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "' + ext + ' (or other " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "*.* prefixing' + ' image or other media files, and note that right clicking images below is another sharing possibility)' + gblurb, defem.trim()); if (em == null) { em=''; } if (em.indexOf('@') != -1) { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } defem=em.trim(); document.getElementById('dimap').innerHTML=\"Email\"; document.getElementById('theaemail').click(); } else if (em.trim() == '' && em != '') { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } } return false; } function emailit(inais) { event.stopPropagation(); if (gfirstparam) { delit(gfirstparam, gsecondparam); } var ext='.mp4'; if (defem == '') { defem=' '; } var ouroutp='" . strtoupper($outp) . "'; if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'h') { ext='.html'; ouroutp='" . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . "' + '" . DIRECTORY_SEPARATOR . "' + 'index'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'x') { ext='.xml'; ouroutp='" . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . "' + '" . DIRECTORY_SEPARATOR . "' + '" . $outp . "'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'a') { ext='.gif'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'p') { ext='.pdf ( or perhaps you want original PDF at " . $infile . " )'; } //var em=prompt('Please enter email address to send to for an email message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "' + ext, ''); var em=prompt('Please enter email address to send to for an email message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "' + ouroutp + ext + ' (or other " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "*.* prefixing' + ' image or other media files, and note that right clicking images below is another sharing possibility)' + gblurb, defem.trim()); if (em == null) { em=''; } if (em.indexOf('@') != -1) { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } defem=em.trim(); document.getElementById('dimap').innerHTML=\"Email\"; document.getElementById('theaemail').click(); } else if (em.trim() == '' && em != '') { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } } return false; } function smsit(inais) { event.stopPropagation(); if (gfirstparam) { delit(gfirstparam, gsecondparam); } var ext='.mp4'; if (defs == '') { defs=' '; } var ouroutp='" . strtoupper($outp) . "'; if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'h') { ext='.html'; ouroutp='" . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . "' + '" . DIRECTORY_SEPARATOR . "' + 'index'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'x') { ext='.xml'; ouroutp='" . str_replace('+',' ',urldecode($_GET['pdfbighp'])) . str_replace('+',' ',urldecode($_POST['pdfbighp'])) . "' + '" . DIRECTORY_SEPARATOR . "' + '" . $outp . "'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'a') { ext='.gif'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'p') { ext='.pdf ( or perhaps you want original PDF at " . $infile . " )'; } var em=prompt('Please enter SMS number to send to for an SMS message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "' + ouroutp + ext + ' (or other " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "*.* prefixing' + ' image or other media files, and note that right clicking images below is another sharing possibility)' + gblurb, defs.trim()); if (em == null) { em=''; } if (em.trim() != '') { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } if (em.trim() != '') { defs=em.trim(); document.getElementById('dimap').innerHTML=\"SMS\"; document.getElementById('theasms').click(); } } return false; } function oldsmsit(inais) { event.stopPropagation(); if (gfirstparam) { delit(gfirstparam, gsecondparam); } var ext='.mp4'; if (defs == '') { defs=' '; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'a') { ext='.gif'; } if (('' + inais.id + 'v').substring(0,1).toLowerCase() == 'p') { ext='.pdf ( or perhaps you want original PDF at " . $infile . " )'; } var em=prompt('Please enter SMS number to send to for an SMS message to which you might attach " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "' + ext + ' (or other " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . strtoupper($outp) . "*.* prefixing' + ' image or other media files, and note that right clicking images below is another sharing possibility)' + gblurb, defs.trim()); if (em == null) { em=''; } if (em.trim() != '') { if (em.trim() != em && gblurb.trim() != '') { gblurb=' '; setTimeout(tryagain, 120000); } if (em.trim() != '') { defs=em.trim(); document.getElementById('dimap').innerHTML=\"SMS\"; document.getElementById('theasms').click(); } } return false; } function tryagain() { ajdone=false; delit(false, gsecondparam); } function commandit(whatc) { var zhr = new XMLHttpRequest(); var zform=new FormData(); zform.append('pdfunitec', whatc); zhr.open('post', document.URL.split('?')[0].split('#')[0], true); zhr.send(zform); } function delit(istouch, ioissrc) { var doit=false; var thingos=ioissrc.split('#'); var zhr = new XMLHttpRequest(); var zform=new FormData(); var dgebih=''; if (!istouch && gblurb == '') { gfirstparam=true; gsecondparam=ioissrc; gblurb='. Add spaces to say that it is okay, that in two minutes, will tidy up media files, as first requested.'; } if (thingos[0].length > 0) { doit=true; zform.append('delp', ioissrc.split('#')[0]); dgebih=dgebih.replace(' 1) { if (thingos[ijk].indexOf('.mp4') != -1) { doit=true; zform.append('delv', thingos[ijk]); dgebih=dgebih.replace(' 1) { if (thingos[1].indexOf('.mp4') != -1) { doit=true; zform.append('delv', thingos[1]); dgebih=dgebih.replace(' 2) { if (thingos[2].indexOf('.mp4') != -1) { doit=true; zform.append('delv', thingos[2]); dgebih=dgebih.replace(' ... or ... Extract the Images Within a PDF File" . $fextra . " via Pdfimages then Ffmpeg and/or ImageMagick RJM Programming - April, 2023 Video Animated GIF Image PDF HTML XML "; exit; } if (PHP_OS == "Darwin") { $huhw=shell_exec("where pdfimages"); if (strpos($huhw, DIRECTORY_SEPARATOR) !== false) { $proposedtable=str_replace('>', '>' . $huhw . ' -j ' . $infile . ' ' . $outp . ' -png', $proposedtable); foreach (glob($outp . '-*') as $filename) { unlink($filename); } exec($huhw . ' -j ' . $infile . ' ' . $outp . ' -png 2> pdfimages.bad'); } else { if (1 == 1) { putenv('PATH=/usr/local/bin'); $proposedtable=str_replace('>', '>' . $pdfh . 'pdfimages -j ' . $infile . ' ' . $outp . ' -png', $proposedtable); foreach (glob($outp . '-*') as $filename) { unlink($filename); } exec($pdfbigh . 'pdfimages -j ' . $infile . ' ' . $outp . ' -png 2> pdfimages.bad'); } else { $proposedtable=str_replace('>', '>' . $pdfbigh . '/usr/local/bin/pdfimages -j ' . $infile . ' ' . $outp . ' -png', $proposedtable); foreach (glob($outp . '-*') as $filename) { unlink($filename); } exec($pdfbigh . '/usr/local/bin/pdfimages -j ' . $infile . ' ' . $outp . ' -png 2> pdfimages.bad'); } } } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $proposedtable=str_replace('>', '>pdfimages -j ' . $infile . ' ' . $outp . ' -png', $proposedtable); foreach (glob($outp . '-*') as $filename) { unlink($filename); } exec($pdfbigh . 'pdfimages -j ' . $infile . ' ' . $outp . ' -png 2> pdfimages.bad'); } $icnt=0; $sofarw=0; $padbr=''; $rens=","; if ($dopdf) { putenv('PATH=/usr/local/bin'); exec("convert " . $outp . "-*.*g -quality 100 " . $outp . ".pdf 2> pdfimages.bad"); $src=$outp . '.pdf'; if ($outp != strtoupper($outp)) { $sparepdf=' onload=\"delit(false,this.src' . $hashbit . ');\" '; //' title="data:application/pdf;base64,' . base64_encode(file_get_contents($src)) . '" '; //unlink($src); //$src=$spare; //$proposedtable=str_replace('\"delp\" value=\"\"', '\"delp\" value=\"' . $outp . 'pdf\"', $proposedtable); //$rest=str_replace('\"delp\" value=\"\"', '\"delp\" value=\"' . $outp . 'pdf\"', $rest); //$restto=str_replace('\"delp\" value=\"\"', '\"delp\" value=\"' . $outp . 'pdf\"', $restto); } if ($fextra != '') { $fsz=explode('', $fsz[1])[0] . '', '', $proposedtable); } //$proposedtable=str_replace($fextra, '', $proposedtable); } $proposedtable=str_replace('Extract the Images Within a PDF <', 'Images Of Image PDF ' . $fextra . ' 📧 📟' . $cbi . ' <', $proposedtable); $cbi=''; } foreach (glob($outp . '-*') as $filename) { if (strpos($filename, ".jp") === false) { $rens.=explode('.', basename($filename))[0] . '.jpg,' . explode('.', basename($filename))[1] . ','; rename($filename, str_replace('.png', '.jpg', $filename)); } } if ($doag) { if (file_exists($outp . ".gif")) { unlink($outp . ".gif"); } putenv('PATH=/usr/local/bin'); exec("ffmpeg -f image2 -framerate 3 -i " . $outp . "-%03d.jpg -vf \"scale=w=${vw}:h=${vh}:force_original_aspect_ratio=decrease,pad=${vw}:${vh}:(ow-iw)/2:(oh-ih)/2\" -loop 0 " . $outp . ".gif 2> ag.bad"); if (!file_exists($outp . ".gif")) { file_put_contents($outp . ".gif", ""); //$doag=false; } //exit; } //exit; foreach (glob($outp . '-*') as $filename) { if (strpos($rens, ',' . basename($filename) . ',') !== false) { $datau='data:image/' . explode(',',explode(',' . basename($filename) . ',', $rens)[1])[0] . ';base64,' . base64_encode(file_get_contents($filename)); } else { $datau='data:image/' . str_replace("jpg","jpeg",strtolower(explode(".", $filename)[-1 + sizeof(explode(".", $filename))])) . ';base64,' . base64_encode(file_get_contents($filename)); } $proposedtable=str_replace('', '', $proposedtable); $proposedtable=str_replace('', '', $proposedtable); list($width, $height, $type, $attr) = getimagesize($filename); $width=intval("$width"); //file_put_contents("x.x", file_get_contents("x.x") . "sw=" . $vsw . " and original sofarw is " . $sofarw . ' and this width is ' . $width); $sofarw+=$width; $sofarw+=10; //file_put_contents("x.x", file_get_contents("x.x") . " then sofarw becomes " . $sofarw . ' and this width is ' . $width); if ("$vsw" != "0" && intval("$sofarw") >= intval("$vsw")) { $padbr=""; $sofarw=$width; $sofarw+=10; } //else { $sofarw+=($width + 10); } //file_put_contents("x.x", file_get_contents("x.x") . " padbr length is " . strlen($padbr) . "\n"); $proposedtable=str_replace('', $padbr . ' ', $proposedtable); $padbr=''; if (PHP_OS == "Darwin") { if ($icnt == 0 && ($dovideo || $doag || $dopdf || $dohtml || $doxml)) { if (file_exists($outp . '.mp4')) { unlink($outp . '.mp4'); } //if (file_exists($outp . '.gif')) { // unlink($outp . '.gif'); //} if ($dovideo) { $huhvs=['1', '2']; while (sizeof($huhvs) > 1) { if (file_exists('video.bad')) { unlink('video.bad'); } putenv('PATH=/usr/local/bin'); exec("ffmpeg -framerate 3 -i " . $outp . "-%03d.jpg -vf \"scale=w=${vw}:h=${vh}:force_original_aspect_ratio=decrease,pad=${vw}:${vh}:(ow-iw)/2:(oh-ih)/2\" " . $outp . ".mp4 2> video.bad"); // thanks to https://stackoverflow.com/questions/20847674/ffmpeg-libx264-height-not-divisible-by-2 $huhvs=explode('Could not open file :', file_get_contents('video.bad')); //file_put_contents('xaaa.xaaa', '' . sizeof($huhvs) . file_get_contents('video.bad')); if (sizeof($huhvs) > 1) { //file_put_contents('xa.xa', trim(explode(Chr(10), explode('.j', $huhvs[1])[0])) . '.jpg'); rename(trim(explode(Chr(10), $huhvs[1])[0]) . '', trim(explode('.', $huhvs[1])[0]) . '.jpeg'); unlink('video.bad'); if (file_exists($outp . '.mp4')) { unlink($outp . '.mp4'); } //} else { //file_put_contents('xaa.xaa', '' . sizeof($huhvs) . file_get_contents('video.bad')); } } } //exec("ffmpeg -framerate 3 -i " . $outp . "-%03d.jpg -filter:v \"setpts=5.0*PTS\" -vf \"scale=1280:-2\" " . $outp . ".mp4"); // thanks to https://stackoverflow.com/questions/20847674/ffmpeg-libx264-height-not-divisible-by-2 //exec("ffmpeg -framerate 3 -i " . $outp . "-%03d.jpg -filter:v \"setpts=5.0*PTS\" -vf \"scale=1280:-2,pad=ceil(iw/2)*2:ceil(ih/2)*2\" " . $outp . ".mp4"); // thanks to https://stackoverflow.com/questions/20847674/ffmpeg-libx264-height-not-divisible-by-2 //exec("ffmpeg -framerate 3 -i " . $outp . "-%03d.jpg -filter:v \"setpts=5.0*PTS\" -vf \"scale=640:-1\" " . $outp . ".mp4"); // thanks to https://stackoverflow.com/questions/20847674/ffmpeg-libx264-height-not-divisible-by-2 if ($doag) { if (!file_exists($outp . ".gif")) { putenv('PATH=/usr/local/bin'); exec("ffmpeg -f image2 -framerate 3 -i " . $outp . "-%03d.jpg -vf \"scale=w=${vw}:h=${vh}:force_original_aspect_ratio=decrease,pad=${vw}:${vh}:(ow-iw)/2:(oh-ih)/2\" -loop 0 " . $outp . ".gif 2> ag.bad"); if (!file_exists($outp . ".gif")) { $doag=false; } } } if ($dopdf && 1 == 5) { putenv('PATH=/usr/local/bin'); exec("convert " . $outp . "-*.jpg -quality 100 " . $outp . ".pdf 2> pdfimages.bad"); $src=$outp . '.pdf'; if ($outp != strtoupper($outp)) { $sparepdf=' onload=delit(false,this.src' . $hashbit . '); '; //' title="data:application/pdf;base64,' . base64_encode(file_get_contents($src)) . '" '; //unlink($src); //$src=$spare; //$proposedtable=str_replace('\"delp\" value=\"\"', '\"delp\" value=\"' . $outp . 'pdf\"', $proposedtable); //$rest=str_replace('\"delp\" value=\"\"', '\"delp\" value=\"' . $outp . 'pdf\"', $rest); //$restto=str_replace('\"delp\" value=\"\"', '\"delp\" value=\"' . $outp . 'pdf\"', $restto); } $proposedtable=str_replace('Extract the Images Within a PDF <', 'Images Of Image PDF <', $proposedtable); } if ($dovideo && $doag) { $src=$outp . '.mp4'; $srctwo=$outp . '.gif'; if ($outp != strtoupper($outp)) { //file_put_contents('xxx5.xxx5', $src); $spare='data:video/mp4;base64,' . base64_encode(file_get_contents($src)); //file_put_contents('xxx6.xxx6', '' . strlen($spare)); unlink($src); $src=$spare; //file_put_contents('xxx7.xxx7', '' . strlen($spare)); $spare='data:image/gif;base64,' . base64_encode(file_get_contents($srctwo)); //file_put_contents('xxx8.xxx8', '' . strlen($spare)); unlink($srctwo); //file_put_contents('xxx9.xxx9', '' . strlen($spare)); $srctwo=$spare; } $proposedtable=str_replace('', ' Video 📧 📟' . $cbi . ' ... Animated GIF 📧 📟 ...', $proposedtable); $proposedtable=str_replace('', 'Pdfimages images ...', $proposedtable); $proposedtable=str_replace('', '', $proposedtable); $cbi=''; //file_put_contents('xxx0.xxx0', ''); } else if ($doag) { $src=$outp . '.gif'; if ($outp != strtoupper($outp)) { //file_put_contents('xxx00.xxx00', ''); $spare='data:image/gif;base64,' . base64_encode(file_get_contents($src)); unlink($src); $src=$spare; } //file_put_contents('xxx0002.xxx0002', ''); $proposedtable=str_replace('', ' Animated GIF 📧 📟' . $cbi . ' ...', $proposedtable); $proposedtable=str_replace('', 'Pdfimages images ...', $proposedtable); $proposedtable=str_replace('', '', $proposedtable); $cbi=''; //file_put_contents('xxx0003.xxx0003', ''); } else if ($dovideo) { $src=$outp . '.mp4'; if ($outp != strtoupper($outp)) { $spare='data:video/mp4;base64,' . base64_encode(file_get_contents($src)); unlink($src); $src=$spare; } $proposedtable=str_replace('', ' Video 📧 📟' . $cbi . ' ...', $proposedtable); $proposedtable=str_replace('', 'Pdfimages images ...', $proposedtable); $proposedtable=str_replace('', '', $proposedtable); $cbi=''; } } } //file_put_contents('xxx000.xxx000', ''); if ($outp != strtoupper($outp) && str_replace(',','',$rens) == '') { //file_put_contents('xxx0000.xxx0000', $filename); try { if (!file_exists($filename)) { if (file_exists(str_replace('.png','.jpeg',$filename))) { unlink(str_replace('.png','.jpeg',$filename)); } } else { unlink($filename); } } catch (Exception $werty) { } } $icnt++; } $zip = new ZipArchive(); if ($dohtml) { $filename = $outp . "-html.zip"; } else if ($doxml) { $filename = $outp . "-xml.zip"; } else if ($dovideo) { $filename = $outp . "-mp4.zip"; } else if ($doag) { $filename = $outp . "-gif.zip"; } else if ($dopdf) { $filename = $outp . "-pdf.zip"; } else { $filename = $outp . "-.zip"; } if ($zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== TRUE) { file_put_contents("zip.bad", "cannot open <$filename>\n"); } else { // Thanks to https://www.php.net/manual/en/ziparchive.addglob.php //$options = array('add_path' => 'sources/', 'remove_all_path' => TRUE); $zip->addGlob($outp . '*.{jp*,mp4,gif,pdf}', GLOB_BRACE); //, $options); if (($dohtml || $doxml) && isset($_POST['pdfbighp'])) { $options = array('add_path' => rtrim(str_replace('+',' ',urldecode($_POST['pdfbighp'])), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, 'remove_all_path' => TRUE); //$zip->addPattern('/\.(?:jp*,mp4,gif,pdf,htm*,png,xml)$/', rtrim(str_replace('+',' ',urldecode($_POST['pdfbighp'])), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR); $zip->addGlob(rtrim(str_replace('+',' ',urldecode($_POST['pdfbighp'])), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*.*', GLOB_BRACE, $options); } else if (($dohtml || $doxml) && isset($_GET['pdfbighp'])) { $options = array('add_path' => rtrim(str_replace('+',' ',urldecode($_GET['pdfbighp'])), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, 'remove_all_path' => TRUE); //$zip->addPattern('/\.(?:jp*,mp4,gif,pdf,htm*,png,xml)$/', rtrim(str_replace('+',' ',urldecode($_GET['pdfbighp'])), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR); $zip->addGlob(rtrim(str_replace('+',' ',urldecode($_GET['pdfbighp'])), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*.*', GLOB_BRACE, $options); } $zip->close(); } if ($outp != strtoupper($outp) && str_replace(',','',$rens) != '') { //sleep(5); //file_put_contents('xxx0001.xxx0001', ''); foreach (glob($outp . '-*') as $filename) { try { unlink($filename); } catch (Exception $werty) { } } } $preh3=''; if (strpos($pdfh, 'index') !== false) { //$preh3='' . $pdfh . " ..."; $preh3='' . "HTML ... " . '(via Pdftohtml) 📧 📟' . $cbi . ""; $cbi=''; } if (strpos($pdfh, 'xml') !== false) { //$preh3.='' . $pdfh . " ..."; $preh3.='' . "XML ... " . '(via Pdftohtml) 📧 📟' . $cbi . ""; $cbi=''; } if ($preh3 != '') { //file_put_contents('xxx6.xxx6', $preh3); //file_put_contents('xxx7.xxx7', $proposedtable); $proposedtable=str_replace('', '' . $preh3, $proposedtable); //file_put_contents('xxx8.xxx8', $proposedtable); } //file_put_contents('xxx00014.xxx00014', ''); if ($cbi != '') { $proposedtable=str_replace('', $cbi . '', $proposedtable); } echo str_replace(' href="file://php_calls_pdfimages.php', ' href="./php_calls_pdfimages.php', str_replace($rest, $restto, $proposedtable)); //if ($sparepdf != '') { // sleep(20); // unlink($outp . ".pdf"); //} //if (isset($_POST['delp'])) { // if ($_POST['delp'] != '') { // if (file_exists(str_replace('+',' ', urldecode($_POST['delp'])))) { // unlink(str_replace('+',' ', urldecode($_POST['delp']))); // } // } //} exit; ?>
Regarding ...brew install popperIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install poppler 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "
" . $x . "
Regarding ...sudo apt-get update sudo apt-get install poppler-utilsIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt-get update'); $x.=shell_exec('sudo apt-get install poppler-utils'); echo "
Regarding ...brew install ffmpegIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install ffmpeg 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "
Regarding ...sudo apt update -y sudo apt install ffmpeg -yIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt update -y'); $x.=shell_exec('sudo apt install ffmpeg -y'); echo "
Regarding ...brew install imagemagickIf errors below, you should try command above, yourself, on command line ..."; $x.=shell_exec('brew install imagemagick 2> huh.jnk'); if (file_exists('huhjunk.jnk')) { $x.=file_get_contents('huhjnk.jnk'); unlink('huh.jnk'); } echo "
Regarding ...sudo apt updatesudo apt install imagemagickIf errors below, you should try commands above, yourself, on command line ..."; $x.=shell_exec('sudo apt update'); $x.=shell_exec('sudo apt install imagemagick'); echo "
... or ...