BACK END WATER MARK DISBALED

This commit is contained in:
Velz2020 2019-11-02 16:02:58 +05:30
parent 292de4edfb
commit 0e0d5f79f6

View File

@ -7077,34 +7077,34 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
fwrite( $ifp, base64_decode( $temp_data[ 1 ] ) );
fclose( $ifp );
// ################### start img water marking with text
// // ################### start img water marking with text
$imagetobewatermark = imagecreatefromstring(file_get_contents($output_file));
$location_watermarktext="Location: ".$doc['link'];
$font = APPPATH."docs/robold.ttf"; //metion font and it's location
$fontsize="12";
$x = imagesx($imagetobewatermark);
$y = imagesy($imagetobewatermark);
// $imagetobewatermark = imagecreatefromstring(file_get_contents($output_file));
// $location_watermarktext="Location: ".$doc['link'];
// $font = APPPATH."docs/robold.ttf"; //metion font and it's location
// $fontsize="12";
// $x = imagesx($imagetobewatermark);
// $y = imagesy($imagetobewatermark);
$water_mark_text_color = imagecolorallocate($imagetobewatermark, 225, 0, 0);
imagettftext($imagetobewatermark, $fontsize, 0, 120, ($y - 30), $water_mark_text_color, $font, $location_watermarktext);
// $water_mark_text_color = imagecolorallocate($imagetobewatermark, 225, 0, 0);
// imagettftext($imagetobewatermark, $fontsize, 0, 120, ($y - 30), $water_mark_text_color, $font, $location_watermarktext);
imagettftext($imagetobewatermark, $fontsize, 0, 120, ($y - 10), $water_mark_text_color, $font, 'Date: '.date('Y-m-d h:i:s a'));
imagejpeg($imagetobewatermark,$output_file,100);//save as png file in ouputfile location
//################# end img water marking with text
// imagettftext($imagetobewatermark, $fontsize, 0, 120, ($y - 10), $water_mark_text_color, $font, 'Date: '.date('Y-m-d h:i:s a'));
// imagejpeg($imagetobewatermark,$output_file,100);//save as png file in ouputfile location
// //################# end img water marking with text
//###########image water marking with logo
$pd_logo = imagecreatefromstring(file_get_contents(APPPATH.'docs/icon.png'));
$curret_file = imagecreatefromstring(file_get_contents($output_file));
$sx = imagesx($curret_file);
$sy = imagesy($curret_file);
// imagecopyresized ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h ) : bool
imagecopyresampled ( $curret_file , $pd_logo ,5, ($sy - 54) , 0 , 0 , 50 , 50 , 50 , 54 );
// //###########image water marking with logo
// $pd_logo = imagecreatefromstring(file_get_contents(APPPATH.'docs/icon.png'));
// $curret_file = imagecreatefromstring(file_get_contents($output_file));
// $sx = imagesx($curret_file);
// $sy = imagesy($curret_file);
// // imagecopyresized ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h ) : bool
// imagecopyresampled ( $curret_file , $pd_logo ,5, ($sy - 54) , 0 , 0 , 50 , 50 , 50 , 54 );
imagejpeg($curret_file,$output_file,100);// save png image in specified location
//###########end of image water marking with logo
// imagejpeg($curret_file,$output_file,100);// save png image in specified location
// //###########end of image water marking with logo
$tempdoc = $output_file;
$tempdocname = $temp_file_name;