How do we change the page size of a section in Office.js? There is no option in the API (latest version). I have tried doing it through OOXML using several different schemes, to no avail.
I have confirmed (by editing a Docx file manually) that you need to change w:w and w:h attributes of w:pgSz node to change the page size. However, when inserting OOXML, I really can't figure out which object I need to insert it. For example I have tried context.document.body.insertOoxml() as well as context.document.sections.getFirst().body.insertOoxml(), both of which do not change page size in any way.
I have also tried using Section.set() function without success.
Can anyone share how to achieve this?
Edit
The root of the problem seems to be that page size is stored in sectPr node, which Office.js never load. I have tried load() function as well as context.loadRecursive(). I can load Sections collection and their scalar and navigation properties just fine, but properties of the section are never loaded. I'm not sure what else I can do.
The other method, that of inserting raw OOXML, also fails because insertOoxml() method is not available with the Section object, but only with Section.body, which affects the contents of the section and not its meta properties.