How to set sections in a document in portrait and landscape orientation, seems like it takes the first section option and uses it for the whole document. Does docxjs provide such functionality?
const doc = new File({
sections: [
{
properties: {
page: {
size: {
orientation: PageOrientation.PORTRAIT,
},
},
},
children: [new Paragraph('Hello PORTRAIT')],
},
{
properties: {
type: SectionType.NEXT_PAGE,
page: {
size: {
orientation: PageOrientation.LANDSCAPE,
},
},
},
children: [new Paragraph('Hello LANDSCAPE')],
},
],
});
Packer.toBlob(doc).then((blob) => {
saveAs(blob, title + '.docx');
});