Re: help me out with form details converted into pdf file save it one place as well as send mail attactment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/13/08, pretty <anu4php@xxxxxxxxx> wrote:
>
> hi any one help me out, im using cronofirm, i need to field form details will
> converted into pdf as well as it will go maill attachment doing this in
> joomla, atleast i need this only php with out joomla.

It might be overkill for your purposes, but you might want to explore
pdftex in Tex (or LaTeX), available for both Linux and Windows.

Create a string to write to a file, adding these header calls at the
top, massaged to your needs:

$outputStr = "\\documentclass[10pt,fleqn]{article}\n";
$outputStr .= "\\usepackage[cp850]{inputenc}\n";
$outputStr .= "\\usepackage{textcomp}\n";
$outputStr .= "\\setlength{\textwidth}{19.05cm}\n";
$outputStr .= "\\setlength{\oddsidemargin}{-2.0cm}\n";
$outputStr .= "\\setlength{\textheight}{26.5cm}\n";
$outputStr .= "\\setlength{\topmargin}{-1.9cm}\n";
$outputStr .= "\\setlength{\headheight}{0.0cm}\n";
$outputStr .= "\\setlength{\topskip}{0.0cm}\n";
$outputStr .= "\\begin{document}\n";
$outputStr .= "\\pagestyle{empty}\n";
$outputStr .= "\\begin{verbatim}\n";

$outputStr .=  "Then append to the string whatever you want, including
variables for interpolation, formatted however you want. (Sprintf
works really well for alignment, etc...). The verbatim call above
leaves in place all text placement on the page.";

$outputStr .= "Then close the string with these commands...";

$outputStr .= "\\end{verbatim}\n";
$outputStr .= "\\end{document}\n";

Write to a file:

$fh = fopen("FileName.tex", "w");
fwrite($fh, $outputStr);
fclose($fh);

`pdflatex FileName.tex`; // ( properly escaped, of course...)

and FileName.pdf is created.

You can also do a lot of really fancy formatting, but the learning
curve can be pretty steep.

-- 

-David.

When the power of love
overcomes the love of power,
the world will know peace.

-Jimi Hendrix

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux