php3-list | 199903
Date: 03/03/99
- Next message: Alan Baer: "Re: [PHP3] Database to MS-Word via PHP3? (A little off topic)"
- Previous message: Nikhil Trivedi: "Re: [PHP3] Database to MS-Word via PHP3? (A little off topic)"
- In reply to: Matthew Hagerty: "[PHP3] Database to MS-Word via PHP3? (A little off topic)"
- Next in thread: Alan Baer: "Re: [PHP3] Database to MS-Word via PHP3? (A little off topic)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Greetings,
>
> Sorry, maybe a little off topic.
>
> My client has a database of customers. My client also wants to be able to
> pull up a record on a client and sent a letter to that client. The letter
> would be canned except for the header and greeting. Does anyone know of a
> way to get field info into a word.doc file and print it from the same UN*X
> server running PostgreSQL? Any one ever do something like this? The app
> I'm developing is written in PHP3. It would also be nice to maybe be able
> to do minor editing of the merged file before it is printed. Asking to
> much? But this kind of thing should be very common, no?
>
> I cannot seem to find a good solution.
Matthew:
I had a similar problem, my solution:
1 Print your M$ Word doc to a pdf template document (You need Acrobat for
that)
2 Edit template.pdf and include fields like Name, Address, etc..
with the form tool of Acrobat, enter some default values typical of these
fields with the maximum length that you expect for those fields.
save the template.
3 After you have 'query ' the variables from the DB, fread the content of the
template.pdf and ereg_replace each field with the corresponding variable.
4 Save the modified template as doctoprint.pdf
5 Send to the browser the doctoprint.pdf that will appear into the acrobat plugin
6 Before you print it, if necessary, you can edit it on-line with the Text tool
A little bit long of an explanation, but if you want to see how it works I can
send you an example.
Alain
-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>
- Next message: Alan Baer: "Re: [PHP3] Database to MS-Word via PHP3? (A little off topic)"
- Previous message: Nikhil Trivedi: "Re: [PHP3] Database to MS-Word via PHP3? (A little off topic)"
- In reply to: Matthew Hagerty: "[PHP3] Database to MS-Word via PHP3? (A little off topic)"
- Next in thread: Alan Baer: "Re: [PHP3] Database to MS-Word via PHP3? (A little off topic)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

