Forums

How to convert and attach form in pdf?

mdoohan 25 Mar, 2010
Hi,

I'm testing the new chronoforms, and would be very interested to know:

1. How to convert and attach form in pdf format for sending a email?
2. So as you can also send a print to a printer on the network by ip + port?

thanks,
GreyHead 25 Mar, 2010
Hi mdoohan,

1) There are a couple of threads here discussing pdfs and some possible solutions there if I remember correctly

2) I've no idea, sorry . . . but as I wrote that I think that perhaps someone did post a solution like the Joomla print link

Bob
nml375 25 Mar, 2010
Hi mdoohan,
1) As Bob said, there are several threads on the forum regarding this, I've had some success using the fpdf library (a pure-php library for generating simpler pdf-documents), available at http://www.fpdf.org
I'm not sure if I've got any code/examples still lying around, but the docs on the site are decent.

2) This is very system-dependant. On a Windows-based system, there's the printer_* set of functions that allows you to interact with any printer available on the system (obviously depending on user privileges).
On a Unix/Linux/BSD-based system, your best bet would be the lpr executable. This would tough require that the lpr executable is available using the exec(), shell_exec(), or system() commands, further depending on any PHP safe_mode settings. Further, you would most likely have to use ghostscript to convert the pdf-document to ps (PostScript), although some system-setups may support such conversions "on-the-fly". I had something similar working on a homebrew'd CMS back in 2002 or so, so given the proper server setup it's fully possible - but may take some tweaking to get it working..

/Fredrik
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger