Create new PDF from existing PDF with PHP

Question:

I have a project that I need to dynamically add header/footer/watermark to existing PDF files via PHP language.

I've done a lot of research and still haven't found a way to do this.

Is it possible to edit existing PDFs in PHP and add information?

Or, would it be possible to create a new PDF, using an existing one, and thus be able to edit the content of this new PDF?

Another way I thought would be to transform the existing PDF into HTML and then transform that HTML into a new PDF with header/footer/watermark.

Answer:

There are a lot of questions in one question, but that's ok. Well, I want to tell you that 60% of what you want is not possible. There are several PHP classes that handle PDFs. You can create PDF, but editing PDF can go 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

Scroll to Top