Generating Formatted Microsoft Word Files with PHP
Moderator: General Moderators
Generating Formatted Microsoft Word Files with PHP
Is there a way to use PHP to generate formatted microsoft word files? By formatted I mean like specify font face, color, etc. throughout the document.
I did some googling and found a way using COM objects.
Check the article out at PHPBuilder: http://www.phpbuilder.com/columns/yunus20031124.php3
Check the article out at PHPBuilder: http://www.phpbuilder.com/columns/yunus20031124.php3
Cool, that is a good idea. An even easier way to do that would be to save a word document with predefined strings in it which would be modified using str_replace.
Then you just open the file using php, replace whatever you want, and then save it to another name or send it to a browser.
I can dig that:)
Then you just open the file using php, replace whatever you want, and then save it to another name or send it to a browser.
I can dig that:)
Last edited by Benjamin on Sun Dec 05, 2004 8:36 pm, edited 1 time in total.
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
Yeah, as long as you are running a Win server and have Word installed on the server a com object can instantiate and call methods of the Word object....really PDF is a better format for publication of documents - we use a com component that can translate everything but the kitchen sink into pdf format.
fv
fv
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
Thats cheating... (bit genius cheating indeed...)agtlewis wrote:Cool, that is a good idea. An even easier way to do that would be to save a word document with predefined strings in it which would be modified using str_replace.
Then you just open the file using php, replace whatever you want, and then save it to another name or send it to a browser.
I can dig that:)