Browse Source

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

ZhouJieSheng 2 years ago
parent
commit
a968133e07
26 changed files with 364 additions and 34 deletions
  1. BIN
      PDF Office/ComPDFKit.Viewer.dll
  2. 3 3
      PDF Office/SDKLisence.xml
  3. 81 20
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  4. 3 0
      PDF Office/ViewModels/BOTA/BOTAContentViewModel.cs
  5. 15 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs
  6. 17 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  7. 15 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  8. 16 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs
  9. 16 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  10. 15 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  11. 15 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  12. 15 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  13. 1 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs
  14. 17 0
      PDF Office/ViewModels/Dialog/ToolsDialogs/CompressDialogs/CompressDialogViewModel.cs
  15. 1 1
      PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs
  16. 85 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  17. 5 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml
  18. 6 1
      PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml
  19. 5 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml
  20. 5 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml
  21. 5 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml
  22. 5 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml
  23. 5 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml
  24. 5 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml
  25. 7 7
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml
  26. 1 1
      PDF Office/Views/Dialog/ToolsDialogs/CompressDialogs/CompressDialog.xaml

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 3 - 3
PDF Office/SDKLisence.xml

@@ -1,7 +1,7 @@
 <Lisences
-	devKey = "BK8BcXWm+YbGRpEONe43pEJXhshAiAwWoBQgwlEUnxFBkCVal4AYW01RnbuwHCdkktvy9sAYs/SUflLR+KOMayg6z2TE2G3OhIXf95sN8k1sk947zrPGeHPtHx7gMaurYrscLDAumvtymhg4rMTg7XFKfBtchlAi0bE+wPTsqa8="
-  devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYSXB8erGstkUyaynN7k8ocNCYAAzc9CPxiym2TlqeSUWpLOaOv47bs7x+UqfQzn9hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSnRAJhqHxGgIZ+m3BxAFwgabp2OdkT7I9klGmA/4KertEmsKlSJ3WFqmDWhwfT73yCYDNQpuarUAQxiS1PJu8kUw=="
-  userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs="
+	devKey = "sTHSivIW4YnZQavIYDLVw4vaFcN5DQTUtRGrVyv5p9aeaHX3GirG/MBxl6Wy9TJbNOwR4CU6LPjHmGe3Po3OtBCPqIRheam9+LomScw3AvoUTHFlG1134e2J4enF43WJQ6PyOnjwZqsG1kUdlBPNztkoPzDAE2pQKgZWf6V2i34="
+    devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6cfaiHpW8pgW2aur3AxuQIBBLuJD5gcmNxTYW3KA32JLG8alfyXjKFVS3gka9bngvwfZ7GuNXybjKlmz1tnN6iVHpnbSj+xOHhWEperY4HHrSg=="
+	userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs="
 	userSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4ivEHOmPIqbfhpDnKKj+7Ymj2rXQvfZRmke06HMV+3tt064G64WjPW8+EbGCNZaAh1hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1FKJi6HYB+DuugQyaqI2prfej861QnJrU4s2T/npZK/"
 	ConverterDevKey="ErjZKxcU3SPvUohGZo0CBgy0XdkAsZqUYqCTbfn1AYsCQ6mxCucx61UPqLT7MDQ0n+5/oKnWY9SSk8Xv5pJtYYHD87HRdYNG+QNCaoPGHulyfVxGllmzU71U7WjflfZBFvhg/UQOFiz3OsAVKz4k2YkXPzQgNaS3glym42PVpj4="
 	ConverterDevSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYfqdItiFUaR9LVjsPTUXicGXjRTJz0NHg67bO82qMNdkuY0NReKpg+S1SkS2QdEScM/fgvvcctF5rcqYAH1dpMv7C2jvq4o0q6sQtN3jR47j9bjclgv4TJTahQMmvDDLtOGD99YkYWB6rt/zU8htEYkwcNWVMyYvggPV2rTFvfawopGIC034QzjthmhwwX90="

