PHP Classes

Print layout view

Recommend this page to a friend!

      MsDoc Generator  >  All threads  >  Print layout view  >  (Un) Subscribe thread alerts  
Subject:Print layout view
Summary:On linux doc opens in print layout but on windows not
Date:2010-01-21 04:59:14
Update:2013-04-10 18:53:12

  1. Print layout view   Reply   Report abuse  
mukta - 2010-01-21 04:59:14
> i have developed one application using clsMsDocGenerator.
> The application is working very fine but problem is that whenever i run
> this application on linux,word document is generated in print layout
> view which is as per our requirement.But when i run it on windows system
> the generated word document gets open in web layout view.our basic
> requirement is to open it in print layout view.
> Also when i run it on windows system and open the document using open
> office then instead of actual page content,xml code was displayed on the
> generated word document.
> The application is working finely with linux system but having some
> problems with windows system.

  2. Re: Print layout view   Reply   Report abuse  
Steve - 2012-11-01 22:59:23 - In reply to message 1 from mukta
I know it's an old question but I had the same issue with the print layout so I amended the getHeader function as below and now it opens in print view. hope it helps.

function getHeader(){
$header = '';
$header .= "<head>\n";
$header .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$this->documentCharset\">\n";
$header .= "<meta name=\"ProgId\" content=\"Word.Document\">\n";
$header .= "<meta name=\"Generator\" content=\"$this->appName $this->appVersion\">\n";
$header .= "<meta name=\"Originator\" content=\"$this->appName $this->appVersion\">\n";
$header .= "<!--[if gte mso 9]><xml>";
$header .= "<w:WordDocument>";
$header .= "<w:View>Print</w:View>";
$header .= "<w:DoNotHyphenateCaps/>";
$header .= "<w:PunctuationKerning/>";
$header .= "<w:DrawingGridHorizontalSpacing>9.35 pt</w:DrawingGridHorizontalSpacing>";
$header .= "<w:DrawingGridVerticalSpacing>9.35 pt</w:DrawingGridVerticalSpacing>";
$header .= "</w:WordDocument>";
$header .= "</xml><![endif]-->";
$header .= "<!--[if !mso]>\n";
$header .= "<style>\n";
$header .= "v\:* {behavior:url(#default#VML);}\n";
$header .= "o\:* {behavior:url(#default#VML);}\n";
$header .= "w\:* {behavior:url(#default#VML);}\n";
$header .= ".shape {behavior:url(#default#VML);}\n";
$header .= "</style>\n";
$header .= "<![endif]-->\n";

$header .= "<style>\n";
$header .= "<!--\n";
$header .= "/* Style Definitions */\n";


$header .= $this->formatBuffer ."\n";

$header .= "-->\n";
$header .= "</style>\n";
$header .= "</head>\n";

return $header;
}//end getHeader()

  3. Re: Print layout view   Reply   Report abuse  
Enrique Arroniz - 2013-04-10 18:53:13 - In reply to message 2 from Steve
Thank you very much, works fine on windows!
= )