Welcome Guest, Not a member yet? Register   Sign In
Watemark on PDF
#1

Is there any library to add a watermark on the existing pdf?
Learning Codeigniter 
Reply
#2

Have a look at Mpdf, it might solve your issue.
Dirk B.
Abatrans Software
No SEO spam - see forum guidelines
Reply
#3

Use mPDF.

mPDF -> SetWatermarkImage()
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

Thank you , the thing is now I am able to add watermark on existing pdf using below code 
PHP Code:
$path 'dynamics/flight-plan.pdf';
        $mpdf = new Mpdf();
        $mpdf->SetDisplayMode('fullpage');
        $pagecount $mpdf->setSourceFile($path);
        for ($i 1$i <= $pagecount$i++) {
            $tplId $mpdf->importPage($i);
            $mpdf->UseTemplate($tplId);
            $mpdf->SetWatermarkText('CONFIDENTIAL');
            $mpdf->showWatermarkText true;
            $mpdf->AddPage();
        }
        $mpdf->Output('filename.pdf', \Mpdf\Output\Destination::FILE); 


but sometimes I get this error "This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI."
Learning Codeigniter 
Reply
Reply
#6

(03-24-2023, 07:20 AM)JustJohnQ Wrote: https://www.setasign.com/support/faq/fpd...supported/

yeah thanks, I had to buy their commercial addon. anyway, I am gonna mark this one as solved now.
Learning Codeigniter 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB