瀏覽代碼

转档-库,函数更新

liyijie 2 年之前
父節點
當前提交
21da226e3d
共有 41 個文件被更改,包括 354 次插入100 次删除
  1. 二進制
      PDF Office/ComDocumentAIKit.dll
  2. 二進制
      PDF Office/ComPDFKit_Conversion.dll
  3. 13 13
      PDF Office/Helper/ConverterHelper.cs
  4. 7 1
      PDF Office/Model/Dialog/ConverterDialogs/ConverterCSVDialogModel.cs
  5. 24 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs
  6. 17 6
      PDF Office/Model/Dialog/ConverterDialogs/ConverterExcelDialogModel.cs
  7. 16 5
      PDF Office/Model/Dialog/ConverterDialogs/ConverterHTMLDialogModel.cs
  8. 14 2
      PDF Office/Model/Dialog/ConverterDialogs/ConverterImgDialogModel.cs
  9. 12 1
      PDF Office/Model/Dialog/ConverterDialogs/ConverterPPTDialogModel.cs
  10. 13 1
      PDF Office/Model/Dialog/ConverterDialogs/ConverterRTFDialogModel.cs
  11. 9 1
      PDF Office/Model/Dialog/ConverterDialogs/ConverterTextDialogModel.cs
  12. 13 1
      PDF Office/Model/Dialog/ConverterDialogs/ConverterWordDialogModel.cs
  13. 9 1
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVModel.cs
  14. 23 1
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogModel.cs
  15. 10 6
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelModel.cs
  16. 9 5
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterHTMLModel.cs
  17. 11 2
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgModel.cs
  18. 13 1
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterPPTModel.cs
  19. 13 1
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterRTFModel.cs
  20. 10 1
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterTextModel.cs
  21. 13 1
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordModel.cs
  22. 21 18
      PDF Office/PDF Office.csproj
  23. 19 9
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  24. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  25. 12 4
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs
  26. 3 3
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs
  27. 2 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs
  28. 17 9
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelViewModel.cs
  29. 29 3
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgViewModel.cs
  30. 1 1
      PDF Office/ViewModels/Tools/ScanContentViewModel.cs
  31. 二進制
      PDF Office/x64/CPDFConverterNative.dll
  32. 二進制
      PDF Office/x64/DocumentAILib/opencv_world420d.dll
  33. 二進制
      PDF Office/x64/models/DA_Ocr_Classification_1.0.0.model
  34. 二進制
      PDF Office/x64/models/DA_Ocr_Detection_chinese_1.0.0.model
  35. 二進制
      PDF Office/x64/models/DA_Ocr_Detection_english_1.0.0.model
  36. 二進制
      PDF Office/x64/models/DA_Ocr_Recognition_chinese_1.0.0.model
  37. 二進制
      PDF Office/x64/models/DA_Ocr_Recognition_chinese_cht_1.0.0.model
  38. 二進制
      PDF Office/x64/models/DA_Ocr_Recognition_english_1.0.0.model
  39. 二進制
      PDF Office/x64/models/DA_Ocr_Recognition_japan_1.0.0.model
  40. 二進制
      PDF Office/x64/models/DA_Ocr_Recognition_korean_1.0.0.model
  41. 二進制
      PDF Office/x86/CPDFConverterNative.dll

二進制
PDF Office/ComDocumentAIKit.dll


二進制
PDF Office/ComPDFKit_Conversion.dll


+ 13 - 13
PDF Office/Helper/ConverterHelper.cs

@@ -26,7 +26,7 @@ namespace PDF_Office.Helper
         public static CPDFConverterImg imgConverter = null;
         public static CPDFConverterRTF rtfConverter = null;
         public static CPDFConverterHTML htmlConverter = null;
-        public static async Task<bool> WordConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        public static async Task<bool> WordConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertWordOptions wordOptions = null)
         {
             bool result = false;
             try
@@ -37,7 +37,7 @@ namespace PDF_Office.Helper
                 string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
                 string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".docx");
-                result = await Task.Run(() => wordConverter.Convert(outputFolder, ref outputFileName, pageArray, ref error, getProgress));
+                result = await Task.Run(() => wordConverter.Convert(outputFolder, ref outputFileName, wordOptions, pageArray, ref error, getProgress));
             }
             catch (Exception ex)
             {
@@ -46,7 +46,7 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> PPTConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        public static async Task<bool> PPTConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertPPTOptions pptOptions=null)
         {
             bool result = false;
             try
@@ -60,7 +60,7 @@ namespace PDF_Office.Helper
 
                 string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".ppt");
 
-                result = await Task.Run(() => pptConverter.Convert(outputFolder, ref outputFileName, pageArray, ref error, getProgress));
+                result = await Task.Run(() => pptConverter.Convert(outputFolder, ref outputFileName, pptOptions,pageArray, ref error, getProgress));
                 if (result)
                 {
                     if (File.Exists(outputFileName))
@@ -124,7 +124,7 @@ namespace PDF_Office.Helper
         //    return result;
         //}
 
-        public static async Task<bool> CSVConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        public static async Task<bool> CSVConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertCsvOptions csvOptions =null)
         {
             bool result = false;
             try
@@ -136,7 +136,7 @@ namespace PDF_Office.Helper
                 string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
                 string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".csv");
