easy :) { $ids = (int) $ids[0]; //We force ids to be int shell_exec("export DISPLAY=:0 && import -window ".$ids." tmp/tmp.png"); //We take a screenshot for the background $titre = shell_exec("export DISPLAY=:0 && xdotool getwindowname ".$ids); //Get the whole name to forge the title of this page } elseif(count($ids) > 1) //If there are more than one window with "pdf" in the title, display a form to choose which one you want { $form_content = ''; $i = 1; $checked = ''; foreach($ids as $id) { $name = shell_exec("export DISPLAY=:0 && xdotool getwindowname ".$id); if($i == 1) { $checked = 'checked'; $i = 2; } $form_content .= "
"; //Fill a variable containing the radio fields $checked = ''; } } //If $ids == NULL -> no window ok -> Just display an error and put a correct title ?> <?php if(!empty($titre)) echo $titre; elseif(!empty($form_content)) echo "Remote Presentation"; else echo "Error - Remote Presentation"; ?>
'.$output.'

Go back

'; exit; } if(is_file('tmp/tmp.png')) //Protection against the "img not found" little frame { ?>

An error occured. Screenshot is not available.

Have you opened the selected presentation viewer ?

Gauche

Window to work with ?

Go back to form