2017-01-10 70 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'); 
相关问题