+ 81 - 20
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -6,6 +6,7 @@ using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using DryIoc;
+using ImTools;
 using Microsoft.Office.Interop.Excel;
 using Microsoft.Office.Interop.PowerPoint;
 using Microsoft.Office.Interop.Word;
@@ -33,6 +34,7 @@ using System.Windows;
 using System.Windows.Annotations.Storage;
 using System.Windows.Controls;
 using System.Windows.Data;
+using System.Windows.Documents;
 using System.Windows.Forms;
 using System.Windows.Markup;
 using System.Windows.Media;
@@ -760,6 +762,57 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        public async void UpdateAddedAnnot(int pageIndex, int annotIndex)
+        {
+            var annots = PdfViewer.GetAnnotCommentList(pageIndex, PdfViewer.Document);
+            foreach (var item in annots)
+            {
+                if (item.AnnotIndex == annotIndex && item.EventType != AnnotArgsType.AnnotRedaction)
+                {
+                    AnnotationHandlerEventArgs args = GetAddAnnotEventArgs(item);
+                    if (args.AnnotHandlerEventArgs != null)
+                    {
+                        AnnotationListItems.Add(args);
+                        await Task.Delay(1);//不加延时 每页的第一个注释不会展开
+                        ExpandGroupHeader(args, listBox);
+                        listBox.SelectedItem = item;
+                        await Task.Delay(1);//不加延时 会有不滚动的现象
+                        listBox.ScrollIntoView(item);
+                    }
+                }
+            }
+            if (IsEmptyPanelVisibility == Visibility.Visible && AnnotationListItems.Count > 0)
+            {
+                IsEmptyPanelVisibility = Visibility.Collapsed;
+            }
+        }
+
+        /// <summary>
+        /// 展开item所在分组
+        /// </summary>
+        private void ExpandGroupHeader(AnnotationHandlerEventArgs item, ListBox listBox)
+        {
+            try
+            {
+                var groups = listBox.Items.Groups;
+                for (int i = 0; i < groups.Count; i++)
+                {
+                    var l = groups[i] as CollectionViewGroup;
+                    if (l.Items.Contains(item))
+                    {
+                        var scroller = GetScrollHost(listBox);
+                        var stackpanel = CommonHelper.FindVisualChild<StackPanel>(scroller);
+                        int count = VisualTreeHelper.GetChildrenCount(stackpanel);
+                        var groupItem = VisualTreeHelper.GetChild(stackpanel, i) as GroupItem;
+                        var g = CommonHelper.FindVisualChild<Expander>(groupItem);
+                        if (g != null)
+                            g.IsExpanded = true;
+                    }
+                }
+            }
+            catch { }
+        }
+
         /// <summary>
         /// 页面加载时
         /// </summary>
@@ -887,26 +940,11 @@ namespace PDF_Office.ViewModels.BOTA
                     //原型图上,目前对波浪线的类型,在注释列表不显示
                     if (item.EventType != AnnotArgsType.AnnotRedaction && item.EventType != AnnotArgsType.AnnotSquiggly)
                     {
-                        AnnotationHandlerEventArgs args = new AnnotationHandlerEventArgs();
-                        if (item.EventType == AnnotArgsType.AnnotFreehand)
+                        AnnotationHandlerEventArgs args = GetAddAnnotEventArgs(item);
+                        if (args.AnnotHandlerEventArgs != null)
                         {
-                            WriteableBitmap bitmap = GetAnnotImage(PdfViewer.Document, item.PageIndex, item.AnnotIndex);
-                            args.WriteableBitmap = bitmap;
+                            list.Add(args);
                         }
-                        args.AnnotHandlerEventArgs = item;
-                        args.PageIndex = item.PageIndex;
-                        args.AnnotIndex = item.AnnotIndex;
-                        args.EventType = item.EventType;
-                        args.CreateTime = item.CreateTime;
-                        args.UpdateTime = item.UpdateTime;
-                        args.Content = item.Content;
-                        args.MarkupContent = item.MarkupContent;
-                        args.Author = item.Author;
-                        args.Locked = item.Locked;
-                        args.ReadOnly = item.ReadOnly;
-                        args.FormField = item.FormField;
-                        args.Document = PdfViewer.Document;
-                        list.Add(args);
                     }
                 }
             }
