Google Answers Logo
View Question
 
Q: Filling In Microsoft Word Form Fields With PHP ( No Answer,   1 Comment )
Question  
Subject: Filling In Microsoft Word Form Fields With PHP
Category: Computers > Programming
Asked by: adam34-ga
List Price: $30.00
Posted: 08 Nov 2005 09:37 PST
Expires: 17 Nov 2005 12:06 PST
Question ID: 590571
I have a Microsoft Word document I use as a template for entering an
order when I receive it from a client. For simplicity's sake, this is
a .DOC file, not a .DOT file. There are various Text Form Fields
throughout the page, and the form is protected so that I can quickly
tab from field to field, filling in the information as necessary.

I realize this method for entering orders is clunky, since I have an
Apache server with PHP and MySQL on my server and I could easily
create a Web page to gather the information, store it, and spit it
back to me in an HTML-formatted page. The problem with this solution
is that I end up emailing the MS Word document to another co-worker
who does his job off-site. Basically, I create the stub file for him,
and he fills in the rest of the information on his end when he does
his job. We do not have a VPN, so accessing the Web site to enter
information on his end is not an option.

I would like to get the order information into the database when I
receive the order without going through the extra step of manually
filling out the MS Word file as well. I know PHP is capable of
accessing COM Objects to interact with applications, so I?m assuming
there?s some way to tell the Word document, through PHP, to fill in
certain form fields with the data I entered into the database through
my Web form.

My question is what process I might use to access my MS Word file
through PHP to have it automatically fill in the Text Form Fields
based on values I submit through my Web form. Also, I realize Adobe
probably offers products like this, but that would involve paying more
for commercial products. Even still, if using a particular product
from Adobe?s family is a possibility, and if it is compatible with an
Apache/PHP setup, I?d be interested in hearing about that as well.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Filling In Microsoft Word Form Fields With PHP
From: larkas-ga on 15 Nov 2005 09:46 PST
 
You need to supply some more information.

What OS is the web server running on? Do you have administrative
access to the web server? Is it only 1 form or many forms in Word? Is
Word installed on the web server?

If it is Unix or Linux and many forms, I would suggest using Nitro PDF
(a cheaper clone of Adobe Acrobat for $100) to print the Word forms
and recreate form fields (or get the steps done from someone you know
that has access to Acrobat or Nitro PDF -- you don't need them after
the forms have been created) and then use PDFtk and PHP to create the
PDF file with all the information filled in it. PDFtk is free and open
source.

PDFtk
http://www.accesspdf.com/pdftk/ See also article on using PHP and PDF
forms on that page.

If it is Windows, using a few forms, and Word is installed on that
machine, I would proceed by attempting to use COM. A COM based
solution would be hard if the server does not have Word installed on
it or is UNIX based.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy