2017-01-10 39 views
0

要在mac中打開docx文件我使用WORD Reader,在這裏你不能編輯文本,但至少打開並閱讀它。那裏,內容工作正常。但是當我用Microsoft WORD在Windows上打開文件時,lineheight是不同的並且延伸了整個內容。phpword生成的文件在mac和windows上有不同的lineheight

是因爲我使用的表格嗎?我是否必須定義lineheight?

回答

0

你不得不提一下表列,寬度,高度,在不同的地方的默認值是不同的

$PHPWord = new PHPWord(); 
    // document style orientation and margin 
    $sectionStyle = array('orientation' => 'landscape', 'marginLeft'=>600, 'marginRight'=>600, 'marginTop'=>600, 'marginBottom'=>600, 'colsNum' => 2); 
    $section = $PHPWord->createSection($sectionStyle); 

    // Define table style arrays 
    $styleTable = array('borderSize'=>6, 'borderColor'=>'006699', 'cellMargin'=>80, 'width'=>100); 

    // Define font style for first row 
    $fontStyle = array('bold'=>true, 'align'=>'center'); 

    // Add table style 
    $PHPWord->addTableStyle('myOwnTableStyle', $styleTable); 

    // Add table 
    $table = $section->addTable('myOwnTableStyle'); 
相關問題