@@ -914,6 +952,30 @@ namespace PDF_Office.ViewModels.BOTA
             return list;
         }
 
+        private AnnotationHandlerEventArgs GetAddAnnotEventArgs(AnnotHandlerEventArgs item)
+        {
+            AnnotationHandlerEventArgs args = new AnnotationHandlerEventArgs();
+            if (item.EventType == AnnotArgsType.AnnotFreehand)
+            {
+                WriteableBitmap bitmap = GetAnnotImage(PdfViewer.Document, item.PageIndex, item.AnnotIndex);
+                args.WriteableBitmap = bitmap;
+            }
+            args.AnnotHandlerEventArgs = item;
+            args.PageIndex = item.PageIndex;
+            args.AnnotIndex = item.AnnotIndex;
+            args.EventType = item.EventType;
+            args.CreateTime = item.CreateTime;
+            args.UpdateTime = item.UpdateTime;
+            args.Content = item.Content;
+            args.MarkupContent = item.MarkupContent;
+            args.Author = item.Author;
+            args.Locked = item.Locked;
+            args.ReadOnly = item.ReadOnly;
+            args.FormField = item.FormField;
+            args.Document = PdfViewer.Document;
+            return args;
+        }
+
         /// <summary>
         /// 获取手绘图案
         /// </summary>
@@ -962,8 +1024,7 @@ namespace PDF_Office.ViewModels.BOTA
         /// <param name="e"></param>
         private void AnnotationListItems_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
         {
-            ObservableCollection<AnnotationHandlerEventArgs> obsSender = sender as ObservableCollection<AnnotationHandlerEventArgs>;
-            if (obsSender != null)
+            if (sender is ObservableCollection<AnnotationHandlerEventArgs> obsSender)
             {
                 currentAnnotationArgs.Clear();
                 currentAnnotationArgs.AddRange(obsSender);

+ 3 - 0
PDF Office/ViewModels/BOTA/BOTAContentViewModel.cs

@@ -37,6 +37,8 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        public string CurrentBar = "";
+
         public DelegateCommand<object> TabControlSelectionChangedCommand { get; set; }
 
         public BOTAContentViewModel(IRegionManager regionManager, IDialogService dialogService)
@@ -80,6 +82,7 @@ namespace PDF_Office.ViewModels.BOTA
         /// <param name="currentBar"></param>
         private void EnterSelectedBar(string currentBar)
         {
+            CurrentBar = currentBar;
             NavigationParameters param = new NavigationParameters();
             param.Add(ParameterNames.PDFViewer, pdfViewer);
             param.Add(ParameterNames.ViewContentViewModel, viewContentViewModel);

+ 15 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs

@@ -7,6 +7,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
@@ -53,6 +54,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
 
         public DelegateCommand<object> CmbPageTextChanged { get; set; }
+
+        public DelegateCommand BatchConverterCommand { get; set; }
         #endregion
 
         public ConverterCSVDialogViewModel(IDialogService dialogService)
@@ -62,6 +65,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             RadioButtonCommand = new DelegateCommand<string>(radiobutton);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            BatchConverterCommand = new DelegateCommand(BatchConverter);
             dialogs = dialogService;
         }
 
@@ -141,6 +145,17 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
+        private void BatchConverter() {
+            DialogParameters convertpdftoword = new DialogParameters();
+            convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+            convertpdftoword.Add("ConverterTypeIndex", 4);
+            HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+
+        }
+
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));

+ 17 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -4,6 +4,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
@@ -48,6 +49,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
 
         public DelegateCommand<object> CmbPageTextChanged { get; set; }
+
+        public DelegateCommand BatchConverterCommand { get; set; }
+
         #endregion
 
         public ConverterExcelDialogViewModel(IDialogService dialogService)
@@ -57,6 +61,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             RadioButtonCommand = new DelegateCommand<string>(radiobutton);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            BatchConverterCommand = new DelegateCommand(BatchConverter);
             dialogs = dialogService;
         }
         #region 逻辑函数
