Tuesday, January 10, 2012

How to create a Word document with HTML & PHP

This post will explain how to create a Word document without third party software. The code will create a page with orientation landscape, view print and zoom 90% using HTML and PHP statements. 
Please ignore the page #2 after you have created a document Word.


        <title>Generate a document Word</title>
        <!--[if gte mso 9]-->
    <!-- [endif]-->
        p.MsoFooter, li.MsoFooter, div.MsoFooter{
            margin: 0cm;
            margin-bottom: 0001pt;
            font-size: 12.0 pt;
            text-align: right;

        @page Section1{
            size: 29.7cm 21cm;
            margin: 2cm 2cm 2cm 2cm;
            mso-page-orientation: landscape;
        div.Section1 { page:Section1;}
    <div class="Section1">
        <h1>Hello World!</h1>
    <br clear=all style='mso-special-character:line-break;page-break-after:always' />
    <div style='mso-element:footer' id="f1">
        <p class=MsoFooter>
            Page <span style='mso-field-code:" PAGE "'></span>
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=HelloWorld.doc");

Monday, January 2, 2012

What is your favorite operating system? - Results

On December 31st 2011, the poll "What is your favorite Operating System" closed! There was 14 votes to indicate the favorite operating system .

It is curious that nobody voted Mac OS X as operating system favorite and also it is curious three people voted "Other". How would I like to known what is "other". Maybe Debian, Mint, FreeBSD, Fedora,OpenSUSE?