Forum


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

Hi

I had to use

[code]$docx->modifyPageLayout('A4-landscape');[/code]

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

Hello,

Are you using a template or a new DOCX?

Regards.

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

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

[code]
$docx = new CreateDocx();

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

$docx->createDocxAndDownload(
'dynamic_docs/hello_world',
array(
'orient' => 'landscape',
'top' => 1000,
'bottom' => 1000,
'left' => 2000,
'right' => 2000
)
);
[/code]


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,
Seb

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

Hello,

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

Regards.