@@ -169,6 +174,18 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
+        private void BatchConverter()
+        {
+
+            DialogParameters convertpdftoword = new DialogParameters();
+            convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+            convertpdftoword.Add("ConverterTypeIndex", 1);
+            HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+        }
+
         private void radiobutton(string e) {
             string radioButton=e;
             if (radioButton != null) {

+ 15 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs

@@ -3,6 +3,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
@@ -45,6 +46,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
 
         public DelegateCommand<object> CmbPageTextChanged { get; set; }
+
+        public DelegateCommand BatchConverterCommand { get; set; }
         #endregion
 
         public ConverterHTMLDialogViewModel(IDialogService dialogService)
@@ -53,6 +56,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             ConverterCommnad = new DelegateCommand(converter);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            BatchConverterCommand = new DelegateCommand(BatchConverter);
             dialogs = dialogService;
 
         }
@@ -164,6 +168,17 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 }
             }
         }
+
+        private void BatchConverter()
+        {
+            DialogParameters convertpdftoword = new DialogParameters();
+            convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+            convertpdftoword.Add("ConverterTypeIndex", 5);
+            HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+        }
         #endregion
 
         #region 构架行为

+ 16 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs

@@ -4,6 +4,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
@@ -103,6 +104,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
 
         public DelegateCommand<object> CmbPageTextChanged { get; set; }
+
+        public DelegateCommand BatchConverterCommand { get; set; }
+        
         #endregion
 
         public ConverterImgDialogViewModel(IDialogService dialogService)
@@ -111,6 +115,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             ConverterCommnad = new DelegateCommand(converter);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            BatchConverterCommand = new DelegateCommand(BatchConverter);
             dialogs = dialogService;
         }
 
@@ -287,6 +292,17 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 }
             }
         }
+
+        private void BatchConverter()
+        {
+            DialogParameters convertpdftoword = new DialogParameters();
+            convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+            convertpdftoword.Add("ConverterTypeIndex", 7);
+            HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+        }
         #endregion
 
         #region 构架行为

+ 16 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs

@@ -3,6 +3,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
@@ -46,6 +47,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
 
         public DelegateCommand<object> CmbPageTextChanged { get; set; }
+
+        public DelegateCommand BatchConverterCommand { get; set; }
         #endregion
 
         public ConverterPPTDialogViewModel(IDialogService dialogService)
@@ -54,6 +57,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             ConverterCommnad = new DelegateCommand(converter);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            BatchConverterCommand = new DelegateCommand(BatchConverter);
             dialogs = dialogService;
         }
         #region 逻辑函数
@@ -161,6 +165,18 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 }
             }
         }
+
+        private void BatchConverter()
+        {
+
+            DialogParameters convertpdftoword = new DialogParameters();
+            convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+            convertpdftoword.Add("ConverterTypeIndex", 2);
+            HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+        }
         #endregion
 
         #region 构架行为

+ 15 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs

@@ -3,6 +3,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
@@ -44,6 +45,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
 
         public DelegateCommand<object> CmbPageTextChanged { get; set; }
+
+        public DelegateCommand BatchConverterCommand { get; set; }
         #endregion
 
         public ConverterRTFDialogViewModel(IDialogService dialogService)
@@ -52,6 +55,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             ConverterCommnad = new DelegateCommand(converter);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            BatchConverterCommand = new DelegateCommand(BatchConverter);
             dialogs = dialogService;
         }
 
@@ -160,6 +164,17 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 }
             }
         }
+
+        private void BatchConverter()
+        {
+            DialogParameters convertpdftoword = new DialogParameters();
+            convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+            convertpdftoword.Add("ConverterTypeIndex", 3);
+            HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+        }
         #endregion
 
         #region 构架行为

+ 15 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs

@@ -3,6 +3,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
@@ -47,6 +48,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
 
         public DelegateCommand<object> CmbPageTextChanged { get; set; }
+
+        public DelegateCommand BatchConverterCommand { get; set; }
         #endregion
 
         public ConverterTextDialogViewModel(IDialogService dialogService)
