Php Convert To Pdf File

Active1 year, 11 months ago

I want to convert the php file into pdf file, i don't know how to convert it. can any one help me?

Breaking the question in two segments 1. Read word file in php 2. Output a pdf file 1. For reading word file with php I would suggest following library PHPOffice/PHPWord If you are not concerned about formatting you can simply read files in php Re. Whenever we work on big PHP application, then we generally require to generate PDF of invoice, data, information, subscription etc. If you use any PHP framework like laravel, codeigniter etc then you have option to other package for generate HTML file into PDF. But if you are working on Code PHP. Converting PHP to PDF The PHP format is associated with an older program released by Adobe, called PhotoParade. The software was designed to help users create and send slideshows and screen savers using a selected number of photos, and then sharing them by email.

Mohammad hayajneh
3711 gold badge5 silver badges24 bronze badges
magnamagna
1583 gold badges4 silver badges13 bronze badges

closed as not a real question by akjoshi, Jeremy Banks, kiamlaluno, j0k, PopsJul 14 '12 at 16:49

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

4 Answers

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

Fabien Ménager
140k3 gold badges35 silver badges58 bronze badges
Rich StandbrookRich Standbrook

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

Andrei SFileAndrei S
5,2625 gold badges32 silver badges51 bronze badges

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).

SondreSondre

You can use http://www.freepdfconvert.com/ to convert it online to pdf but you must save the .php file as .txt first.

T1000T1000

Convert Php File To Pdf Using Mpdf

1,4906 gold badges27 silver badges49 bronze badges

Php Convert Pdf File To Image

Not the answer you're looking for? Browse other questions tagged phphtmlcsspdf or ask your own question.