public function insertWatermarkText($fileName, $text, $rotationAngle)
    {
        //check whether files are set or not
        if ($fileName == '')
            throw new Exception('File not specified');

        //Build JSON to post
        $fieldsArray = array('Text' => $text, 'RotationAngle' => $rotationAngle);
        $json = json_encode($fieldsArray);

        //build URI to insert watermark text
        $strURI = Product::$baseProductUri . '/words/' . $fileName . '/watermark/insertText';

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

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

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

        if ($v_output === '') {
            //Save docs on server
            $folder = new Folder();
            $outputStream = $folder->GetFile($fileName);
            $outputPath = AsposeApp::$outPutLocation . $fileName;
            Utils::saveFile($outputStream, $outputPath);
            return $outputPath;
        } else
            return $v_output;
    }
public function insertWatermarkText($fileName, $text, $rotationAngle)
    {
        //check whether files are set or not
        if ($fileName == '')
            throw new Exception('File not specified');

        //Build JSON to post
        $fieldsArray = array('Text' => $text, 'RotationAngle' => $rotationAngle);
        $json = json_encode($fieldsArray);

        //build URI to insert watermark text
        $strURI = Product::$baseProductUri . '/words/' . $fileName . '/watermark/insertText';

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

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

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

        if ($v_output === '') {
            //Save docs on server
            $folder = new Folder();
            $outputStream = $folder->GetFile($fileName);
            $outputPath = AsposeApp::$outPutLocation . $fileName;
            Utils::saveFile($outputStream, $outputPath);
            return $outputPath;
        } else
            return $v_output;
    }
public function insertWatermarkText ( $ fileName , $ text , $ rotationAngle ) { //check whether files are set or not if ( $ fileName == '' ) throw new Exception ( 'File not specified' ) ; //Build JSON to post $ fieldsArray = array ( 'Text' => $ text , 'RotationAngle' => $ rotationAngle ) ; $ json = json_encode ( $ fieldsArray ) ; //build URI to insert watermark text $ strURI = Product :: $ baseProductUri . '/words/' . $ fileName . '/watermark/insertText' ; //sign URI $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'POST' , 'json' , $ json ) ; $ v_output = Utils :: validateOutput ( $ responseStream ) ; if ( $ v_output === '' ) { //Save docs on server $ folder = new Folder ( ) ; $ outputStream = $ folder -> GetFile ( $ fileName ) ; $ outputPath = AsposeApp :: $ outPutLocation . $ fileName ; Utils :: saveFile ( $ outputStream , $ outputPath ) ; return $ outputPath ; } else return $ v_output ; }
Inserts water mark text into the document.

@param string $fileName The name of source file.
@param string $text Watermark text.
@param string $rotationAngle Watermark rotation angle in degrees.

@return string Returns the file path.
@throws Exception
Inserts water mark text into the document .