public function appendDocument($appendDocs, $importFormatModes, $sourceFolder)
    {
        //check whether required information is complete
        if (count($appendDocs) != count($importFormatModes))
            throw new Exception('Please specify complete documents and import format modes');

        $post_array = array();
        $i = 0;
        foreach ($appendDocs as $doc) {
            $post_array[] = array("Href" => (($sourceFolder != "" ) ? $sourceFolder . "\\" . $doc : $doc), "ImportFormatMode" => $importFormatModes[$i]);
            $i++;
        }
        $data = array("DocumentEntries" => $post_array);
        $json = json_encode($data);

        //build URI to merge Docs
        $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/appendDocument';

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);

        $v_output = Utils::validateOutput($responseStream);

        if ($v_output === '') {
            //Save merged docs on server
            $folder = new Folder();
            $outputStream = $folder->GetFile($sourceFolder . (($sourceFolder == '') ? '' : '/') . $this->getFileName());
            $outputPath = AsposeApp::$outPutLocation . $this->getFileName();
            Utils::saveFile($outputStream, $outputPath);
            return $outputPath;
        }
        
        AsposeApp::getLogger()->warning('Error occured, output could not be validated.', array(
            'v-output' => $v_output,
        ));
        return $v_output;
    }
public function appendDocument($appendDocs, $importFormatModes, $sourceFolder)
    {
        //check whether required information is complete
        if (count($appendDocs) != count($importFormatModes))
            throw new Exception('Please specify complete documents and import format modes');

        $post_array = array();
        $i = 0;
        foreach ($appendDocs as $doc) {
            $post_array[] = array("Href" => (($sourceFolder != "" ) ? $sourceFolder . "\\" . $doc : $doc), "ImportFormatMode" => $importFormatModes[$i]);
            $i++;
        }
        $data = array("DocumentEntries" => $post_array);
        $json = json_encode($data);

        //build URI to merge Docs
        $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/appendDocument';

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);

        $v_output = Utils::validateOutput($responseStream);

        if ($v_output === '') {
            //Save merged docs on server
            $folder = new Folder();
            $outputStream = $folder->GetFile($sourceFolder . (($sourceFolder == '') ? '' : '/') . $this->getFileName());
            $outputPath = AsposeApp::$outPutLocation . $this->getFileName();
            Utils::saveFile($outputStream, $outputPath);
            return $outputPath;
        }
        
        AsposeApp::getLogger()->warning('Error occured, output could not be validated.', array(
            'v-output' => $v_output,
        ));
        return $v_output;
    }
public function appendDocument ( $ appendDocs , $ importFormatModes , $ sourceFolder ) { //check whether required information is complete if ( count ( $ appendDocs ) != count ( $ importFormatModes ) ) throw new Exception ( 'Please specify complete documents and import format modes' ) ; $ post_array = array ( ) ; $ i = 0 ; foreach ( $ appendDocs as $ doc ) { $ post_array [ ] = array ( "Href" => ( ( $ sourceFolder != "" ) ? $ sourceFolder . "\\" . $ doc : $ doc ) , "ImportFormatMode" => $ importFormatModes [ $ i ] ) ; $ i ++ ; } $ data = array ( "DocumentEntries" => $ post_array ) ; $ json = json_encode ( $ data ) ; //build URI to merge Docs $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/appendDocument' ; //sign URI $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'POST' , 'json' , $ json ) ; $ v_output = Utils :: validateOutput ( $ responseStream ) ; if ( $ v_output === '' ) { //Save merged docs on server $ folder = new Folder ( ) ; $ outputStream = $ folder -> GetFile ( $ sourceFolder . ( ( $ sourceFolder == '' ) ? '' : '/' ) . $ this -> getFileName ( ) ) ; $ outputPath = AsposeApp :: $ outPutLocation . $ this -> getFileName ( ) ; Utils :: saveFile ( $ outputStream , $ outputPath ) ; return $ outputPath ; } AsposeApp :: getLogger ( ) -> warning ( 'Error occured, output could not be validated.' , array ( 'v-output' => $ v_output , ) ) ; return $ v_output ; }
Appends a list of documents to this one.

@param string $appendDocs List of documents to append.
@param string $importFormatModes Documents import format modes.
@param string $sourceFolder Name of the folder where documents are present.

@return string Returns the file path.
@throws Exception
Appends a list of documents to this one .