public function downloadAttachment($attachmentIndex)
    {
        $fileInformation = $this->GetAttachment($attachmentIndex);
        //build URI to download attachment
        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/attachments/' . $attachmentIndex . '/download';
        //sign URI
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $v_output = Utils::validateOutput($responseStream);
        if ($v_output === '') {
            Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $fileInformation->Name);
            return '';
        } else
            return $v_output;
    }
public function downloadAttachment($attachmentIndex)
    {
        $fileInformation = $this->GetAttachment($attachmentIndex);
        //build URI to download attachment
        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/attachments/' . $attachmentIndex . '/download';
        //sign URI
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $v_output = Utils::validateOutput($responseStream);
        if ($v_output === '') {
            Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $fileInformation->Name);
            return '';
        } else
            return $v_output;
    }
public function downloadAttachment ( $ attachmentIndex ) { $ fileInformation = $ this -> GetAttachment ( $ attachmentIndex ) ; //build URI to download attachment $ strURI = Product :: $ baseProductUri . '/pdf/' . $ this -> getFileName ( ) . '/attachments/' . $ attachmentIndex . '/download' ; //sign URI $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' , '' ) ; $ v_output = Utils :: validateOutput ( $ responseStream ) ; if ( $ v_output === '' ) { Utils :: saveFile ( $ responseStream , AsposeApp :: $ outPutLocation . $ fileInformation -> Name ) ; return '' ; } else return $ v_output ; }
Download the selected attachment from Pdf document.

@param string $attachmentIndex Index of the attachment.

@return string Returns the file path.
@throws Exception
Download the selected attachment from Pdf document .