Posts

Showing posts from November, 2020

laravel-dompdf print with text watermark in every page

Image
  I stuck with a problem that is print watermark text to every page. after searching various areas of internet i found a working solution to my problem. i'm now shearing it. so it will useful to someone who have same problem first you have to install laravel-dompdf wrapper. then need to add 'PDF' word to app config aliases list(rootfolder/config/app.php) 'PDF' => Barryvdh\DomPDF\ Facade :: class , import pdf class to controller(or any kind of class object) use PDF ; create pdf wrapper object by loading blade file to laravel-dompdf $pdf = PDF :: loadView ( 'print.view' , compact ( ' yourviewdata' )); set paper size (i set L means 'letter size') $pdf -> setPaper ( 'L' ); then need to render it(we can't call dompdf render function directly. we can use output function for that comes with laravel-dompdf $pdf -> output (); now this need to get core dompdf object from laravel-dompdf wrapper to get canvas(canvas need to ad...

Popular posts from this blog

How to use Spatie packages to enhance your Laravel development experience

Handling undefined variables in laravel

Some Briefs of Data Mining