-                result = await Task.Run(() => csvConverter.Convert(outputFolder, ref outputFileName, pageArray, ref error, getProgress));
+                result = await Task.Run(() => csvConverter.Convert(outputFolder, ref outputFileName, csvOptions, pageArray, ref error, getProgress));
 
             }
             catch (Exception ex)
@@ -146,7 +146,7 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> TxtConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        public static async Task<bool> TxtConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword,CPDFConvertTxtOptions txtOptions =null)
         {
             bool result = false;
             try
@@ -158,7 +158,7 @@ namespace PDF_Office.Helper
                 string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
                 string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".txt");
-                result = await Task.Run(() => txtConverter.Convert(outputFolder, ref outputFileName, pageArray, ref error, getProgress));
+                result = await Task.Run(() => txtConverter.Convert(outputFolder, ref outputFileName, txtOptions, pageArray, ref error, getProgress));
 
             }
             catch (Exception ex)
@@ -245,7 +245,7 @@ namespace PDF_Office.Helper
 
         }       
 
-        public static async Task<bool> ImgConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists,string pawssword, ImgType type,string imageType=".png")
+        public static async Task<bool> ImgConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists,string pawssword,string imageType=".png", CPDFConvertImgOptions imgOptions = null)
         {
             bool result = false;
             try
@@ -258,7 +258,7 @@ namespace PDF_Office.Helper
                 ConvertError error = ConvertError.ERR_UNKNOWN;
                 if (imageType == ".png" || imageType == ".jpg")
                 {
-                    result = await Task.Run(() => imgConverter.Convert(outputFolder, ref outputFileName, pageArray, type, ref error, getProgress));
+                    result = await Task.Run(() => imgConverter.Convert(outputFolder, ref outputFileName, imgOptions, pageArray, ref error, getProgress));
                 }
                 else
                 { //创建缓存文件夹
@@ -280,7 +280,7 @@ namespace PDF_Office.Helper
                     //预览图缓存
                     string saveName = Guid.NewGuid().ToString();
                     string savePath = Path.Combine(folderPath, saveName);
-                     result = await Task.Run(() => imgConverter.Convert(folderPath, ref saveName, pageArray, type, ref error, getProgress));
+                     result = await Task.Run(() => imgConverter.Convert(folderPath, ref saveName, imgOptions, pageArray, ref error, getProgress));
                     ImageMagickPDFToImage(imageType, saveName, outputFolder, outputFileName);
                     DirectoryInfo di = new DirectoryInfo(folderPath);
                     di.Delete(true);
@@ -299,7 +299,7 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> RTFConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        public static async Task<bool> RTFConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertRTFOptions rtfOptions=null)
         {
             bool result = false;
             try
@@ -309,7 +309,7 @@ namespace PDF_Office.Helper
                 string outputFolder = outputpath;
                 string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
-                result = await Task.Run(() => rtfConverter.Convert(outputFolder, ref outputFileName, pageArray, ref error, getProgress));
+                result = await Task.Run(() => rtfConverter.Convert(outputFolder, ref outputFileName, rtfOptions,pageArray, ref error, getProgress));
             }
             catch (Exception ex)
             {

+ 7 - 1
PDF Office/Model/Dialog/ConverterDialogs/ConverterCSVDialogModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,6 +9,11 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
     public class ConverterCSVDialogModel : ConverterDialogsModel
     {
+        public CPDFConvertCsvOptions csvOptions=new CPDFConvertCsvOptions();
 
+        public CPDFConvertCsvOptions CSVOptions() {
+            csvOptions.IsMergeCSV = Options.IsMergeCsv;
+            return csvOptions;
+        }
     }
 }

+ 24 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs

@@ -4,9 +4,26 @@ using ComPDFKit_Conversion.Converter;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using ComDocumentAIKit;
+using ComPDFKit_Conversion.Options;
 
 namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
+    public class ConvertOptions
+    {
+        public COCRLanguage OCRLanguage = COCRLanguage.English;
+        public bool IsAllowOCR = false;
+        public bool IsContainOCRBgImage =false;
+        public bool IsContainAnnotations = true;
+        public bool IsContainImages = true;
+        public ContentOptions ContentOpts = ContentOptions.AllContent;
+        public WorksheetOptions WorksheetOpts = WorksheetOptions.ForEachPage;
+        public PageAndNavigationPaneOptions PageAndNavigationPaneOpts = PageAndNavigationPaneOptions.SinglePageNavigationByBookmarks;
+        public ImgType ImageType = ImgType.PNG;
+        public uint ImageDpi = 50;
+        public bool IsMergeCsv = false;
+    }
+
     public class ConverterDialogsModel
     {
 
@@ -41,5 +58,12 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
         /// </summary>
         public string Pawssword="";
 
+
+        /// <summary>
+        /// OCR,与部分功能;
+        /// </summary>
+        public ConvertOptions Options=new ConvertOptions();
+
     }
+
 }

+ 17 - 6
PDF Office/Model/Dialog/ConverterDialogs/ConverterExcelDialogModel.cs