@@ -55,6 +58,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             ConverterCommnad = new DelegateCommand(converter);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            BatchConverterCommand = new DelegateCommand(BatchConverter);
             dialogs = dialogService;
         }
         #region 逻辑函数
@@ -161,6 +165,17 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 }
             }
         }
+
+        private void BatchConverter()
+        {
+            DialogParameters convertpdftoword = new DialogParameters();
+            convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+            convertpdftoword.Add("ConverterTypeIndex", 6);
+            HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+        }
         #endregion
 
         #region 构架行为

+ 15 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs

@@ -3,6 +3,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
@@ -47,6 +48,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
 
         public DelegateCommand<object> CmbPageTextChanged { get; set; }
+
+        public DelegateCommand BatchConverterCommand { get; set; }
         #endregion
 
         public ConverterWordDialogViewModel(IDialogService dialogService)
@@ -56,6 +59,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             RadioButtonCommand = new DelegateCommand<string>(radiobutton);
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            BatchConverterCommand = new DelegateCommand(BatchConverter);
             dialogs = dialogService;
         }
         #region 逻辑函数
@@ -163,6 +167,17 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
+        private void BatchConverter()
+        {
+            DialogParameters convertpdftoword = new DialogParameters();
+            convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+            convertpdftoword.Add("ConverterTypeIndex", 0);
+            HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+        }
+
         private void radiobutton(string e)
         {
             string radioButton = e;

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

@@ -618,7 +618,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 fileNames = filepath;
                 PDFFileCount();
                 updateListview("待确定");
-                ChangeConverter(ConverterTypeIndex);
+                ChangeConverter(convertertypeindex);
             }
         }
        

+ 17 - 0
PDF Office/ViewModels/Dialog/ToolsDialogs/CompressDialogs/CompressDialogViewModel.cs

@@ -12,6 +12,9 @@ using DialogResult = Prism.Services.Dialogs.DialogResult;
 using MessageBox = System.Windows.Forms.MessageBox;
 using PDF_Office.Helper;
 using ComPDFKitViewer.PdfViewer;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using System.Linq;
+using System.Collections.Generic;
 
 namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
 {
@@ -75,6 +78,8 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
         public DelegateCommand CompressCommand { get; set; }
 
         public DelegateCommand ConfirmCompressCommand { get; set; }
+
+        public DelegateCommand BatchCompressCommand { get; set; }
         #endregion
 
         public CompressDialogViewModel(IDialogService dialogService)
@@ -85,6 +90,8 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
             MicroQualityCommand = new DelegateCommand(MicroQuality);
             CompressCommand = new DelegateCommand(Compress);
             ConfirmCompressCommand = new DelegateCommand(ConfirmCompress);
+            BatchCompressCommand = new DelegateCommand(BatchCompress);
+
             dialogs = dialogService;
         }
 
@@ -127,6 +134,16 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
             RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
         }
 
