Category : watermark

I cannot insert text watermark using intervention image. After run script I just have source image without text watermark $img = Image::make($infile)->resize(1024, 768, function($constraint) { $constraint->aspectRatio(); $constraint->upsize(); }); $img->text(‘watermark text’, 0, 0, function($font) { $font->file(public_path(‘storage/fonts/DejaVuSans.ttf’)); $font->size(24); $font->color(array(255, 255, 255, 0.3)); $font->align(‘center’); $font->valign(‘top’); $font->angle(0); }); $img->save($outfile); I have DejaVuSans.ttf located in mysitestorageapppublicfonts And I have symlink ..

Read more

I’m using https://github.com/Intervention/image in my laravel Project to generate a watermark on the image. I download and use fonts from https://fonts.google.com and https://github.com/osify/cambodianfonts/tree/master/Unicode/Compartible-with-Photoshop-CS3 Both not working. I wrote code $textFont = public_path(‘Khmer/Khmer-Regular.ttf’); $template = Image::make($this->disk->path($user->avatar)); $text = "កម្ពុជា"; $template->text($text, 190, 600, function ($font) use ($textFont) { $font->file($textFont); $font->size(30); $font->color(‘#bc1f1f’); // $font->align(‘center’); $font->valign(‘top’); $font->angle(0); }); Missing ..

Read more

I have a strange problem with niklasravnsborg/laravel-pdf for some reason mpdf won’t accept the instance configurator properties as seen in the code below. I am currently using the latest version of laravel which is version 7.3 PDF::loadView(‘pdf’, $data, [], [ ‘format’ => ‘A4’, ‘instanceConfigurator’ => function($mpdf) { $mpdf->SetWatermarkText(‘DRAFT’); $mpdf->showWatermarkText = true; } ])->save(public_path($path)); I have ..

Read more