@@ -10,13 +10,24 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
     public class ConverterExcelDialogModel : ConverterDialogsModel
     {
-        public CPDFConvertExcelOptions excelOption=new CPDFConvertExcelOptions();
+        public CPDFConvertExcelOptions excelOptions=new CPDFConvertExcelOptions();
 
-        public CPDFConvertExcelOptions ExcelOptions(WorksheetOptions worksheetOptions = WorksheetOptions.ForEachPage,ContentOptions contentOptions = ContentOptions.AllContent) {
-
-            excelOption.ContentOpts= contentOptions;
-            excelOption.WorksheetOpts= worksheetOptions;
-            return excelOption;
+        public CPDFConvertExcelOptions ExcelOptions() {
+            excelOptions.OCRLanguage = Options.OCRLanguage;
+            excelOptions.IsAllowOCR = Options.IsAllowOCR;
+            excelOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            excelOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            excelOptions.IsContainImages = Options.IsContainImages;
+            excelOptions.ContentOpts = Options.ContentOpts;
+            excelOptions.WorksheetOpts = Options.WorksheetOpts;
+            return excelOptions;
         }
+
+        //public CPDFConvertExcelOptions ExcelOptions(WorksheetOptions worksheetOptions = WorksheetOptions.ForEachPage,ContentOptions contentOptions = ContentOptions.AllContent) {
+
+        //    excelOption.ContentOpts= contentOptions;
+        //    excelOption.WorksheetOpts= worksheetOptions;
+        //    return excelOption;
+        //}
     }
 }

+ 16 - 5
PDF Office/Model/Dialog/ConverterDialogs/ConverterHTMLDialogModel.cs

@@ -9,13 +9,24 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
     public class ConverterHTMLDialogModel : ConverterDialogsModel
     {
-        public CPDFConvertHTMLOptions htmlOption = new CPDFConvertHTMLOptions();
+        public CPDFConvertHTMLOptions htmlOptions = new CPDFConvertHTMLOptions();
 
-        public CPDFConvertHTMLOptions HTMLOptions(PageAndNavigationPaneOptions pageAndNavigationPaneOptions = PageAndNavigationPaneOptions.MultiplePages)
+        public CPDFConvertHTMLOptions HTMLOptions()
         {
-
-            htmlOption.PageAndNavigationPaneOpts = pageAndNavigationPaneOptions;
-            return htmlOption;
+            htmlOptions.OCRLanguage = Options.OCRLanguage;
+            htmlOptions.IsAllowOCR = Options.IsAllowOCR;
+            htmlOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            htmlOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            htmlOptions.IsContainImages = Options.IsContainImages;
+            htmlOptions.PageAndNavigationPaneOpts = Options.PageAndNavigationPaneOpts;
+            return htmlOptions;
         }
+
+        //public CPDFConvertHTMLOptions HTMLOptions(PageAndNavigationPaneOptions pageAndNavigationPaneOptions = PageAndNavigationPaneOptions.MultiplePages)
+        //{
+
+        //    htmlOption.PageAndNavigationPaneOpts = pageAndNavigationPaneOptions;
+        //    return htmlOption;
+        //}
     }
 }

+ 14 - 2
PDF Office/Model/Dialog/ConverterDialogs/ConverterImgDialogModel.cs

@@ -4,13 +4,25 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using ComPDFKit_Conversion.Options;
 
 namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
+
     public class ConverterImgDialogModel : ConverterDialogsModel
     {
-        public ImgType Type =ImgType.PNG;
-        public string DPI = "50";
+        public CPDFConvertImgOptions imgOptions = new CPDFConvertImgOptions();
+
+        public CPDFConvertImgOptions ImgOptions()
+        {
+            imgOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            imgOptions.ImageType = Options.ImageType;
+            imgOptions.ImageDpi = Options.ImageDpi;
+            return imgOptions;
+        }
+
+        //public ImgType Type = ImgType.PNG;
+        //public string DPI = "50";
         public string imageType = ".jpeg";
     }
 }

+ 12 - 1
PDF Office/Model/Dialog/ConverterDialogs/ConverterPPTDialogModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,15 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
     public class ConverterPPTDialogModel : ConverterDialogsModel
     {
+        public CPDFConvertPPTOptions pPTOptions= new CPDFConvertPPTOptions();
+
+        public CPDFConvertPPTOptions PPTOptions() {
+            pPTOptions.OCRLanguage = Options.OCRLanguage;
+            pPTOptions.IsAllowOCR = Options.IsAllowOCR;
+            pPTOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            pPTOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            pPTOptions.IsContainImages = Options.IsContainImages;
+            return pPTOptions;
+        }
     }
 }

+ 13 - 1
PDF Office/Model/Dialog/ConverterDialogs/ConverterRTFDialogModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,16 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
     public class ConverterRTFDialogModel : ConverterDialogsModel
     {
+        public CPDFConvertRTFOptions rTFOptions = new CPDFConvertRTFOptions();
+
+        public CPDFConvertRTFOptions RTFOptions()
+        {
+            rTFOptions.OCRLanguage = Options.OCRLanguage;
+            rTFOptions.IsAllowOCR = Options.IsAllowOCR;
+            rTFOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            rTFOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            rTFOptions.IsContainImages = Options.IsContainImages;
+            return rTFOptions;
+        }
     }
 }

+ 9 - 1
PDF Office/Model/Dialog/ConverterDialogs/ConverterTextDialogModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,12 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
     public class ConverterTextDialogModel : ConverterDialogsModel
     {
+        public CPDFConvertTxtOptions txtOptions = new CPDFConvertTxtOptions();
+
+        public CPDFConvertTxtOptions TxtOptions() {
+            txtOptions.OCRLanguage = Options.OCRLanguage;
+            txtOptions.IsAllowOCR = Options.IsAllowOCR;
+            return txtOptions;
+        }
     }
 }