+        private void BatchCompress() {
+
+            DialogParameters compresspdf = new DialogParameters();
+            compresspdf.Add(ParameterNames.BatchProcessing_Name, "1");
+            HomePageBatchProcessingDialogModel.FilePaths =new List<string> { pdfviewer.Document.FilePath.ToString() } ;
+            HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+            compresspdf.Add(ParameterNames.FilePath, new string[] { pdfviewer.Document.FilePath.ToString() });
+            dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, compresspdf, e => { });
+        }
+
         private int GetIndex(int pageindex)
         {
             Trace.WriteLine(pageindex);

File diff suppressed because it is too large
+ 1 - 1
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs


+ 85 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -8,8 +8,10 @@ using PDF_Office.EventAggregators;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Properties;
+using PDF_Office.ViewModels.BOTA;
 using PDF_Office.ViewModels.PropertyPanel;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
+using PDF_Office.Views.BOTA;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDFSettings;
 using Prism.Commands;
@@ -497,6 +499,89 @@ namespace PDF_Office.ViewModels.Tools
 
         private void PDFViewer_AnnotEditHandler(object sender, List<AnnotEditEvent> e)
         {
+            if (e != null && e.Count > 0)
+            {
+                for (int i = 0; i < e.Count; i++)
+                {
+                    AnnotEditEvent editEvent = e[i];
+                    switch (editEvent.EditAction)
+                    {
+                        case ActionType.Add:
+                            BOTAContentViewModel bOTAContentViewModel = null;
+                            bool isTabItemAnnotation = IsTabItemAnnotationShow(out bOTAContentViewModel);
+
+                            if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
+                            {
+                                AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel);
+
+                                if (viewModel != null)
+                                {
+                                    int pageindex = editEvent.PageIndex;
+                                    int annotindex = editEvent.AnnotIndex;
+                                    viewModel.UpdateAddedAnnot(pageindex, annotindex);
+                                }
+                            }
+                            break;
+
+                        case ActionType.Del:
+                            break;
+
+                        case ActionType.Modify:
+                            break;
+
+                        case ActionType.TextEdit:
+                            break;
+
+                        default:
+                            break;
+                    }
+                }
+            }
+        }
+
+        private AnnotationContentViewModel GetAnnotationContentViewModel(BOTAContentViewModel bOTAContentViewModel)
+        {
+            AnnotationContentViewModel viewModel = null;
+            if (bOTAContentViewModel != null)
+            {
+                if (region.Regions.ContainsRegionWithName(bOTAContentViewModel.BOTAContentRegionName))
+                {
+                    var views = region.Regions[bOTAContentViewModel.BOTAContentRegionName].Views;
+                    foreach (var item in views)
+                    {
+                        if (item is AnnotationContent annotation)
+                        {
+                            viewModel = annotation.DataContext as AnnotationContentViewModel;
+                            break;
+                        }
+                    }
+                }
+            }
+            return viewModel;
+        }
+
+        private bool IsTabItemAnnotationShow(out BOTAContentViewModel bOTAContentViewModel)
+        {
+            bool isTabItemAnnotation = false;
+            bOTAContentViewModel = null;
+            if (region.Regions.ContainsRegionWithName(viewContentViewModel.BOTARegionName))
+            {
+                var views = region.Regions[viewContentViewModel.BOTARegionName].Views;
+                foreach (var item in views)
+                {
+                    if (item is BOTAContent bOTAContent)
+                    {
+                        bOTAContentViewModel = bOTAContent.DataContext as BOTAContentViewModel;
+                        if (bOTAContentViewModel.CurrentBar == "TabItemAnnotation")
+                        {
+                            isTabItemAnnotation = true;
+
+                            break;
+                        }
+                    }
+                }
+            }
+            return isTabItemAnnotation;
         }
 
         private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)

+ 5 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml

@@ -77,6 +77,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}">
+                    <Border>
+                        <TextBlock Text="批量处理" ></TextBlock>
+                    </Border>
+                </Button>
                 <Button
                     Width="98"
                     Height="32"

+ 6 - 1
PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml

@@ -40,7 +40,7 @@
                                 <RadioButton Margin="0,10,0,0" Name="OnlyTableRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTableRadioBtn,Path=Name}">
                                     <TextBlock Text="只提取表格"/>
                                 </RadioButton>
-                                <ComboBox Name="OnlyTableComboBox" Margin="0,8,0,0" Width="258" Height="32" IsEnabled="{Binding ElementName=OnlyTableRadioBtn,Path=IsChecked}" SelectionChanged="OnlyTableComboBox_SelectionChanged">
+                                <ComboBox Name="OnlyTableComboBox" Margin="0,8,0,0" Width="258" Height="32" IsEnabled="{Binding ElementName=OnlyTableRadioBtn,Path=IsChecked}" SelectionChanged="OnlyTableComboBox_SelectionChanged" SelectedIndex="0">
                                     <ComboBoxItem Content="支持一个表格提取到单独的工作表"/>
                                     <ComboBoxItem Content="支持按页面提取表格到单独的工作表"/>
                                     <ComboBoxItem Content="支持将所有表格提取到一个工作表"/>
