diff --git a/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java b/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java index bcef934b..b1ee29c5 100644 --- a/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java +++ b/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java @@ -370,7 +370,19 @@ public class OnlyOfficeController { // 加载文档 Document doc = new Document(filePath + path); - doc.getSections().get(0).getPageSetup().setPageNumberStyle(PageNumberStyle.Roman_Upper); + int i = 0; + try { + doc.getSections().get(0).getPageSetup().setPageNumberStyle(PageNumberStyle.Roman_Upper); + for (; i < Integer.MAX_VALUE; i++) { + if (i == 1) { + doc.getSections().get(1).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 + } + doc.getSections().get(i).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 + } + } catch (Exception e) { + log.info("设置纵向页面,循环次数为:{}", i + 1); + } + doc.getSections().get(1).getPageSetup().setPageNumberStyle(PageNumberStyle.Roman_Upper); String downloadDocxFileTempUrl = filePath + "/downloadDocxFileTemp";