I want to convert the php file into pdf file, i don't know how to convert it. can any one help me?
It depends on what you actually need "converting". If you want to create a PDF from PHP then there are of lots of libraries to allow you to do it. You can also build a HTML page and have that convert to a PDF too. Here are a couple to take a look at
https://github.com/dompdf/dompdf
http://www.fpdf.org/
from what you described I understood that you want to convert a php file to a pdf file
to do that:
first install a virtual printer that handles pdf (for example, install adobe reader - it's free, it will automatically install an "Adobe PDF" printer)
then open the file in any editor and do a print, but from the printers dialog, select the "Adobe PDF" printer. it will save your file as a pdf
if you open the php file in an editor that supports source formatting (coloring etc) like Notepad++ for example, printing it to pdf will keep the formatting
You can do it through a shellcommand with wkhtmltopdf. This can allow you to get the html printed from the php to be converted into a pdf which then can be downloaded (or displayed).
You can use http://www.freepdfconvert.com/ to convert it online to pdf but you must save the .php file as .txt first.
精彩评论