Hello,
I am new to OnlyOffice, and started using the API this week. I have a react app that contains the editor and I am using a connector to programatically update some part of a loaded docx document.
I would like to know how to display some pages in Landscape layout (for some schemas or tables for examples), while having the main parts of the document in Portrait layout, if it is possible with OnlyOffice, with the API preferably ?
Document Server version: latest (8.3)
Type of installation of the Document Server: docker (developer edition)
OS: desktop (Windows or macOS)
I found an answer from another part of the forum, and managed to do it with the API.
Code snippet if someone is interested (and maybe there can be some improvements ;-)) :
const oDocument = Api.GetDocument();
const emptyParagraphBefore = Api.CreateParagraph();
const oParagraph = Api.CreateParagraph();
oParagraph.AddText(“Some content to put in landscape”);
oParagraph.AddLineBreak();
oDocument.InsertContent([emptyParagraphBefore, oParagraph]);
const startSection = oDocument.CreateSection(emptyParagraphBefore);
startSection.SetType(“nextPage”);
const endSection = oDocument.CreateSection(oParagraph);
endSection.SetPageSize(16840, 11900, false);
endSection.SetType(“nextPage”);
Hello @NicolasC
Glad to know that you’ve found a solution. Closing topic as solved.