I must be doing something wrong...
I have setup a test content-type in Drupal, and have a Drupal twig template that has this:
<phpdocx_modifypagelayout data-paperType="A4" data-marginTop="850" data-marginRight="1077" data-marginBottom="850" data-marginLeft="1077" />
{{ node.field_test1.value|raw }} {# outputs a series of paragraphs #}
<phpdocx_section data-paperType="A4-landscape" data-sectionType="nextPage" />
{{ node.field_test2.value|raw }} {# outputs a series of paragraphs #}
<phpdocx_section data-paperType="A4" data-sectionType="nextPage" />
{{ node.field_test3.value|raw }} {# outputs a series of paragraphs #}
<phpdocx_section data-paperType="A4-landscape" data-sectionType="nextPage" />
{{ node.field_test4.value|raw }} {# outputs a series of paragraphs #}
I am expecting that I will see the page orientation change after each block of text. However, what I'm getting is:
- The docx starts with a blank A4 (portrait) page (with correct margins), followed by
- A blank A4-landscape page (with different margins), followed by
- A blank A4 (portrait) page, followed by
- A series of A4-landscape pages with the text output from the Drupal fields
Why am I getting blank pages, changed margins, and why is the text not appearing in the sections that preceed them?
Thanks