mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-10-15 18:55:02 +08:00
office 功能调整 支持批注 转换页码限制 生成水印等等
This commit is contained in:
@@ -51,6 +51,13 @@ public class ConfigConstants {
|
||||
private static String cadPreviewType;
|
||||
private static Boolean deleteSourceFile;
|
||||
private static Boolean deleteCaptcha;
|
||||
private static String officePageRange;
|
||||
private static String officeWatermark;
|
||||
private static String officeQuality;
|
||||
private static String officeMaxImageResolution;
|
||||
private static Boolean officeExportBookmarks;
|
||||
private static Boolean officeExportNotes;
|
||||
private static Boolean officeDocumentOpenPasswords;
|
||||
|
||||
public static final String DEFAULT_CACHE_ENABLED = "true";
|
||||
public static final String DEFAULT_TXT_TYPE = "txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd";
|
||||
@@ -81,6 +88,15 @@ public class ConfigConstants {
|
||||
public static final String DEFAULT_DELETE_SOURCE_FILE = "true";
|
||||
public static final String DEFAULT_DELETE_CAPTCHA = "false";
|
||||
|
||||
|
||||
public static final String DEFAULT_OFFICE_PAQERANQE = "false";
|
||||
public static final String DEFAULT_OFFICE_WATERMARK = "false";
|
||||
public static final String DEFAULT_OFFICE_QUALITY = "80";
|
||||
public static final String DEFAULT_OFFICE_MAXIMAQERESOLUTION = "150";
|
||||
public static final String DEFAULT_OFFICE_EXPORTBOOKMARKS = "true";
|
||||
public static final String DEFAULT_OFFICE_EXPORTNOTES = "true";
|
||||
public static final String DEFAULT_EOCUMENTOPENPASSWORDS = "true";
|
||||
|
||||
public static Boolean isCacheEnabled() {
|
||||
return cacheEnabled;
|
||||
}
|
||||
@@ -478,4 +494,86 @@ public class ConfigConstants {
|
||||
public static void setDeleteCaptchaValue(Boolean deleteCaptcha) {
|
||||
ConfigConstants.deleteCaptcha = deleteCaptcha;
|
||||
}
|
||||
|
||||
/**
|
||||
* 以下为OFFICE转换模块设置
|
||||
*/
|
||||
|
||||
public static String getofficePageRange() {
|
||||
return officePageRange;
|
||||
}
|
||||
@Value("${office.pagerange:false}")
|
||||
public void setOfficePageRange(String officepagerange) {
|
||||
setOfficePageRangeValue(officepagerange);
|
||||
}
|
||||
public static void setOfficePageRangeValue(String officepagerange) {
|
||||
ConfigConstants.officePageRange = officepagerange;
|
||||
}
|
||||
|
||||
public static String getofficeWatermark() {
|
||||
return officeWatermark;
|
||||
}
|
||||
@Value("${office.watermark:false}")
|
||||
public void setOfficeWatermark(String officewatermark) {
|
||||
setOfficeWatermarkValue(officewatermark);
|
||||
}
|
||||
public static void setOfficeWatermarkValue(String officewatermark) {
|
||||
ConfigConstants.officeWatermark = officewatermark;
|
||||
}
|
||||
|
||||
public static String getofficeQuality() {
|
||||
return officeQuality;
|
||||
}
|
||||
@Value("${office.Quality:80}")
|
||||
public void setOfficeQuality(String officequality) {
|
||||
setOfficeQualityValue(officequality);
|
||||
}
|
||||
public static void setOfficeQualityValue(String officequality) {
|
||||
ConfigConstants.officeQuality = officequality;
|
||||
}
|
||||
|
||||
public static String getofficeMaxImageResolution() {
|
||||
return officeMaxImageResolution;
|
||||
}
|
||||
@Value("${office.maximageresolution:150}")
|
||||
public void setofficeMaxImageResolution(String officemaximageresolution) {
|
||||
setOfficeMaxImageResolutionValue(officemaximageresolution);
|
||||
}
|
||||
public static void setOfficeMaxImageResolutionValue(String officemaximageresolution) {
|
||||
ConfigConstants.officeMaxImageResolution = officemaximageresolution;
|
||||
}
|
||||
|
||||
public static Boolean getofficeExportBookmarks() {
|
||||
return officeExportBookmarks;
|
||||
}
|
||||
@Value("${office.exportbookmarks:true}")
|
||||
public void setofficeExportBookmarks(Boolean officeexportbookmarks) {
|
||||
setOfficeExportBookmarksValue(officeexportbookmarks);
|
||||
}
|
||||
public static void setOfficeExportBookmarksValue(Boolean officeexportbookmarks) {
|
||||
ConfigConstants.officeExportBookmarks = officeexportbookmarks;
|
||||
}
|
||||
|
||||
public static Boolean getofficeExportNotes() {
|
||||
return officeExportNotes;
|
||||
}
|
||||
@Value("${office.exportnotes:true}")
|
||||
public void setExportNotes(Boolean officeofficeexportnotes) {
|
||||
setOfficeExportNotesValue(officeofficeexportnotes);
|
||||
}
|
||||
public static void setOfficeExportNotesValue(Boolean officeofficeexportnotes) {
|
||||
ConfigConstants.officeExportNotes = officeofficeexportnotes;
|
||||
}
|
||||
|
||||
public static Boolean getofficeDocumentOpenPasswords() {
|
||||
return officeDocumentOpenPasswords;
|
||||
}
|
||||
@Value("${office.documentopenpasswords:true}")
|
||||
public void setDocumentOpenPasswords(Boolean officedocumentopenpasswords) {
|
||||
setOfficeDocumentOpenPasswordsValue(officedocumentopenpasswords);
|
||||
}
|
||||
public static void setOfficeDocumentOpenPasswordsValue(Boolean officedocumentopenpasswords) {
|
||||
ConfigConstants.officeDocumentOpenPasswords = officedocumentopenpasswords;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -63,6 +63,13 @@ public class ConfigRefreshComponent {
|
||||
String cadPreviewType;
|
||||
boolean deleteSourceFile;
|
||||
boolean deleteCaptcha;
|
||||
String officPageRange;
|
||||
String officWatermark;
|
||||
String officQuality;
|
||||
String officMaxImageResolution;
|
||||
boolean officExportBookmarks;
|
||||
boolean officeExportNotes;
|
||||
boolean officeDocumentOpenPasswords;
|
||||
while (true) {
|
||||
FileReader fileReader = new FileReader(configFilePath);
|
||||
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
||||
@@ -96,6 +103,13 @@ public class ConfigRefreshComponent {
|
||||
officeTypeWeb = properties.getProperty("office.type.web", ConfigConstants.DEFAULT_OFFICE_TYPE_WEB);
|
||||
deleteSourceFile = Boolean.parseBoolean(properties.getProperty("delete.source.file", ConfigConstants.DEFAULT_DELETE_SOURCE_FILE));
|
||||
deleteCaptcha = Boolean.parseBoolean(properties.getProperty("delete.captcha", ConfigConstants.DEFAULT_DELETE_CAPTCHA));
|
||||
officPageRange = properties.getProperty("office.pagerange", ConfigConstants.DEFAULT_OFFICE_PAQERANQE);
|
||||
officWatermark = properties.getProperty("office.watermark", ConfigConstants.DEFAULT_OFFICE_WATERMARK);
|
||||
officQuality = properties.getProperty("office.quality", ConfigConstants.DEFAULT_OFFICE_QUALITY);
|
||||
officMaxImageResolution = properties.getProperty("office.maximageresolution", ConfigConstants.DEFAULT_OFFICE_MAXIMAQERESOLUTION);
|
||||
officExportBookmarks = Boolean.parseBoolean(properties.getProperty("office.exportbookmarks", ConfigConstants.DEFAULT_OFFICE_EXPORTBOOKMARKS));
|
||||
officeExportNotes = Boolean.parseBoolean(properties.getProperty("office.exportnotes", ConfigConstants.DEFAULT_OFFICE_EXPORTNOTES));
|
||||
officeDocumentOpenPasswords = Boolean.parseBoolean(properties.getProperty("office.documentopenpasswords", ConfigConstants.DEFAULT_EOCUMENTOPENPASSWORDS));
|
||||
prohibitArray = prohibit.split(",");
|
||||
|
||||
ConfigConstants.setCacheEnabledValueValue(cacheEnabled);
|
||||
@@ -122,6 +136,13 @@ public class ConfigRefreshComponent {
|
||||
ConfigConstants.setPasswordValue(password);
|
||||
ConfigConstants.setPdf2JpgDpiValue(pdf2JpgDpi);
|
||||
ConfigConstants.setOfficeTypeWebValue(officeTypeWeb);
|
||||
ConfigConstants.setOfficePageRangeValue(officPageRange);
|
||||
ConfigConstants.setOfficeWatermarkValue(officWatermark);
|
||||
ConfigConstants.setOfficeQualityValue(officQuality);
|
||||
ConfigConstants.setOfficeMaxImageResolutionValue(officMaxImageResolution);
|
||||
ConfigConstants.setOfficeExportBookmarksValue(officExportBookmarks);
|
||||
ConfigConstants.setOfficeExportNotesValue(officeExportNotes);
|
||||
ConfigConstants.setOfficeDocumentOpenPasswordsValue(officeDocumentOpenPasswords);
|
||||
ConfigConstants.setDeleteSourceFileValue(deleteSourceFile);
|
||||
ConfigConstants.setDeleteCaptchaValue(deleteCaptcha);
|
||||
setWatermarkConfig(properties);
|
||||
|
Reference in New Issue
Block a user