I simplify the code for you:
add_action('init', 'process_post', 21);
function process_post() {
if (isset($_GET['output']) && $_GET['output'] == 'pdf') {
if (shortcode_exists('table')) {
echo "EXIST";
} else {
echo "NOT EXIST";
}
echo do_shortcode('[table id=1 /]');
exit();
}
}
The result is : NOT EXIST [table id=1 /]