fix: 在线编辑下载文本方向全部设为纵向

This commit is contained in:
2024-04-21 00:00:48 +08:00
parent 929de3eb04
commit ef4f27ddab
@@ -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";