This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Convert PHP file to PDF

danish wrote on 2013-07-17:
Hello Sir,

I am very amazed by your api. But I seem to be having a problem. I have a php file that includes a php variable array which I use in html divs to display an invoice template. Now I want convert that to pdf. I am failing at that.

First I have to put the script code on the top as the headers must be sent first. I used all the functions to get the pdf but what I get is a pdf with non php variable data. or errors. Can you please help. or post a sample of php code which can be converted to pdf. THanks a million
support wrote on 2013-07-17:

Take a look here: and scroll down to the "Provide a PDF version of your web pages" section.

Does this help?
mbarone33 wrote on 2013-08-29:
I've read the tutorial and tried the example. I'm still have having problems integrating the API into my existing html and php form. Please can someone help me with a full example?
saro maddy wrote on 2015-10-10:
convert php to pdf file