Skip to content
Advertisement

How to add a external pdf file as an additional page to TCPF via FPDI

I’m using TCPDF to create PDF files from php files. Works all fine. Now I want to add an additional page using an existing .pdf file from the server.

Best method to do so is using FPDI afaik.

But I can’t find any Docu or working example on how to setup FPDI within TCPDF to add a Page. All I see is how I use an external pdf as header or background etc.

like this one https://www.setasign.com/products/fpdi/about/

What I have in TCPDF:

JavaScript

Error I receive: PHP Fatal error: Uncaught Error: Call to undefined method MYPDF::setSourceFile()

Appreciate any hint on how to do it.

Advertisement

Answer

Just extend the correct class as documented here:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement