Skip to content
Advertisement

FPDF not working in creating a simple pdf

I’m playing with FPDF library and i try this simple code:

JavaScript

But it didn’t do anything. No document or exception is popped out. If i correct, if everything is fine a document should appear. I have no idea why it’s not working. Any help would be very appreciated 🙂

Advertisement

Answer

Your problem comes from Header function on your PDF Class. Based on the documentation at least you have to set these variables on Header function

JavaScript

And this is my code that looks like your code, and its works

JavaScript

Result : enter image description here

More detail you can visit official documentation of FPDF

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