+ 13 - 1
PDF Office/Model/Dialog/ConverterDialogs/ConverterWordDialogModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,16 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
     public class ConverterWordDialogModel : ConverterDialogsModel
     {
+        public CPDFConvertWordOptions wordOptions = new CPDFConvertWordOptions();
+
+        public CPDFConvertWordOptions WordOptions()
+        {
+            wordOptions.OCRLanguage = Options.OCRLanguage;
+            wordOptions.IsAllowOCR = Options.IsAllowOCR;
+            wordOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            wordOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            wordOptions.IsContainImages = Options.IsContainImages;
+            return wordOptions;
+        }
     }
 }

+ 9 - 1
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,12 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
 {
     public class HomePageConverterCSVModel: HomePageConverterDialogModel
     {
+        public CPDFConvertCsvOptions csvOptions = new CPDFConvertCsvOptions();
+
+        public CPDFConvertCsvOptions CSVOptions()
+        {
+            csvOptions.IsMergeCSV = Options.IsMergeCsv;
+            return csvOptions;
+        }
     }
 }

+ 23 - 1
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogModel.cs

@@ -1,4 +1,6 @@
-using ComPDFKit_Conversion.Converter;
+using ComDocumentAIKit;
+using ComPDFKit_Conversion.Converter;
+using ComPDFKit_Conversion.Options;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -7,6 +9,21 @@ using System.Threading.Tasks;
 
 namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
 {
+    public class ConvertOptions
+    {
+        public COCRLanguage OCRLanguage = COCRLanguage.English;
+        public bool IsAllowOCR = false;
+        public bool IsContainOCRBgImage = false;
+        public bool IsContainAnnotations = true;
+        public bool IsContainImages = true;
+        public ContentOptions ContentOpts = ContentOptions.AllContent;
+        public WorksheetOptions WorksheetOpts = WorksheetOptions.ForEachPage;
+        public PageAndNavigationPaneOptions PageAndNavigationPaneOpts = PageAndNavigationPaneOptions.SinglePageNavigationByBookmarks;
+        public ImgType ImageType = ImgType.PNG;
+        public uint ImageDpi = 200;
+        public bool IsMergeCsv = false;
+    }
+
     public class HomePageConverterDialogModel
     {
         public static List<string> GetConverter = new List<string> { "HomePageConverterWord","HomePageConverterExcel","HomePageConverterPPT","HomePageConverterRTF","HomePageConverterHTML"
@@ -41,5 +58,10 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
         /// 文档密码;
         /// </summary>
         public string Pawssword = "";
+
+        /// <summary>
+        /// OCR,与部分功能;
+        /// </summary>
+        public ConvertOptions Options = new ConvertOptions();
     }
 }

+ 10 - 6
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelModel.cs

@@ -9,14 +9,18 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
 {
     public class HomePageConverterExcelModel: HomePageConverterDialogModel
     {
-        public CPDFConvertExcelOptions excelOption = new CPDFConvertExcelOptions();
+        public CPDFConvertExcelOptions excelOptions = new CPDFConvertExcelOptions();
 
-        public CPDFConvertExcelOptions ExcelOptions(WorksheetOptions worksheetOptions = WorksheetOptions.ForEachPage, ContentOptions contentOptions = ContentOptions.AllContent)
+        public CPDFConvertExcelOptions ExcelOptions()
         {
-
-            excelOption.ContentOpts = contentOptions;
-            excelOption.WorksheetOpts = worksheetOptions;
-            return excelOption;
+            excelOptions.OCRLanguage = Options.OCRLanguage;
+            excelOptions.IsAllowOCR = Options.IsAllowOCR;
+            excelOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            excelOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            excelOptions.IsContainImages = Options.IsContainImages;
+            excelOptions.ContentOpts = Options.ContentOpts;
+            excelOptions.WorksheetOpts = Options.WorksheetOpts;
+            return excelOptions;
         }
     }
 }

+ 9 - 5
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterHTMLModel.cs

@@ -9,13 +9,17 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
 {
     public class HomePageConverterHTMLModel : HomePageConverterDialogModel
     {
-        public CPDFConvertHTMLOptions htmlOption = new CPDFConvertHTMLOptions();
+        public CPDFConvertHTMLOptions htmlOptions = new CPDFConvertHTMLOptions();
 
-        public CPDFConvertHTMLOptions HTMLOptions(PageAndNavigationPaneOptions pageAndNavigationPaneOptions = PageAndNavigationPaneOptions.MultiplePages)
+        public CPDFConvertHTMLOptions HTMLOptions()
         {
-
-            htmlOption.PageAndNavigationPaneOpts = pageAndNavigationPaneOptions;
-            return htmlOption;
+            htmlOptions.OCRLanguage = Options.OCRLanguage;
+            htmlOptions.IsAllowOCR = Options.IsAllowOCR;
+            htmlOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            htmlOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            htmlOptions.IsContainImages = Options.IsContainImages;
+            htmlOptions.PageAndNavigationPaneOpts = Options.PageAndNavigationPaneOpts;
+            return htmlOptions;
         }
     }
 }

+ 11 - 2
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgModel.cs

@@ -1,4 +1,5 @@
 using ComPDFKit_Conversion.Converter;
+using ComPDFKit_Conversion.Options;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -9,8 +10,16 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
 {
     public class HomePageConverterImgModel : HomePageConverterDialogModel
     {
-        public ImgType Type = ImgType.JPEG;
+        public CPDFConvertImgOptions imgOptions = new CPDFConvertImgOptions();
+
+        public CPDFConvertImgOptions ImgOptions()
+        {
+            imgOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            imgOptions.ImageType = Options.ImageType;
+            imgOptions.ImageDpi = Options.ImageDpi;
+            return imgOptions;
+        }
+
         public string imageType = ".jpeg";
-        public string DPI = "50";
     }
 }

+ 13 - 1
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterPPTModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,16 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
 {
     public class HomePageConverterPPTModel : HomePageConverterDialogModel
     {
+        public CPDFConvertPPTOptions pPTOptions = new CPDFConvertPPTOptions();
+
+        public CPDFConvertPPTOptions PPTOptions()
+        {
+            pPTOptions.OCRLanguage = Options.OCRLanguage;
+            pPTOptions.IsAllowOCR = Options.IsAllowOCR;
+            pPTOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            pPTOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            pPTOptions.IsContainImages = Options.IsContainImages;
+            return pPTOptions;
+        }
     }
 }

+ 13 - 1
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterRTFModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,16 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
 {
     public class HomePageConverterRTFModel : HomePageConverterDialogModel
     {
+        public CPDFConvertRTFOptions rTFOptions = new CPDFConvertRTFOptions();
+
+        public CPDFConvertRTFOptions RTFOptions()
+        {
+            rTFOptions.OCRLanguage = Options.OCRLanguage;
+            rTFOptions.IsAllowOCR = Options.IsAllowOCR;
+            rTFOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            rTFOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            rTFOptions.IsContainImages = Options.IsContainImages;
+            return rTFOptions;
+        }
     }
 }

+ 10 - 1
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterTextModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,13 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
 {
     public class HomePageConverterTextModel : HomePageConverterDialogModel
     {
+        public CPDFConvertTxtOptions txtOptions = new CPDFConvertTxtOptions();
+
+        public CPDFConvertTxtOptions TxtOptions()
+        {
+            txtOptions.OCRLanguage = Options.OCRLanguage;
+            txtOptions.IsAllowOCR = Options.IsAllowOCR;
+            return txtOptions;
+        }
     }
 }

+ 13 - 1
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit_Conversion.Options;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,5 +9,16 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
 {
     public class HomePageConverterWordModel : HomePageConverterDialogModel
     {
+        public CPDFConvertWordOptions wordOptions = new CPDFConvertWordOptions();
+
+        public CPDFConvertWordOptions WordOptions()
+        {
+            wordOptions.OCRLanguage = Options.OCRLanguage;
+            wordOptions.IsAllowOCR = Options.IsAllowOCR;
+            wordOptions.IsContainOCRBgImage = Options.IsContainOCRBgImage;
+            wordOptions.IsContainAnnotations = Options.IsContainAnnotations;
+            wordOptions.IsContainImages = Options.IsContainImages;
+            return wordOptions;
+        }
     }
 }

+ 21 - 18
PDF Office/PDF Office.csproj

@@ -1964,33 +1964,33 @@
     <Content Include="source\AnalysisWord\Res\word\_rels\document.xml.rels">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
-    <None Include="x64\models\DA_image_enhance_magic_color_1.0.0.model">
+    <Content Include="x64\models\DA_image_enhance_magic_color_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="x64\models\DA_Ocr_Classification_1.0.0.model">
+    </Content>
+    <Content Include="x64\models\DA_Ocr_Classification_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="x64\models\DA_Ocr_Detection_chinese_1.0.0.model">
+    </Content>
+    <Content Include="x64\models\DA_Ocr_Detection_chinese_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="x64\models\DA_Ocr_Detection_english_1.0.0.model">
+    </Content>
+    <Content Include="x64\models\DA_Ocr_Detection_english_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="x64\models\DA_Ocr_Recognition_chinese_1.0.0.model">
+    </Content>
+    <Content Include="x64\models\DA_Ocr_Recognition_chinese_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="x64\models\DA_Ocr_Recognition_chinese_cht_1.0.0.model">
+    </Content>
+    <Content Include="x64\models\DA_Ocr_Recognition_chinese_cht_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="x64\models\DA_Ocr_Recognition_english_1.0.0.model">
+    </Content>
+    <Content Include="x64\models\DA_Ocr_Recognition_english_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="x64\models\DA_Ocr_Recognition_japan_1.0.0.model">
+    </Content>
+    <Content Include="x64\models\DA_Ocr_Recognition_japan_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="x64\models\DA_Ocr_Recognition_korean_1.0.0.model">
+    </Content>
+    <Content Include="x64\models\DA_Ocr_Recognition_korean_1.0.0.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
+    </Content>
     <Resource Include="Resources\BOTA\Annotation\Arrow.png" />
     <Resource Include="Resources\BOTA\Annotation\Bookmark.png" />
     <Resource Include="Resources\BOTA\Annotation\Circle.png" />
@@ -2252,6 +2252,9 @@
     <Content Include="x64\DocumentAILib\opencv_world420.dll">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <Content Include="x64\DocumentAILib\opencv_world420d.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
     <Content Include="x64\DocumentAILib\paddle2onnx.dll">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

+ 19 - 9
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -96,7 +96,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             RadioButtonCommand = new DelegateCommand<string>(radiobutton);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
-            ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions();
+            ConverterExcelModel.excelOptions = ConverterExcelModel.ExcelOptions();
             dialogs = dialogService;
         }
         #region 逻辑函数
