Page 1 of 1

page Break

Posted: Tue May 12, 2009 8:46 am
by witcos
hi to all
actually am trying to create a word document with some content(dynamic content) it goes more than 3 pages ... my problem here is i need a page break between the content.. here is my code

Code: Select all

 
$data .="<table width=75% align=center border=0><tr><td>".$final_data."</td></tr></table>";
     
 
    echo $data;
     
 
    $filename  = $quate_type.".doc";
    
    //$filename = str_replace('&nbsp;','',$filename);  
    
    
         
    $fh        = fopen($filename, 'w') or die("can't open file");
 
    $fwrite    = fwrite($fh,$data);
   
   header("Content-Transfer-Encoding: 8bit");
 
   header("Content-Description: File Transfer");
 
   header("Content-Type: application/text/html;");
 
   header("Content-Disposition: attachment; filename=\"" . basename($filename) . "\""); 
 
any one help me out

Re: page Break

Posted: Tue May 12, 2009 4:30 pm
by requinix
1. You're using HTML. HTML by itself does not have page breaks.
2. The .doc extension is misleading. Use .htm or .html.
3. The MIME type is "text/html". Drop the "application" part.