* Please see http://flexpaper.devaldi.com/ for further details. * */ require_once "../lib/config.php"; require_once "../lib/common.php"; require_once "../lib/pdf2swf_php5.php"; $configManager = new Config(); $doc = $_GET["doc"]; $page = "1"; $swfFilePath = $configManager->getConfig('path.swf') . $doc . $page . ".swf"; $pdfFilePath = $configManager->getConfig('path.pdf') . $doc; $output = ""; if (glob($configManager->getConfig('path.swf') . $doc . "*") != false) { $pagecount = count(glob($configManager->getConfig('path.swf') . $doc . "*")); } else { $pagecount = 0; } if ($pagecount == 0 && validPdfParams($pdfFilePath, $doc, $page)) { $pdfconv = new pdf2swf(); $output = $pdfconv->convert($doc, $page); if (rtrim($output) === "[Converted]") { $pagecount = count(glob($configManager->getConfig('path.swf') . $doc . "*")); } } else { $output = "Incorrect document file specified, file may not exist or insufficient permissions to read file" . $configManager->getDocUrl(); } if ($pagecount != 0) { echo $pagecount; } else { echo $output; }
MaxZoomSize : 5, SearchMatchAll : false, InitViewMode : 'Portrait', ViewModeToolsVisible : true, ZoomToolsVisible : true, NavToolsVisible : true, CursorToolsVisible : true, SearchToolsVisible : true, localeChain: 'en_US' }}); function onDocumentLoadedError(errMessage){ $('#viewerPlaceHolder').html("Error displaying document. Make sure the conversion tool is installed and that correct user permissions are applied to the SWF Path directory <?php $configManager->getDocUrl(); ?> "); } </script> <?php } else { ?> <script type="text/javascript"> $('#viewerPlaceHolder').html('Cannot read pdf file path, please check your configuration'); </script> <?php } ?> </div>