Yii Framework Forum: run time watermark generate on pdf file - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

run time watermark generate on pdf file Yii framework Rate Topic: -----

#1 User is offline   Malik fayyaz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 22-December 14
  • Location:Pakistan

Posted 22 December 2014 - 01:47 PM

hello all !!!
english is not my native language...if anything wrong then excuse in advance
i am working on a client project in which i am currently facing a issue the description is bellow...

" i have uploaded a file on server i want when a user from my website download this file should be a watermarked file (watermark text will be 'his email id' in pdf file) "


thanks in advance....

in my contoller
	public function actionDownloadFiles()
        {
			 ignore_user_abort(true);
			 
			 $path =  ( Yii::app()->basePath.'/../images/prequlification_form/'.$_GET['path'] );
			  $fullPath = $path ;
			 if ($fd = fopen ($fullPath, "r")) {
			  $fsize = filesize($fullPath);
			  $path_parts = pathinfo($fullPath);
			   
			  header("Content-type: application/octet-stream");
			  header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
			   
			  header("Content-length: $fsize");
			  header("Cache-control: private");
			  while(!feof($fd)) {
			   $buffer = fread($fd, 2048);
			   echo $buffer;
			  }
			 }
			 fclose ($fd);
			 exit;

        	}



in view

    <div class="file-dwnload">
    <?php 
	$data=prequalificationForm::model()->findByPk(1);
	//echo Yii::app()->createAbsoluteUrl('images/prequlification_form');exit;
	if(!empty($data))  {
        //echo ('/images/prequlification_form/'.$data->file_path);exit;
		//path C:/wamp/www/pre_ipo_system/images/prequlification_form/;

	 echo '<div class="dwnload-file"><li>'.
                 CHtml::link( $data->file_path,array("prequalificationForm/downloadFiles","path"=>($data->file_path))).
				 
       '</li></div> <div class="dwnload-butn"><li>'.
	    CHtml::link('Download File',array("prequalificationForm/downloadFiles","path"=>($data->file_path)))
      ."</li></div> " ;
   }?></div>

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users