Create new PDF from existing PDF with PHP
I am with a project that I need to add header/footer / watermark, dynamically on existing PDF files, through PHP language.
I've done a lot of research and haven't found a way to do this yet.
Is it possible to edit existing PDFs in PHP and add information?
Or, would it be possible to create a new PDF, through an existing one, and thus be able to edit the content of this new PDF?
Another way I thought it would turn the existing PDF into HTML and ai turn that HTML into a new PDF with the header/footer / watermark.
1 answers
Are many questions in one question, but that's fine. Well, I want to tell you that 60% of what you want is not possible. There are several PHP classes that deal with PDFs. You can create PDF, but editing PDF might be a long way. Depende muito do que significa editar pdf
. Creating a footer for example could be relatively easy, but changing a text in the pdf will depend on many factors, starting with the way that PDF was created. See this example