@@ -132,8 +132,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 MessageBoxEx.Show("输入不对");
                 return;
             }
-            if (ConverterExcelModel.excelOption == null) {
-                ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions();
+            if (ConverterExcelModel.excelOptions == null) {
+                ConverterExcelModel.excelOptions = ConverterExcelModel.ExcelOptions();
             }
 
             DialogParameters value = new DialogParameters();
@@ -246,7 +246,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                         OnlyTable(OnlyTableSelectIndex);
                         break;
                     case "OnlyTextRadioBtn":
-                        ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument, ContentOptions.OnlyText);
+                        ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForTheDocument;
+                        ConverterExcelModel.Options.ContentOpts = ContentOptions.OnlyText;
+                        ConverterExcelModel.excelOptions = ConverterExcelModel.ExcelOptions();
                         break;
                     default:
                         break;
@@ -260,10 +262,14 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             switch (SelectedIndex)
             {
                 case 0:
-                    ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions();
+                    ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForEachPage;
+                    ConverterExcelModel.Options.ContentOpts = ContentOptions.AllContent;
+                    ConverterExcelModel.excelOptions = ConverterExcelModel.ExcelOptions();
                     break;
                 case 1:
-                    ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument);
+                    ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForTheDocument;
+                    ConverterExcelModel.Options.ContentOpts = ContentOptions.AllContent;
+                    ConverterExcelModel.excelOptions = ConverterExcelModel.ExcelOptions();
                     break;
                 default:
                     break;
