From 383a598340a99fd84ca696a60758c8a1752b9956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Tue, 11 Jun 2024 11:25:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=86=E5=88=86=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=8C=85=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onlyoffice/controller/OnlyOfficeController.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java index 798d845..a9710b3 100644 --- a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java +++ b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java @@ -568,7 +568,9 @@ public class OnlyOfficeController { Document doc = new Document(filePath + ossFile.getUrl()); doc.getSections().get(0).getPageSetup().setPageNumberStyle(PageNumberStyle.Roman_Upper); doc.getSections().get(0).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 - doc.getSections().get(1).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 + if(doc.getSections().getCount() > 1){ + doc.getSections().get(1).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 + } String downloadDocxFileTempUrl = filePath + "/downloadDocxFileTemp"; File downloadDocxFileTempUrlFile = new File(downloadDocxFileTempUrl); @@ -732,7 +734,9 @@ public class OnlyOfficeController { Document doc = new Document(filePath + ossFile.getUrl()); doc.getSections().get(0).getPageSetup().setPageNumberStyle(PageNumberStyle.Roman_Upper); doc.getSections().get(0).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 - doc.getSections().get(1).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 + if(doc.getSections().getCount() > 1){ + doc.getSections().get(1).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 + } String downloadDocxFileTempUrl = filePath + "/downloadDocxFileTemp"; File downloadDocxFileTempUrlFile = new File(downloadDocxFileTempUrl); @@ -785,7 +789,9 @@ public class OnlyOfficeController { Document doc = new Document(ossFile.getUrl()); doc.getSections().get(0).getPageSetup().setPageNumberStyle(PageNumberStyle.Roman_Upper); doc.getSections().get(0).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 - doc.getSections().get(1).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 + if(doc.getSections().getCount() > 1){ + doc.getSections().get(1).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向 + } String downloadDocxFileTempUrl = filePath + "/downloadDocxFileTemp"; File downloadDocxFileTempUrlFile = new File(downloadDocxFileTempUrl);