@@ -79,6 +79,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}">
+                    <Border>
+                        <TextBlock Text="批量处理" ></TextBlock>
+                    </Border>
+                </Button>
                 <Button
                     Width="98"
                     Height="32"

+ 5 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml

@@ -55,6 +55,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                    <Border>
+                        <TextBlock Text="批量处理" ></TextBlock>
+                    </Border>
+                </Button>
                 <Button
                     Width="98"
                     Height="32"

+ 5 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml

@@ -87,6 +87,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                    <Border>
+                        <TextBlock Text="批量处理" ></TextBlock>
+                    </Border>
+                </Button>
                 <Button
                     Width="98"
                     Height="32"

+ 5 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml

@@ -55,6 +55,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                    <Border>
+                        <TextBlock Text="批量处理" ></TextBlock>
+                    </Border>
+                </Button>
                 <Button
                     Width="98"
                     Height="32"

+ 5 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml

@@ -55,6 +55,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                    <Border>
+                        <TextBlock Text="批量处理" ></TextBlock>
+                    </Border>
+                </Button>
                 <Button
                     Width="98"
                     Height="32"

+ 5 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml

@@ -55,6 +55,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                    <Border>
+                        <TextBlock Text="批量处理" ></TextBlock>
+                    </Border>
+                </Button>
                 <Button
                     Width="98"
                     Height="32"

+ 5 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml

@@ -68,6 +68,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                    <Border>
+                        <TextBlock Text="批量处理" ></TextBlock>
+                    </Border>
+                </Button>
                 <Button
                     Width="98"
                     Height="32"

+ 7 - 7
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml

@@ -19,12 +19,12 @@
 
     <Grid IsEnabled="{Binding PictureToPDFGridIsEnabled}">
         <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="632"/>
+            <ColumnDefinition Width="632*"/>
             <ColumnDefinition Width="260"/>
         </Grid.ColumnDefinitions>
         <Grid Grid.Column="0">
             <Grid.RowDefinitions>
-                <RowDefinition Height="482"/>
+                <RowDefinition Height="482*"/>
                 <RowDefinition Height="72"/>
             </Grid.RowDefinitions>
             <Grid  Grid.Row="0" AllowDrop="True"
@@ -128,12 +128,12 @@
         </Grid>
         <Grid Grid.Column="1" Background="WhiteSmoke" IsEnabled="{Binding SetPictureToPDFGridIsEnabled}">
             <Grid.RowDefinitions>
-                <RowDefinition Height="*"/>
+                <RowDefinition Height="1*"/>
                 <RowDefinition Height="2*"/>
                 <RowDefinition Height="72"/>
             </Grid.RowDefinitions>
-            <Grid Grid.Row="0">
-                <StackPanel Margin="15,23,0,0">
+            <Grid Grid.Row="0" Margin="15,23,0,0">
+                <StackPanel >
                     <TextBlock Text="导出"/>
                     <StackPanel Margin="0,8,0,0">
                         <RadioButton Name="NewFilesRadioButtom" Click="RadioButton_Click" IsChecked="True">
@@ -154,8 +154,8 @@
                     </StackPanel>
                 </StackPanel>
             </Grid>
-            <Grid Grid.Row="1">
-                <StackPanel Margin="15,0,0,0">
+            <Grid Grid.Row="1" Margin="15,0,0,0">
+                <StackPanel >
                     <TextBlock Text="OCR"/>
                     <CheckBox Name="NeedOCRCheckBox" Margin="0,7,0,0">
                         <TextBlock Text="在需要时识别文本"/>

+ 1 - 1
PDF Office/Views/Dialog/ToolsDialogs/CompressDialogs/CompressDialog.xaml

@@ -67,7 +67,7 @@
         </Border>
         <Grid Grid.Row="2" Width="568"  VerticalAlignment="Center">
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
-                <Button Background="WhiteSmoke" Width="100" Height="25" Margin="10,0,0,0">
+                <Button Background="WhiteSmoke" Width="100" Height="25" Margin="10,0,0,0" Command="{Binding BatchCompressCommand}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>