HOWTO Generate WORD Documents from PHP / ASP / .NET / JSP , ...
Watch thoose websites for more informations : | There are different ways to generate .doc files from PHP 1. RTF TemplateThis is a simple and efficient way, as soon as you have a static Layout (I mean nothing to duplicate like lines of a table, ...) You can use an RTF template, and use regexp to replace strings : Open WordPad (or word, or OOWriter, ...) Create a file that looks exactly how you want, insert images if you want to, ... you're quite free. Save your RTF file as template.rtf (for example ...) And in PHP use : <?php $content= fil_get_contents('template.rtf'); $content = str_replace('**TITLE**',$my_title,$content); $content = str_replace( '**USER_NAME**' , $my_username, $content); ... ?> And Voilà, $content is your new RTF file :)
2. HTML FilesThe simpliest way, generate youre layout as HTML and send it to word as a .doc file. and it works :) But You may experience problems with remote Images loading, ...
3. COM ObjectsYou can use COM objects on Windows Servers only More solutions soon :)
|