Esempio n. 1
0
                 header('Content-type: application/x-shockwave-flash');
                 header('Accept-Ranges: bytes');
                 header('Content-Length: ' . filesize($swfFilePath));
                 echo file_get_contents($swfFilePath);
             }
         }
     } else {
         if (strlen($messages) == 0) {
             $messages = "[Cannot find SWF file. Please check your PHP configuration]";
         }
     }
 }
 // for exporting pdf to json format
 if ($format == "json" || $format == "jsonp") {
     if (!file_exists($jsonFilePath)) {
         $jsonconv = new pdf2json();
         $messages = $jsonconv->convert($pdfdoc, $jsondoc, $page, $subfolder);
     }
     if (file_exists($jsonFilePath)) {
         if ($configManager->getConfig('allowcache')) {
             setCacheHeaders();
         }
         if (!$configManager->getConfig('allowcache') || $configManager->getConfig('allowcache') && endOrRespond()) {
             header('Content-Type: text/javascript');
             if ($format == "json") {
                 echo file_get_contents($jsonFilePath);
             }
             if ($format == "jsonp") {
                 echo $callback . '(' . file_get_contents($jsonFilePath) . ')';
             }
         }
Esempio n. 2
0
                 header('Content-type: application/x-shockwave-flash');
                 header('Accept-Ranges: bytes');
                 header('Content-Length: ' . filesize($swfFilePath));
                 echo file_get_contents($swfFilePath);
             }
         }
     } else {
         if (strlen($messages) == 0) {
             $messages = "[Cannot find SWF file. Please check your PHP configuration]";
         }
     }
 }
 // for exporting pdf to json format
 if ($format == "json" || $format == "jsonp") {
     if (!file_exists($jsonFilePath)) {
         $jsonconv = new pdf2json();
         $messages = $jsonconv->convert($pdfdoc, $jsondoc, $page);
     }
     if (file_exists($jsonFilePath)) {
         if ($configManager->getConfig('allowcache')) {
             setCacheHeaders();
         }
         if (!$configManager->getConfig('allowcache') || $configManager->getConfig('allowcache') && endOrRespond()) {
             header('Content-Type: text/javascript');
             if ($format == "json") {
                 echo file_get_contents($jsonFilePath);
             }
             if ($format == "jsonp") {
                 echo $callback . '(' . file_get_contents($jsonFilePath) . ')';
             }
         }