@@ -273,16 +279,20 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void OnlyTable(int SelectedIndex)
         {
+            ConverterExcelModel.Options.ContentOpts = ContentOptions.OnlyTable;
             switch (SelectedIndex)
             {
                 case 0:
-                    ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachTable, ContentOptions.OnlyTable);
+                    ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForEachTable;
+                    ConverterExcelModel.excelOptions = ConverterExcelModel.ExcelOptions();
                     break;
                 case 1:
-                    ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachPage, ContentOptions.OnlyTable);
+                    ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForEachPage;
+                    ConverterExcelModel.excelOptions = ConverterExcelModel.ExcelOptions();
                     break;
                 case 2:
-                    ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument, ContentOptions.OnlyTable);
+                    ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForTheDocument;
+                    ConverterExcelModel.excelOptions = ConverterExcelModel.ExcelOptions();
                     break;
                 default:
                     break;

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs

@@ -104,7 +104,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 MessageBoxEx.Show("输入不对");
                 return;
             }
-            ConverterHTMLModel.htmlOption=ConverterHTMLModel.HTMLOptions();
+            ConverterHTMLModel.htmlOptions=ConverterHTMLModel.HTMLOptions();
             //result = await ConverterHelper.TxtConvert(ConverterTextModel.InputPath, ConverterTextModel.OutputPath, ConverterTextModel.GetProgress, ConverterTextModel.PageIndexLists, ConverterTextModel.Pawssword);
             DialogParameters value = new DialogParameters();
             value.Add(ParameterNames.ConverterType, "HTML");

+ 12 - 4
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs

@@ -1,4 +1,5 @@
 using ComPDFKit_Conversion.Converter;
+using ComPDFKit_Conversion.Options;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
 using PDF_Office.Helper;
@@ -13,6 +14,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Net.NetworkInformation;
 using System.Windows.Forms;
 using DialogResult = Prism.Services.Dialogs.DialogResult;
 
@@ -138,10 +140,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         /// <param name="index"></param>
         private void UpdateImageType(int index)
         {
-            this.ConverterImgModel.Type = ImgType.PNG;
+            this.ConverterImgModel.Options.ImageType = ImgType.PNG;
             switch (index)
             {
-                //case结果是同样的情况下,case可堆叠在一起,表示处理方式一样
                 case 0:
                     this.ConverterImgModel.imageType = ".jpeg";
                     break;
@@ -165,7 +166,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     break;
                 case 1:
                     this.ConverterImgModel.imageType = ".jpg";
-                    this.ConverterImgModel.Type = ImgType.JPEG;
+                    this.ConverterImgModel.Options.ImageType = ImgType.JPEG;
                     break;
                 default:
                     break;
@@ -177,21 +178,27 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             switch (index)
             {
                 case 0:
+                    this.ConverterImgModel.Options.ImageDpi = 50;
                     Trace.WriteLine("50");
                     break;
                 case 1:
+                    this.ConverterImgModel.Options.ImageDpi = 72;
                     Trace.WriteLine("72");
                     break;
                 case 2:
+                    this.ConverterImgModel.Options.ImageDpi = 96;
                     Trace.WriteLine("96");
                     break;
                 case 3:
+                    this.ConverterImgModel.Options.ImageDpi = 150;
                     Trace.WriteLine("150");
                     break;
                 case 4:
+                    this.ConverterImgModel.Options.ImageDpi = 300;
                     Trace.WriteLine("300");
                     break;
                 case 5:
+                    this.ConverterImgModel.Options.ImageDpi = 600;
                     Trace.WriteLine("600");
                     break;
                 default:
@@ -232,7 +239,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 MessageBoxEx.Show("输入不对");
                 return;
             }
-            DialogParameters value = new DialogParameters();
+            ConverterImgModel.imgOptions = ConverterImgModel.ImgOptions();
+             DialogParameters value = new DialogParameters();
             value.Add(ParameterNames.ConverterType, "Img");
             value.Add(ParameterNames.ConverterTypeModel, ConverterImgModel);
             RequestClose?.Invoke(new DialogResult(ButtonResult.OK));

+ 3 - 3
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs

@@ -109,7 +109,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                         {
                             ConverterExcelModel.PageIndexLists[i] = ConverterExcelModel.PageIndexLists[i] + 1;
                         }
-                        result = await ConverterHelper.ExcelConvert(ConverterExcelModel.InputPath, ConverterExcelModel.OutputPath, GetProgress, ConverterExcelModel.PageIndexLists, ConverterExcelModel.Pawssword, ConverterExcelModel.excelOption);
+                        result = await ConverterHelper.ExcelConvert(ConverterExcelModel.InputPath, ConverterExcelModel.OutputPath, GetProgress, ConverterExcelModel.PageIndexLists, ConverterExcelModel.Pawssword, ConverterExcelModel.excelOptions);
                     }
                     break;
                 case "HTML":
@@ -122,7 +122,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                         {
                             ConverterHTMLModel.PageIndexLists[i] = ConverterHTMLModel.PageIndexLists[i] + 1;
                         }
-                        result = await ConverterHelper.HTMLConvert(ConverterHTMLModel.InputPath, ConverterHTMLModel.OutputPath, GetProgress, ConverterHTMLModel.PageIndexLists, ConverterHTMLModel.Pawssword, ConverterHTMLModel.htmlOption);
+                        result = await ConverterHelper.HTMLConvert(ConverterHTMLModel.InputPath, ConverterHTMLModel.OutputPath, GetProgress, ConverterHTMLModel.PageIndexLists, ConverterHTMLModel.Pawssword, ConverterHTMLModel.htmlOptions);
                     }
                     break;
                 case "Img":
