开发者

how to convert the php file in to pdf file [closed]

开发者 https://www.devze.com 2023-02-03 19:32 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be 开发者_C百科reasonably answered in its current form. Fo
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be 开发者_C百科reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消