public function splitPages($from, $to)
    {

        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/split?from=' . $from . '&to=' . $to;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'POST', '', '');
        $json = json_decode($responseStream);

        $dispatcher = AsposeApp::getEventDispatcher();

        $pageNumber = 1;
        foreach ($json->Result->Documents as $splitPage) {
            $splitFileName = basename($splitPage->Href);
            $strURI = Product::$baseProductUri . '/storage/file/' . $splitFileName;
            $signedURI = Utils::sign($strURI);
            $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

            $fileName = $this->getFileName() . '_' . $pageNumber . '.pdf';
            $outputFile = AsposeApp::$outPutLocation . $fileName;

            Utils::saveFile($responseStream, $outputFile);
            echo $outputFile . '<br />';

            $event = new SplitPageEvent($outputFile, $pageNumber);
            $dispatcher->dispatch(SplitPageEvent::PAGE_IS_SPLIT, $event);

            $pageNumber++;
        }
    }
public function splitPages($from, $to)
    {

        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/split?from=' . $from . '&to=' . $to;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'POST', '', '');
        $json = json_decode($responseStream);

        $dispatcher = AsposeApp::getEventDispatcher();

        $pageNumber = 1;
        foreach ($json->Result->Documents as $splitPage) {
            $splitFileName = basename($splitPage->Href);
            $strURI = Product::$baseProductUri . '/storage/file/' . $splitFileName;
            $signedURI = Utils::sign($strURI);
            $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

            $fileName = $this->getFileName() . '_' . $pageNumber . '.pdf';
            $outputFile = AsposeApp::$outPutLocation . $fileName;

            Utils::saveFile($responseStream, $outputFile);
            echo $outputFile . '<br />';

            $event = new SplitPageEvent($outputFile, $pageNumber);
            $dispatcher->dispatch(SplitPageEvent::PAGE_IS_SPLIT, $event);

            $pageNumber++;
        }
    }
public function splitPages ( $ from , $ to ) { $ strURI = Product :: $ baseProductUri . '/pdf/' . $ this -> getFileName ( ) . '/split?from=' . $ from . '&to=' . $ to ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'POST' , '' , '' ) ; $ json = json_decode ( $ responseStream ) ; $ dispatcher = AsposeApp :: getEventDispatcher ( ) ; $ pageNumber = 1 ; foreach ( $ json -> Result -> Documents as $ splitPage ) { $ splitFileName = basename ( $ splitPage -> Href ) ; $ strURI = Product :: $ baseProductUri . '/storage/file/' . $ splitFileName ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' , '' ) ; $ fileName = $ this -> getFileName ( ) . '_' . $ pageNumber . '.pdf' ; $ outputFile = AsposeApp :: $ outPutLocation . $ fileName ; Utils :: saveFile ( $ responseStream , $ outputFile ) ; echo $ outputFile . '<br />' ; $ event = new SplitPageEvent ( $ outputFile , $ pageNumber ) ; $ dispatcher -> dispatch ( SplitPageEvent :: PAGE_IS_SPLIT , $ event ) ; $ pageNumber ++ ; } }
Split page into documents as specified in the range.

@param integer $from From page number.
@param integer $to To page number.

@return string Returns the file path.
@throws Exception
Split page into documents as specified in the range .