@@ -134,7 +134,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                         for (int i=0; ConverterImgModel.PageIndexLists.Count>i;i++) {
                             ConverterImgModel.PageIndexLists[i] = ConverterImgModel.PageIndexLists[i] + 1;
                         }
-                        result = await ConverterHelper.ImgConvert(ConverterImgModel.InputPath, ConverterImgModel.OutputPath, GetProgress, ConverterImgModel.PageIndexLists, ConverterImgModel.Pawssword, ConverterImgModel.Type,ConverterImgModel.imageType);
+                        result = await ConverterHelper.ImgConvert(ConverterImgModel.InputPath, ConverterImgModel.OutputPath, GetProgress, ConverterImgModel.PageIndexLists, ConverterImgModel.Pawssword, ConverterImgModel.imageType);
                     }
                     break;
                 case "PPT":

+ 2 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs

@@ -297,7 +297,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                         if (ConverterExcelModel != null)
                         {
                             PageNumber = ConverterExcelModel.PageIndexLists.Count().ToString();
-                            result = await ConverterHelper.ExcelConvert(filename, OutputPath, GetProgress, PageIndexLists, DocPassword, ConverterExcelModel.excelOption);
+                            result = await ConverterHelper.ExcelConvert(filename, OutputPath, GetProgress, PageIndexLists, DocPassword, ConverterExcelModel.excelOptions);
                         }
                         break;
                     case 2:
@@ -344,7 +344,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                         if (ConverterImgModel != null)
                         {
                             PageNumber = ConverterImgModel.PageIndexLists.Count().ToString();
-                            result = await ConverterHelper.ImgConvert(filename, OutputPath, GetProgress, PageIndexLists, DocPassword, ConverterImgModel.Type, ConverterImgModel.imageType);
+                            result = await ConverterHelper.ImgConvert(filename, OutputPath, GetProgress, PageIndexLists, DocPassword, ConverterImgModel.imageType);
                         }
                         break;
                     default:

+ 17 - 9
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelViewModel.cs

@@ -15,8 +15,6 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
     public class HomePageConverterExcelViewModel : BindableBase, INavigationAware
     {
         #region 参数和属性
-        public ConverterExcelDialogModel ConverterExcelModel = new ConverterExcelDialogModel();
-
         public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
 
         private int _anyContentSelectIndex;
@@ -67,7 +65,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                         OnlyTable(OnlyTableSelectIndex);
                         break;
                     case "OnlyTextRadioBtn":
-                        ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument, ContentOptions.OnlyText);
+                        homePageConverterDialogViewModel.ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForTheDocument;
+                        homePageConverterDialogViewModel.ConverterExcelModel.Options.ContentOpts = ContentOptions.OnlyText;
+                        homePageConverterDialogViewModel.ConverterExcelModel.excelOptions = homePageConverterDialogViewModel.ConverterExcelModel.ExcelOptions();
                         break;
                     default:
                         break;
@@ -80,10 +80,14 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             switch (SelectedIndex)
             {
                 case 0:
-                    homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions();
+                    homePageConverterDialogViewModel.ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForEachPage;
+                    homePageConverterDialogViewModel.ConverterExcelModel.Options.ContentOpts = ContentOptions.AllContent;
+                    homePageConverterDialogViewModel.ConverterExcelModel.excelOptions = homePageConverterDialogViewModel.ConverterExcelModel.ExcelOptions();
                     break;
                 case 1:
-                    homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument);
+                    homePageConverterDialogViewModel.ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForTheDocument;
+                    homePageConverterDialogViewModel.ConverterExcelModel.Options.ContentOpts = ContentOptions.AllContent;
+                    homePageConverterDialogViewModel.ConverterExcelModel.excelOptions = homePageConverterDialogViewModel.ConverterExcelModel.ExcelOptions();
                     break;
                 default:
                     break;
