Skip to content

.landscape does not keep page size for Word (enforce "A4" in landscape whilst default doc is US Letter) #12917

Open
@mcanouil

Description

@mcanouil

I don't think there an easy or even a fix for this at least not by simply injecting OpenXML code.

Using the landscape shortcode for Word document will also have another issue: the page/section dimension might me different to the portrait page/section because the dimension is hardcoded in the shortcode.

In OpenXML, a new section has to contains height, width, etc. and as far as I know don't inherits elements, thus since footer is not defined in the section, it's not there in the end.

For instance, here is what the community contributed landscapes shortcode does for Word:

  • -- Define the end of a portrait section for DOCX
    local end_portrait_section = ooxml '<w:p><w:pPr><w:sectPr></w:sectPr></w:pPr></w:p>'
    -- Define the end of a landscape section for DOCX
    local end_landscape_section = ooxml [[
    <w:p>
    <w:pPr>
    <w:sectPr>
    <w:pgSz w:h="11906" w:w="16838" w:orient="landscape" />
    </w:sectPr>
    </w:pPr>
    </w:p>
    ]]

Originally posted by @mcanouil in #12628

Metadata

Metadata

Assignees

No one assigned

    Labels

    docxIssues with the docx formatenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions