Forum


Replies: 2   Views: 3503
Docxsetting - zoom setting
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by Sven May  · 04-04-2016 - 11:20

Hello!

What I want: if user open the generated document it open in 110% zoom.
I found this topic: http://www.phpdocx.com/api-documentation/layout-and-general/set-Word-settings
...but it not work for me...

The different how I generate my document and example write it that I use template, generate TOC and make a 'new' document with MultiMerge();

Is it possible that the merge override or hide my general word settigns?
My code:

$docx = new CreateDocxFromTemplate($template);

$docx->addBreak(array('type'=>'page'));
$docx->addText('Table of Contents', array('pStyle'=>'TocStyle'));
$docx->addTableContents(array('autoUpdate'=>true), array('pStyle'=>'AutomaticTable2'));

$docxSettings = array('zoom'=>110);
$docx->docxSettings($docxSettings);
$docx->createDocx(<tmp_myDocx>);

$merge = new MultiMerge();
$merge->mergeDocx(<tmp_myDocx>,<templateDocx2>,<mergedDocx>);

$docx = new CreateDocxFromTemplate(<mergedDocx>);
$docxSettings = array('zoom'=>110);
$docx->docxSettings($docxSettings);
$docx->createDocx(<final_myDocx>);

Insert this code above createDocx() function.