@@ -93,16 +97,20 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
         private void OnlyTable(int SelectedIndex)
         {
+            homePageConverterDialogViewModel.ConverterExcelModel.Options.ContentOpts = ContentOptions.OnlyTable;
             switch (SelectedIndex)
             {
                 case 0:
-                    homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachTable, ContentOptions.OnlyTable);
+                    homePageConverterDialogViewModel.ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForEachTable;
+                    homePageConverterDialogViewModel.ConverterExcelModel.excelOptions = homePageConverterDialogViewModel.ConverterExcelModel.ExcelOptions();
                     break;
                 case 1:
-                    homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachPage, ContentOptions.OnlyTable);
+                    homePageConverterDialogViewModel.ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForEachPage;
+                    homePageConverterDialogViewModel.ConverterExcelModel.excelOptions = homePageConverterDialogViewModel.ConverterExcelModel.ExcelOptions();
                     break;
                 case 2:
-                   homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument, ContentOptions.OnlyTable);
+                    homePageConverterDialogViewModel.ConverterExcelModel.Options.WorksheetOpts = WorksheetOptions.ForEachPage;
+                    homePageConverterDialogViewModel.ConverterExcelModel.excelOptions = homePageConverterDialogViewModel.ConverterExcelModel.ExcelOptions();
                     break;
                 default:
                     break;
@@ -119,7 +127,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 homePageConverterDialogViewModel = homePageConverterVM;
                 OnlyTableSelectIndex = 0;
                 AnyContentSelectIndex = 0;
-                homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions();
+                homePageConverterDialogViewModel.ConverterExcelModel.excelOptions = homePageConverterDialogViewModel.ConverterExcelModel.ExcelOptions();
                 
             }
         }

+ 29 - 3
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgViewModel.cs

@@ -1,4 +1,5 @@
 using ComPDFKit_Conversion.Converter;
+using ComPDFKit_Conversion.Options;
 using PDF_Office.Model;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -45,10 +46,35 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             SetImageTypeOrigin();
             SetImageDPIOrigin();
         }
+        public void UpdateImageDpi(int index) {
 
-        public void UpdateImageType(int index)
+            switch (index)
+            {
+                case 0:
+                    this.homePageConverterDialogViewModel.ConverterImgModel.Options.ImageDpi =50;
+                    break;
+                case 1:
+                    this.homePageConverterDialogViewModel.ConverterImgModel.Options.ImageDpi = 72;
+                    break;
+                case 2:
+                    this.homePageConverterDialogViewModel.ConverterImgModel.Options.ImageDpi = 96;
+                    break;
+                case 3:
+                    this.homePageConverterDialogViewModel.ConverterImgModel.Options.ImageDpi = 150;
+                    break;
+                case 4:
+                    this.homePageConverterDialogViewModel.ConverterImgModel.Options.ImageDpi = 300;
+                    break;
+                case 5:
+                    this.homePageConverterDialogViewModel.ConverterImgModel.Options.ImageDpi = 600;
+                    break;
+                default:
+                    break;
+            }
+        }
+            public void UpdateImageType(int index)
         {
-            this.homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.PNG;
+            this.homePageConverterDialogViewModel.ConverterImgModel.Options.ImageType = ImgType.PNG;
             switch (index)
             {
                 //case结果是同样的情况下,case可堆叠在一起,表示处理方式一样
@@ -75,7 +101,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                     break;
                 case 1:
                     this.homePageConverterDialogViewModel.ConverterImgModel.imageType = ".jpg";
-                    this.homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
+                    this.homePageConverterDialogViewModel.ConverterImgModel.Options.ImageType = ImgType.JPEG;
                     break;
                 default:
                     break;

+ 1 - 1
PDF Office/ViewModels/Tools/ScanContentViewModel.cs

@@ -122,7 +122,7 @@ namespace PDF_Office.ViewModels.Tools
             CPDFDocument CurrentDoc = PDFViewer.Document;
             //CurrentDoc.FilePath;
 
-            CErrorCode error = imEngine.SetModel(COCRLanguage.Chinese_S);
+            CErrorCode error = imEngine.SetModel(COCRLanguage.Chinese);
             //CErrorCode error = imEngine.SetModel();
             for (int i = 0; i < 1; i++)
             {

二進制
PDF Office/x64/CPDFConverterNative.dll


二進制
PDF Office/x64/DocumentAILib/opencv_world420d.dll


二進制
PDF Office/x64/models/DA_Ocr_Classification_1.0.0.model


二進制
PDF Office/x64/models/DA_Ocr_Detection_chinese_1.0.0.model


二進制
PDF Office/x64/models/DA_Ocr_Detection_english_1.0.0.model


二進制
PDF Office/x64/models/DA_Ocr_Recognition_chinese_1.0.0.model


二進制
PDF Office/x64/models/DA_Ocr_Recognition_chinese_cht_1.0.0.model


二進制
PDF Office/x64/models/DA_Ocr_Recognition_english_1.0.0.model


二進制
PDF Office/x64/models/DA_Ocr_Recognition_japan_1.0.0.model


二進制
PDF Office/x64/models/DA_Ocr_Recognition_korean_1.0.0.model


二進制
PDF Office/x86/CPDFConverterNative.dll