Hello All,
I need your input on how I can get an HTML form that uses PHP to submit via email, to be able to print the results to be formatted exactly like the original form including font spacing and graphics.

I am willing to redo the form. Even use a form builder if needed. I am a designer, not programmer so please be gentle.

I assume you're trying to provide a web frontend to some kind of form the user would fill out manually. In which case you could create a fillable pdf version of your form. This way it is visually identical to the form that would be filled out on paper.

Using php write the submitted form data to xfdf (http://partners.adobe.com/public/developer/en/xml/xfdf_2.0_draft.pdf) which is an xml format.

<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
  <ids original="a6a89dc100551c557b6f51bcb221c461" modified="a6a89dc100551c557b6f51bcb221c461"/>
  <f href=""/>
  <fields>
    <field name="Name">
      <value>John Doe</value>
    </field>
    <field name="Address">
      <value>123 Street</value>
    </field>
  </fields>
</xfdf>

Then, using an application like pdftk (http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) fill the form with the xfdf data. You'll have a perfect 1 to 1 representation of your data in your visual form.

There are a few drawbacks to this though. Some hosts do not allow command line access which you will need to access Pdftk. Also some hosts do not have pdftk installed. Although I've been surprised by the number that do, mostly *nix hosts.

Once you have the generated pdf either attach the actual pdf to the email and send it or simply send the user a link to where they can open the pdf.

See Also: http://partners.adobe.com/public/developer/xml/index_arch.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.