Replies: 5   Views: 3565
Landscape mode
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 nsilberman  · 14-11-2012 - 05:14


I had to use


instead of

[code]$docx->createDocxAndDownload('_mydoc', array('orient' => 'landscape');[/code]

to force landscape mode of my document.
Issue ?

Many thanks

Posted by admin  · 11-04-2013 - 12:13


Are you using a template or a new DOCX?


Posted by seb  · 11-04-2013 - 12:13

I'm also finding the document parameters do not work, for example:

$docx = new CreateDocx();

$docx->addText("Hello world!");

'orient' => 'landscape',
'top' => 1000,
'bottom' => 1000,
'left' => 2000,
'right' => 2000

None of the above parameters have any effect on the resulting document. Is this an issue or am I missing something here?

Having looked at the XML output, I can see now that there is definitely an issue here.

[b]PHPDOCX output:[/b]
[code]<w:pgSz w:w="11906" w:h="16838" w:orient="landscape" w:code="9"/>[/code]

[b]MS Word output (created a blank landscape document):[/b]
[code]<w:pgSz w:w="16838" w:h="11906" w:orient="landscape"/>[/code]

Looks like the orientation is coming through, but the page width and height are still A4-Portrait - why is this?

Many thanks for your help,

Posted by emmecisoftware  · 11-04-2013 - 12:13

Goog morning, i have the sampe problem whit ( phpdocxpro ) on normal mode and landscape mode. What is the problem?

Posted by admin  · 11-04-2013 - 12:13


As the first comment says just use modifyPageLayout method. Almost every options of createDocx are deprecated.