filippotoso / pdf-watermarker

Simple PDF Watermarker with Laravel support
Other
10 stars 7 forks source link

Textwatermark not working #6

Closed ikhsank6 closed 8 months ago

ikhsank6 commented 8 months ago

use FilippoToso\PdfWatermarker\Support\Pdf; use FilippoToso\PdfWatermarker\Watermarks\ImageWatermark; use FilippoToso\PdfWatermarker\Watermarks\TextWatermark; use FilippoToso\PdfWatermarker\PdfWatermarker; use FilippoToso\PdfWatermarker\Support\Position;

$source_pdf = storage_path('app/sample.pdf'); $font = storage_path('app/verdana.ttf'); $output = storage_path('app/result.pdf');

$pdf = new Pdf($source_pdf); $watermark = new TextWatermark('watermark kuy', $font, 120, 40, '#660000' );

$watermarker = new PDFWatermarker($pdf, $watermark); $position = new Position(Position::TOP_CENTER, -20, 40); $watermarker->setPosition($position); $watermarker->setAsBackground(); $watermarker->save($output);

the resulting watermark text does not appear in the output file

filippotoso commented 8 months ago

Try with the latest version

ikhsank6 commented 8 months ago

Try with the latest version

ok thank's , solved

NALAWALAMURTUZA commented 7 months ago

1707294144_bid.pdf

in this pdf, I can't set Watermak as background.

@filippotoso @ikhsank6