M
M
mr_locke2011-06-21 17:54:45
PHP
mr_locke, 2011-06-21 17:54:45

How to create a printable PDF using PHP?

Greetings!

Advise what methods of the decision of a subject exist?

The task is as follows. There is a site where the user fills out a form, the data from the fields of this form must be inserted into the fields of the printed form, which is stored in a pdf file and sent to the user by mail. It is desirable to have an empty form in the form of a pdf-file, and not to generate it entirely, with all the frames, lines, logos, etc., because it has a rather complex structure, with a lot of fields to fill in by hand and so on, and should fit on one page. And it also requires the method to work on shared hosting :)

Thanks for any info!

If it matters. The site runs on Joomla 1.5, it seems that you can work with pdf in it, in particular, display any page as pdf. This method is not very suitable, because. this requires you to first generate the desired form as HTML, which is tricky :)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry Gulyaev, 2011-06-21
@Didget

There was an article: habrahabr.ru/blogs/php/31438/

M
Melanitsky, 2011-06-21
@Melanitsky

I can’t tell you about the solution for joomla, but there are a number of libraries that allow you to conveniently work with PDF
1) Zend_Pdf - of the pluses there is support for Russian fonts and ttf pickup, minuses of not working with cells, alignment and other things. Although most to implement is not a problem.
2) TCPDF - contains a huge number of features, works with Russian fonts (but they need to be generated) and a bunch of nice goodies. The downside is that it is very cumbersome and without opcode cache, brakes are felt
3) FPDF - works with cells, but there are problems with fonts

D
Denis Medved, 2011-06-21
@BuCeFaL

FPDF+FPDI
www.setasign.de/products/pdf-php-solutions/fpdi/ An
existing template is imported and text is inserted in XY. The only problem is the width of words in different translations - sometimes the translation gets out of the template. Well, transitions to a new line need to be processed, for a Y offset.

M
mr_locke, 2011-06-21
@mr_locke

Thanks everyone for the replies! I will try.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question