Procházet zdrojové kódy

Merge branch 'practice' into dev

# Conflicts:
#	PDF Office/App.xaml.cs
#	PDF Office/CustomControl/NumericUpDown.xaml.cs
#	PDF Office/CustomControl/PageTurningPreview.xaml.cs
#	PDF Office/CustomControl/WritableComboBox.xaml
#	PDF Office/CustomControl/WritableComboBox.xaml.cs
#	PDF Office/Model/DialogNames.cs
#	PDF Office/PDF Office.csproj
#	PDF Office/SDKLisence.xml
#	PDF Office/Styles/CheckBoxStyle.xaml
#	PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
#	PDF Office/ViewModels/ViewContentViewModel.cs
#	PDF Office/Views/MainContent.xaml
#	PDF Office/Views/ViewContent.xaml
ZhouJieSheng před 2 roky
rodič
revize
a84d1aa2b9
100 změnil soubory, kde provedl 9751 přidání a 641 odebrání
  1. 40 3
      PDF Office/App.xaml.cs
  2. binární
      PDF Office/ComPDFKit_Conversion.dll
  3. 32 0
      PDF Office/CustomControl/CommonWritableComboBox.xaml
  4. 148 0
      PDF Office/CustomControl/CommonWritableComboBox.xaml.cs
  5. 4 20
      PDF Office/CustomControl/NumericUpDown.xaml.cs
  6. 12 10
      PDF Office/CustomControl/PageTurningPreview.xaml
  7. 42 55
      PDF Office/CustomControl/PageTurningPreview.xaml.cs
  8. 53 33
      PDF Office/CustomControl/WritableComboBox.xaml.cs
  9. 28 0
      PDF Office/EventAggregators/EditToolsEvent.cs
  10. 237 0
      PDF Office/Helper/ConverterHelper.cs
  11. 2 2
      PDF Office/Helper/HomePageEditHelper.cs
  12. 13 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterCSVDialogModel.cs
  13. 45 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs
  14. 22 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterExcelDialogModel.cs
  15. 12 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterHTMLDialogModel.cs
  16. 15 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterImgDialogModel.cs
  17. 12 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterPPTDialogModel.cs
  18. 12 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterRTFDialogModel.cs
  19. 12 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterTextDialogModel.cs
  20. 12 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterWordDialogModel.cs
  21. 18 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogModel.cs
  22. 22 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogModel.cs
  23. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVModel.cs
  24. 45 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogModel.cs
  25. 22 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelModel.cs
  26. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterHTMLModel.cs
  27. 15 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgModel.cs
  28. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterPPTModel.cs
  29. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterRTFModel.cs
  30. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterTextModel.cs
  31. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordModel.cs
  32. 100 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogModel.cs
  33. 23 21
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogModel.cs
  34. 105 85
      PDF Office/Model/DialogNames.cs
  35. 12 0
      PDF Office/Model/ParameterNames.cs
  36. 411 65
      PDF Office/PDF Office.csproj
  37. 2 2
      PDF Office/SDKLisence.xml
  38. 64 0
      PDF Office/Styles/CheckBoxStyle.xaml
  39. 36 1
      PDF Office/Styles/CustomBtnStyle.xaml
  40. 217 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs
  41. 218 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  42. 192 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  43. 303 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs
  44. 190 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  45. 163 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs
  46. 189 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  47. 190 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  48. 209 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  49. 110 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs
  50. 355 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogViewModel.cs
  51. 63 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVViewModel.cs
  52. 467 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs
  53. 73 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelViewModel.cs
  54. 67 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgViewModel.cs
  55. 56 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordViewModel.cs
  56. 474 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogViewModel.cs
  57. 68 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs
  58. 1 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageInsertDialogViewModel.cs
  59. 76 22
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs
  60. 1958 229
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs
  61. 186 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModBookletContentViewModel.cs
  62. 249 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModMultipleContentViewModel.cs
  63. 131 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModSizeContentViewModel.cs
  64. 212 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterPageSetDialogViewModel.cs
  65. 14 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/ModInfoSendEvent.cs
  66. 100 32
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageSplitDialogViewModel.cs
  67. 1 1
      PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs
  68. 95 0
      PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs
  69. 92 0
      PDF Office/ViewModels/EditTools/Background/BackgroundCreateBaseContentViewModel.cs
  70. 5 10
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModMutipleContentViewModel.cs
  71. 25 0
      PDF Office/ViewModels/EditTools/Background/BackgroundCreateFileContentViewModel.cs
  72. 92 0
      PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListBaseContentViewModel.cs
  73. 25 0
      PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListColorContentViewModel.cs
  74. 25 0
      PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListFileContentViewModel.cs
  75. 28 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs
  76. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateBaseContentViewModel.cs
  77. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs
  78. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs
  79. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListBaseContentViewModel.cs
  80. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListFileContentViewModel.cs
  81. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListTextContentViewModel.cs
  82. 36 4
      PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs
  83. 7 7
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  84. 92 0
      PDF Office/ViewModels/Tools/ConverterBarContentViewModel.cs
  85. 23 2
      PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs
  86. 139 15
      PDF Office/ViewModels/ViewContentViewModel.cs
  87. 1 14
      PDF Office/Views/BOTA/BOTAContent.xaml
  88. 97 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml
  89. 47 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml.cs
  90. 96 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml
  91. 64 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml.cs
  92. 75 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml
  93. 47 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml.cs
  94. 107 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml
  95. 49 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml.cs
  96. 75 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml
  97. 47 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml.cs
  98. 19 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterProgressBarDialog.xaml
  99. 15 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterProgressBarDialog.xaml.cs
  100. 0 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml

+ 40 - 3
PDF Office/App.xaml.cs

@@ -36,6 +36,12 @@ using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDF_Office.Views.FillAndSign;
 using PDF_Office.Views.FillAndSign.PropertyPanel;
 using PDF_Office.Views.PropertyPanel.ViewModular;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Views.Dialog.ConverterDialogs;
+using PDF_Office.Helper;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
+using PDF_Office.Views.EditTools.Watermark; 
+using PDF_Office.Views.EditTools.Background;
 
 namespace PDF_Office
 {
@@ -123,7 +129,26 @@ namespace PDF_Office
 
             containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
-            containerRegistry.RegisterForNavigation<HomePagePrinterModMutipleContent>();
+            containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
+            containerRegistry.RegisterForNavigation<HomePagePrinterModBookletContent>();
+            containerRegistry.RegisterForNavigation<HomePageCompressDialog>();
+            containerRegistry.RegisterForNavigation<HomePageSetPasswordDialog>();
+            containerRegistry.RegisterForNavigation<ConverterBarContent>();
+            containerRegistry.RegisterForNavigation<HomePageConverterDialog>();
+            containerRegistry.RegisterForNavigation<HomePageConverterCSV>();
+            containerRegistry.RegisterForNavigation<HomePageConverterImg>();
+            containerRegistry.RegisterForNavigation<HomePageConverterWord>();
+            containerRegistry.RegisterForNavigation<HomePageConverterExcel>();
+            containerRegistry.RegisterForNavigation<WatermarkContent>();
+            containerRegistry.RegisterForNavigation<BackgroundContent>();
+            containerRegistry.RegisterForNavigation<BackgroundContent>();
+            containerRegistry.RegisterForNavigation<BackgroundTemplateListBaseContent>();
+            containerRegistry.RegisterForNavigation<BackgroundTemplateListColorContent>();
+            containerRegistry.RegisterForNavigation<BackgroundTemplateListFileContent>();
+            containerRegistry.RegisterForNavigation<BackgroundCreateBaseContent>();
+            containerRegistry.RegisterForNavigation<BackgroundCreateColorContent>();
+            containerRegistry.RegisterForNavigation<BackgroundCreateFileContent>();
+            containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
             containerRegistry.RegisterForNavigation<FreehandAnnotProperty>();
             containerRegistry.RegisterForNavigation<FreetextAnnotProperty>();
             containerRegistry.RegisterForNavigation<ImageAnnotProperty>();
@@ -158,7 +183,17 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<HomePagePrinterDialog>(DialogNames.HomePagePrinterDialog);
             containerRegistry.RegisterDialog<HomePagePrinterPageSetDialog>(DialogNames.HomePagePrinterPageSetDialog);
             containerRegistry.RegisterDialog<HomePagePictureToPDFDialog>(DialogNames.HomePagePictureToPDFDialog);
-            containerRegistry.RegisterDialog<AddBookmarkDialog>(DialogNames.AddBookmarkDialog);
+            containerRegistry.RegisterDialog<HomePageBatchProcessingDialog>(DialogNames.HomePageBatchProcessingDialog);
+            containerRegistry.RegisterDialog<ConverterCSVDialog>(DialogNames.ConverterCSVDialog);
+            containerRegistry.RegisterDialog<ConverterPPTDialog>(DialogNames.ConverterPPTDialog);
+            containerRegistry.RegisterDialog<ConverterTextDialog>(DialogNames.ConverterTextDialog);
+            containerRegistry.RegisterDialog<ConverterWordDialog>(DialogNames.ConverterWordDialog);
+            containerRegistry.RegisterDialog<ConverterHTMLDialog>(DialogNames.ConverterHTMLDialog);
+            containerRegistry.RegisterDialog<ConverterImgDialog>(DialogNames.ConverterImgDialog);
+            containerRegistry.RegisterDialog<ConverterRTFDialog>(DialogNames.ConverterRTFDialog);
+            containerRegistry.RegisterDialog<ConverterExcelDialog>(DialogNames.ConverterExcelDialog);
+            containerRegistry.RegisterDialog<ConverterProgressBarDialog>(DialogNames.ConverterProgressBarDialog);
+
 
             #endregion 注册弹窗
         }
@@ -192,6 +227,8 @@ namespace PDF_Office
             string devKey = "";
             string devSecret = "";
 #if DEBUG
+            devKey = "ehrnKqkWc1XSEAWyPUt6+95GzCoLEyoKrCbsUuJkCqGmxmP5ozX4bS0R6crHItQVNTFvC5mBZ1M7QjJ6Ekdu4Daj7PM+EDLTBKbFJinK4Ri9E5E2X+a9vF5zSj0TkIscQPVnwj9ikxAFOWGIyybMwQQzwc8a4j1cGOqGXQRDMMY=";
+            devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6ccHhEu996bvBgqf8Sw8OekQKQq13VBewK5AckaDux4W7SGRhCUNWC4MItkr36JnXMD2tiFQYzMG8C66HYmRGSLh";
             devKey = sdkhelper.DevKey;
             devSecret = sdkhelper.DevSecret;
 #endif
@@ -221,7 +258,7 @@ namespace PDF_Office
                 }
                 CPDFConverter.Init(resPath);*/
                 string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
-                LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
+                LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret);
                 if (licenseerror != LicenseError.ERR_SUCCESS)
                 {
                     //MessageBox.Show("ComPDFKit Conversion SDK Load Failed!");

binární
PDF Office/ComPDFKit_Conversion.dll


+ 32 - 0
PDF Office/CustomControl/CommonWritableComboBox.xaml

@@ -0,0 +1,32 @@
+<UserControl x:Class="PDF_Office.CustomControl.CommonWritableComboBox"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Office.CustomControl"
+             mc:Ignorable="d" 
+              d:DesignHeight="32" d:DesignWidth="66">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+            <ColumnDefinition Width="16"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <TextBox Name="TextBox_Num"
+                MinHeight="32"
+                Grid.Column="0"
+                Padding="16,0,0,0"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                BorderThickness="0"
+                FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
+                FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
+                Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
+                InputMethod.IsInputMethodEnabled="False"
+                PreviewTextInput="CountTextBox_PreviewTextInput"
+                Text="1"
+                TextAlignment="Left"
+                KeyDown="CurrentPage_KeyDown"
+                TextChanged="TextBox_Num_TextChanged" />
+        <ComboBox Name="ComboBox_Type" MinHeight="32" Width="16" HorizontalAlignment="Right" BorderBrush="Transparent" BorderThickness="00" Grid.Column="1" SelectionChanged="ComboBox_SelectionChanged"></ComboBox>
+    </Grid>
+</UserControl>

+ 148 - 0
PDF Office/CustomControl/CommonWritableComboBox.xaml.cs

@@ -0,0 +1,148 @@
+using ImTools;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// CommonWritableComboBox.xaml 的交互逻辑
+    /// </summary>
+    public partial class CommonWritableComboBox : UserControl
+    {
+        public CommonWritableComboBox()
+        {
+            InitializeComponent();
+        }
+        public string Text
+        {
+            get { return (string)GetValue(TextProperty); }
+            set { SetValue(TextProperty, value); }
+        }
+
+        public static readonly DependencyProperty TextProperty =
+            DependencyProperty.Register("Text", typeof(string), typeof(CommonWritableComboBox), new PropertyMetadata(""));
+
+
+        /// <summary>
+        /// 当前值
+        /// </summary>
+        public double Value
+        {
+            get { return (double)GetValue(ValueProperty); }
+            set
+            {
+                if (value > Maximum)
+                {
+                    SetValue(ValueProperty, Maximum);
+                }
+                else if (value < Minimum)
+                {
+                    SetValue(ValueProperty, Minimum);
+                }
+                else
+                {
+                    SetValue(ValueProperty, value);
+                    //TextBox_Num.Text = Value.ToString();
+                }
+            }
+        }
+
+        public static readonly DependencyProperty ValueProperty =
+            DependencyProperty.Register("Value", typeof(double), typeof(CommonWritableComboBox), new PropertyMetadata(0.0));
+
+        public List<string> TypeSouce
+        {
+            get { return (List<string>)GetValue(TypeSouceProperty); }
+            set { SetValue(TypeSouceProperty, value); }
+        }
+
+        public static readonly DependencyProperty TypeSouceProperty =
+            DependencyProperty.Register("TypeSouce", typeof(List<string>), typeof(CommonWritableComboBox), new PropertyMetadata(new List<string>()));
+
+        /// <summary>
+        /// 最大值
+        /// </summary>
+        public double Maximum
+        {
+            get { return (double)GetValue(MaximumProperty); }
+            set { SetValue(MaximumProperty, value); }
+        }
+
+        public static readonly DependencyProperty MaximumProperty =
+            DependencyProperty.Register("Maximum", typeof(double), typeof(CommonWritableComboBox), new PropertyMetadata(9999.0));
+
+        
+        /// <summary>
+        /// 最小值
+        /// </summary>
+        public double Minimum
+        {
+            get { return (double)GetValue(MinimumProperty); }
+            set { SetValue(MinimumProperty, value); }
+        }
+
+        public static readonly DependencyProperty MinimumProperty =
+            DependencyProperty.Register("Minimum", typeof(double), typeof(CommonWritableComboBox), new PropertyMetadata(0.0));
+
+        /// <summary>
+        /// 单位符号
+        /// </summary>
+        public string Unit
+        {
+            get { return (string)GetValue(UnitProperty); }
+            set { SetValue(UnitProperty, value); }
+        }
+
+        public static readonly DependencyProperty UnitProperty =
+            DependencyProperty.Register("Unit", typeof(string), typeof(CommonWritableComboBox), new PropertyMetadata("%"));
+
+        private void TextBox_Num_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            
+            if (this.TextBox_Num.Text == "" )
+            {
+                this.TextBox_Num.Text ="0";
+            }
+
+            if (!int.TryParse(this.TextBox_Num.Text, out _)&&!int.TryParse(this.TextBox_Num.Text.Replace(Unit, ""), out _)) { this.TextBox_Num.Text = "0"; }
+            else{ 
+            Text = this.TextBox_Num.Text;
+            Value = int.Parse(this.TextBox_Num.Text.Replace(" ", "").Replace(Unit, ""));
+            }
+        }
+
+        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+            this.TextBox_Num.Text = TypeSouce[ComboBox_Type.SelectedIndex];
+            Text = this.TextBox_Num.Text;
+            Value = int.Parse(this.TextBox_Num.Text.Replace(" ", "").Replace(Unit, ""));
+        }
+        private void CountTextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
+        {
+            //e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
+        }
+
+        private void CurrentPage_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Enter)
+            {
+                this.TextBox_Num.Text = this.TextBox_Num.Text.Replace(" " , "").Replace(Unit,"")+" "+Unit;
+                
+            }
+        }
+    }
+}

+ 4 - 20
PDF Office/CustomControl/NumericUpDown.xaml.cs

@@ -21,24 +21,7 @@ namespace PDF_Office.CustomControl
     /// </summary>
     public partial class NumericUpDown : UserControl
     {
-        //public int Num
-        //{
-        //    get
-        //    {
-        //        int value = 0;
-        //        this.Dispatcher.Invoke(new Action(() =>
-        //            value = Convert.ToInt32(this.TextBox_Num.Text.Trim())
-        //        ));
-        //        return value;
-        //    }
-        //    set
-        //    {
-        //        this.Dispatcher.Invoke(new Action(() =>
-        //        {
-        //            this.TextBox_Num.Text = value.ToString();
-        //        }));
-        //    }
-        //}
+        
 
         public string Text
         {
@@ -56,7 +39,8 @@ namespace PDF_Office.CustomControl
         public double Value
         {
             get { return (double)GetValue(ValueProperty); }
-            set { 
+            set
+            {
                 if (value > Maximum)
                 {
                     SetValue(ValueProperty, Maximum);
@@ -149,7 +133,7 @@ namespace PDF_Office.CustomControl
             {
                 targetvalue = Maximum;
             }
-            if(targetvalue>Maximum)
+            if (targetvalue > Maximum)
             {
                 targetvalue = Maximum;
             }

+ 12 - 10
PDF Office/CustomControl/PageTurningPreview.xaml

@@ -5,23 +5,25 @@
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:PDF_Office.CustomControl"
              mc:Ignorable="d" 
-             d:DesignHeight="350" d:DesignWidth="300">
-    <Grid>
-        <Border  Margin="10,40,10,40" Background="LightGray"  Height="218" Width="176">
+             Height="280" Width="200">
+    <Grid Width="200" Height="280">
+        <StackPanel Orientation="Vertical" Height="280">
+        <Border  Margin="0,16,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Background="LightGray"  Height="218" Width="176">
             <Viewbox>
-                <Image Name="Image"></Image>
+                    <Image Name="Image" Height="218" Width="176"></Image>
             </Viewbox>
         </Border>
-        <StackPanel Orientation="Horizontal"  Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom">
-            <Button IsEnabled="False" Name="PrePage" Width="20" Click="PrePage_Click" Height="20" HorizontalAlignment="Left" FontSize="16" Background="WhiteSmoke" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
+        <StackPanel Orientation="Horizontal"  Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,16,0,0">
+            <Button Name="PrePage" Width="24" Click="PrePage_Click" Height="24" HorizontalAlignment="Left" FontSize="16" Background="WhiteSmoke" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
                 <TextBlock Text="&lt;" VerticalAlignment="Center" ></TextBlock>
             </Button>
-            <TextBox x:Name="CurrentPage" Width="30" Height="25" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10,0,5,0" Text="1" InputMethod.IsInputMethodEnabled="False"   PreviewTextInput="CountTextBox_PreviewTextInput" KeyDown="CurrentPage_KeyDown"></TextBox>
-            <TextBlock  Text="of"  HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0"></TextBlock>
-            <TextBlock x:Name="PageIndex"  HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5"></TextBlock>
-            <Button Name="NextPage" Click="NextPage_Click" Width="20" Height="20" HorizontalAlignment="Left" FontSize="16"  Background="WhiteSmoke"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
+            <TextBox x:Name="CurrentPage" Width="48" Height="24" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="11,0,2,0" Text="1" InputMethod.IsInputMethodEnabled="False"   PreviewTextInput="CountTextBox_PreviewTextInput" KeyDown="CurrentPage_KeyDown"></TextBox>
+            <TextBlock  Text="of" Margin="0,0,2,0"  HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
+                <TextBlock  x:Name="PageIndex" VerticalAlignment="Center" Block.TextAlignment="Center"  Width="23"/>
+                <Button Name="NextPage" Click="NextPage_Click" Width="24" Height="24" HorizontalAlignment="Left" FontSize="16"  Background="WhiteSmoke"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="17,0,0,0">
                 <TextBlock Text=">" VerticalAlignment="Center"></TextBlock>
             </Button>
         </StackPanel>
+        </StackPanel>
     </Grid>
 </UserControl>

+ 42 - 55
PDF Office/CustomControl/PageTurningPreview.xaml.cs

@@ -1,7 +1,9 @@
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFPage;
+using PDF_Office.Helper;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
@@ -25,15 +27,32 @@ namespace PDF_Office.CustomControl
     public partial class PageTurningPreview : UserControl
     {
         public CPDFDocument document;
-        public PageTurningPreview()
+        public List<int> PageIndexLists = new List<int>();
+
+        private int currentIndex = 0;
+        public int CurrentIndex
         {
+            get { return currentIndex; }
+            set
+            {
+                currentIndex = value;
+                //合理的使用set方法来进行一些操作,可以帮助理清很多思路,且极大减少代码量
+                this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                if (document != null)
+                {
+                    AwaitRenderBitmap(document);
+                }
+            }
+        }
+        public PageTurningPreview()
+        {   
             InitializeComponent();
+         
         }
 
         public async Task RenderBitmap(CPDFDocument doc)
         {
-            CPDFPage page = doc.PageAtIndex(int.Parse(this.CurrentPage.Text) - 1,true);
-
+            CPDFPage page = doc.PageAtIndex(PageIndexLists[CurrentIndex]);
             byte[] bmp_data = new byte[(int)page.PageSize.Width * (int)page.PageSize.Height * 4];
             await Task.Run(delegate
             {
@@ -50,79 +69,47 @@ namespace PDF_Office.CustomControl
 
         private void PrePage_Click(object sender, RoutedEventArgs e)
         {
-            if (this.CurrentPage.Text == "" || !int.TryParse(this.CurrentPage.Text, out int _))
-            {
-                this.CurrentPage.Text = "1";
-            }
-            if (int.Parse(this.CurrentPage.Text) > 1 && int.Parse(this.CurrentPage.Text) <= document.PageCount)
-            {
-                int Page = int.Parse(this.CurrentPage.Text);
-                this.CurrentPage.Text = (--Page).ToString();
-                if (document != null)
-                {
-                    AwaitRenderBitmap(document);
-                }
-            }
-            else if (int.Parse(this.CurrentPage.Text) <= 1) { this.CurrentPage.Text = "1"; }
-            else { this.CurrentPage.Text = document.PageCount.ToString(); }
-            NextPage.IsEnabled = true;
-            if (this.CurrentPage.Text == "1")
+
+            if (CurrentIndex > 0)
             {
-                PrePage.IsEnabled = false;
+                CurrentIndex--;
             }
-
         }
 
         private void NextPage_Click(object sender, RoutedEventArgs e)
         {
-
-            if (this.CurrentPage.Text == ""|| !int.TryParse(this.CurrentPage.Text,out int _))
-            {
-                this.CurrentPage.Text = "1";
-            }
-            if (int.Parse(this.CurrentPage.Text) < document.PageCount)
-            {
-                int Page = int.Parse(this.CurrentPage.Text);
-                this.CurrentPage.Text = (++Page).ToString();
-                if (document != null)
-                {
-                    AwaitRenderBitmap(document);
-                }
-            }
-            PrePage.IsEnabled= true;
-            if (this.CurrentPage.Text == document.PageCount.ToString())
+            if (CurrentIndex < PageIndexLists.Count()-1 && PageIndexLists.Count() > 0)
             {
-                 NextPage.IsEnabled = false;
+                CurrentIndex++;
             }
+           
+            
         }
 
         private void CurrentPage_KeyDown(object sender, KeyEventArgs e)
         {
-            if (this.CurrentPage.Text == ""|| !int.TryParse(this.CurrentPage.Text, out int _))
-            {
-                this.CurrentPage.Text = "1";
-            }
+            
             if (e.Key == Key.Enter)
             {
-                if (this.CurrentPage.Text == "" || int.Parse(this.CurrentPage.Text) < 1)
+                if (this.CurrentPage.Text == "" || !int.TryParse(this.CurrentPage.Text, out int _))
                 {
-                    this.CurrentPage.Text = "1";
+                    this.CurrentPage.Text = (PageIndexLists[0] + 1).ToString();
                 }
                 if (this.PageIndex != null)
                 {
-                    if (int.Parse(this.CurrentPage.Text) > int.Parse(this.PageIndex.Text))
+                    if (PageIndexLists.Contains( int.Parse(this.CurrentPage.Text)-1))
                     {
-                        this.CurrentPage.Text = this.PageIndex.Text;
+                        CurrentIndex=PageIndexLists.IndexOf(int.Parse(this.CurrentPage.Text)-1);
+                        this.CurrentPage.Text = (PageIndexLists[CurrentIndex]+1).ToString();
+                        AwaitRenderBitmap(document);
+                    }
+                    else
+                    {
+                        this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                        MessageBox.Show("超出页面范围");
                     }
                 }
-                if (int.Parse(this.CurrentPage.Text) <= document.PageCount && int.Parse(this.CurrentPage.Text) > 0)
-                {
-                    AwaitRenderBitmap(document);
-                }
-                else
-                {
-                    MessageBox.Show("超出页面范围");
-                }
+                
             }
         }
 

+ 53 - 33
PDF Office/CustomControl/WritableComboBox.xaml.cs

@@ -23,39 +23,6 @@ namespace PDF_Office.CustomControl
     /// </summary>
     public partial class WritableComboBox : UserControl
     {
-        public WritableComboBox()
-        {
-            InitializeComponent();
-            writableComboBox.SelectedIndex = 0;
-        }
-        private void writableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            if (this.writableComboBox.SelectedIndex == this.writableComboBox.Items.Count - 1)
-            {
-                this.writableTextBox.Width = this.writableComboBox.ActualWidth - 18;
-                Trace.WriteLine(this.writableComboBox.ActualWidth);
-                this.writableTextBox.Visibility = Visibility.Visible;
-
-            }
-            else
-            {
-                if (this.writableTextBox != null)
-                {
-                    this.writableTextBox.Visibility = Visibility.Hidden;
-                }
-            }
-
-            if (this.writableComboBox.Items.Count == 5)
-            {
-                if (this.writableComboBox.SelectedIndex == 1)
-                { IsCurrentPage = true; }
-                else
-                {
-                    IsCurrentPage = false;
-                }
-            }
-            this.SelectedIndex = this.writableComboBox.SelectedIndex.ToString();
-        }
 
         public bool IsCurrentPage
         {
@@ -122,6 +89,56 @@ namespace PDF_Office.CustomControl
 
             DependencyProperty.Register("Text", typeof(string), typeof(WritableComboBox), new PropertyMetadata(""));
 
+        /// <summary>
+        /// 把子控件的事件传递出去,方便绑定
+        /// </summary>
+        public event RoutedEventHandler SelectionChanged;
+
+
+        /// <summary>
+        /// 把子控件的事件传递出去,方便绑定
+        /// </summary>
+        public event RoutedEventHandler TextChanged;
+
+
+
+        public WritableComboBox()
+        {
+            InitializeComponent();
+        }
+
+
+        private void writableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (this.writableComboBox.SelectedIndex == this.writableComboBox.Items.Count - 1)
+            {
+                this.writableTextBox.Width = this.writableComboBox.ActualWidth - 18;
+                Trace.WriteLine(this.writableComboBox.ActualWidth);
+                this.writableTextBox.Visibility = Visibility.Visible;
+
+            }
+            else
+            {
+                if (this.writableTextBox != null)
+                {
+                    this.writableTextBox.Visibility = Visibility.Hidden;
+                }
+            }
+
+            if (this.writableComboBox.Items.Count == 5)
+            {
+                if (this.writableComboBox.SelectedIndex == 1)
+                { IsCurrentPage = true; }
+                else
+                {
+                    IsCurrentPage = false;
+                }
+            }
+            this.SelectedIndex = this.writableComboBox.SelectedIndex.ToString();
+
+            SelectionChanged?.Invoke(sender,e);
+        }
+
         private void writableTextBox_TextChange(object sender, TextChangedEventArgs e)
         {
             if (this.writableComboBox.SelectedIndex == this.writableComboBox.Items.Count - 1)
@@ -129,6 +146,9 @@ namespace PDF_Office.CustomControl
                 Text = this.writableTextBox.Text;
             }
             else { Text = ""; }
+
+
+            TextChanged?.Invoke(sender,e);
         }
     }
 }

+ 28 - 0
PDF Office/EventAggregators/EditToolsEvent.cs

@@ -0,0 +1,28 @@
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.EventAggregators
+{
+
+    public enum EnumTemplateListOrCreate
+    {
+        StatusTemplate,
+        StatusCreate
+    }
+
+    public class EnterSelectedEditToolEvent : PubSubEvent<string>
+    {
+    }
+
+    public class CloseEditToolEvent : PubSubEvent
+    {
+    }
+    public class EnterTemplateListOrCreateEvent : PubSubEvent<EnumTemplateListOrCreate>
+    {
+
+    }
+}

+ 237 - 0
PDF Office/Helper/ConverterHelper.cs

@@ -0,0 +1,237 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ComPDFKit_Conversion.Converter;
+using System.Diagnostics;
+using System.IO;
+using Microsoft.AppCenter.Crashes.Ingestion.Models;
+using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
+using ComPDFKit_Conversion.Options;
+using PDF_Office.CustomControl;
+using Exception = System.Exception;
+
+namespace PDF_Office.Helper
+{
+    public static class ConverterHelper
+    {
+        public static CPDFConverterWord wordConverter = null;
+        public static CPDFConverterExcel excelConverter = null;
+        public static CPDFConverterPPT pptConverter = null;
+        public static CPDFConverterTxt txtConverter = null;
+        public static CPDFConverterCsv csvConverter = null;
+        public static CPDFConverterImg imgConverter = null;
+        public static async Task<bool> WordConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        {
+            bool result = false;
+            try
+            {
+                int[] pageArray = pageIndexLists.ToArray();
+                wordConverter = new CPDFConverterWord(inputpath, pawssword);
+                string outputFolder = outputpath;
+                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));
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return result;
+        }
+
+        public static async Task<bool> PPTConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        {
+            bool result = false;
+            try
+            {
+                int[] pageArray = pageIndexLists.ToArray();
+
+                pptConverter = new CPDFConverterPPT(inputpath, pawssword);
+                string outputFolder = outputpath;
+                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                ConvertError error = ConvertError.ERR_UNKNOWN;
+
+                string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".ppt");
+
+                result = await Task.Run(() => pptConverter.Convert(outputFolder, ref outputFileName, pageArray, ref error, getProgress));
+                if (result)
+                {
+                    if (File.Exists(outputFileName))
+                        Process.Start(outputFileName);
+                }
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return result;
+        }
+
+        public static async Task<bool> ExcelConvert(string inputpath, string outputpath,OnProgress getProgress , List<int> pageIndexLists, string pawssword,CPDFConvertExcelOptions ExcelOption)
+        {
+            bool result = false;
+            try
+            {
+                excelConverter = new CPDFConverterExcel(inputpath,pawssword);
+                int[] pageArray = pageIndexLists.ToArray();
+
+                string outputFolder = outputpath;
+                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                ConvertError error = ConvertError.ERR_UNKNOWN;
+                 result = await Task.Run(() => excelConverter.Convert(outputFolder, ref outputFileName, ExcelOption, pageArray, ref error, getProgress));
+                if (result)
+                {
+                    if (File.Exists(outputFileName))
+                        Process.Start(outputFileName);
+                    else if (outputFileName == "NoTable")
+                        MessageBoxEx.Show("No Table");
+                }
+               
+                   
+            }
+            catch (Exception ex)
+           {
+
+               }
+            return result;
+        }
+
+        //public static async Task<bool> TableConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        //{
+        //    bool result = false;
+        //    try
+        //    {
+        //        int[] pageArray = pageIndexLists.ToArray();
+        //        tableConverter = new CPDFConverterTable(inputpath, pawssword);
+        //        string outputFolder = outputpath;
+        //        string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+        //        ConvertError error = ConvertError.ERR_UNKNOWN;
+        //        string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".xlsx");
+        //        result = await Task.Run(() => tableConverter.Convert(outputFolder, ref outputFileName, pageArray, ref error, getProgress));
+
+        //    }
+        //    catch (Exception ex)
+        //    {
+
+        //    }
+        //    return result;
+        //}
+
+        public static async Task<bool> CSVConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        {
+            bool result = false;
+            try
+            {
+                int[] pageArray = pageIndexLists.ToArray();
+
+                csvConverter = new CPDFConverterCsv(inputpath, pawssword);
+                string outputFolder = outputpath;
+                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));
+
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return result;
+        }
+
+        public static async Task<bool> TxtConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword)
+        {
+            bool result = false;
+            try
+            {
+                int[] pageArray = pageIndexLists.ToArray();
+
+                txtConverter = new CPDFConverterTxt(inputpath, pawssword);
+                string outputFolder = outputpath;
+                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));
+
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return result;
+        }
+
+        public static async Task<bool> ImgConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists,string pawssword, ImgType type)
+        {
+            bool result = false;
+            try
+            {
+                int[] pageArray = pageIndexLists.ToArray();
+
+                imgConverter = new CPDFConverterImg(inputpath, pawssword);
+                string outputFolder = outputpath;
+                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                ConvertError error = ConvertError.ERR_UNKNOWN;
+                result = await Task.Run(() => imgConverter.Convert(outputFolder, ref outputFileName, pageArray, type, ref error, getProgress));
+                if (result)
+                {
+                    if (File.Exists(outputFileName))
+                        Process.Start(outputFileName);
+                }
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return result;
+        }
+
+        public static void Clear()
+        {
+            if (wordConverter != null)
+            {
+                wordConverter.Cancel();
+            }
+            if (excelConverter != null)
+            {
+                excelConverter.Cancel();
+            }
+            if (pptConverter != null)
+            {
+                pptConverter.Cancel();
+            }
+            if (txtConverter != null)
+            {
+                txtConverter.Cancel();
+            }
+            //if (tableConverter != null)
+            //{
+            //    tableConverter.Cancel();
+            //}
+            if (csvConverter != null)
+            {
+                csvConverter.Cancel();
+            }
+            Console.WriteLine("killed");
+        }
+        private static void StartFile(string path)
+        {
+            //Process.Start(path);
+        }
+        public static string GetFileNameAddSuffix(string path, string filename, string suffix)
+        {
+            int i = 1;
+            string outname = filename;
+            while (File.Exists(path + @"\" + outname + suffix))
+            {
+                outname = filename + $"({i.ToString()})";
+                i++;
+            }
+            return outname;
+        }
+
+    }
+}

+ 2 - 2
PDF Office/Helper/HomePageEditHelper.cs

@@ -75,7 +75,7 @@ namespace PDF_Office.Helper
 
         }
 
-        public static void GetPagerange(string PageRangeSelectIndex, CPDFViewer currentViewer, ref string pageRange, string pageRangeText, bool currentpage = false)
+        public static void GetPagerange(string PageRangeSelectIndex, CPDFViewer currentViewer, ref string pageRange, string pageRangeText, bool currentpage = false, string currentPageRange="1")
         {
             if (!currentpage)
             {
@@ -118,7 +118,7 @@ namespace PDF_Office.Helper
                 }
                 if (PageRangeSelectIndex == "1")
                 {
-                    //pageRange = pageRange;
+                    pageRange = currentPageRange;
                     Trace.WriteLine(" extractModel.PageRange" + pageRange);
                 }
                 else if (PageRangeSelectIndex == "2")

+ 13 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterCSVDialogModel.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterCSVDialogModel : ConverterDialogsModel
+    {
+
+    }
+}

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

@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using ComPDFKit_Conversion.Converter;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterDialogsModel
+    {
+
+
+        /// <summary>
+        /// 文档地址;
+        /// </summary>
+        public string InputPath="";
+
+        /// <summary>
+        /// 输出地址;
+        /// </summary>
+        public string OutputPath="";
+
+        /// <summary>
+        /// 进度;
+        /// </summary>
+        public OnProgress GetProgress=null;
+
+        /// <summary>
+        /// 页码 页码范围;
+        /// </summary>
+        public List<int> PageIndexLists= new List<int> { };
+
+        /// <summary>
+        /// 页面信息
+        /// </summary>
+        public string PageRange = "1,3-4,10";
+
+        /// <summary>
+        /// 文档密码;
+        /// </summary>
+        public string Pawssword="";
+
+    }
+}

+ 22 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterExcelDialogModel.cs

@@ -0,0 +1,22 @@
+using ComPDFKit_Conversion.Options;
+using Microsoft.AppCenter.Crashes.Ingestion.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterExcelDialogModel : ConverterDialogsModel
+    {
+        public CPDFConvertExcelOptions excelOption=new CPDFConvertExcelOptions();
+
+        public CPDFConvertExcelOptions ExcelOptions(WorksheetOptions worksheetOptions = WorksheetOptions.ForEachPage,ContentOptions contentOptions = ContentOptions.AllContent) {
+
+            excelOption.ContentOpts= contentOptions;
+            excelOption.WorksheetOpts= worksheetOptions;
+            return excelOption;
+        }
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterHTMLDialogModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterHTMLDialogModel : ConverterDialogsModel
+    {
+    }
+}

+ 15 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterImgDialogModel.cs

@@ -0,0 +1,15 @@
+using ComPDFKit_Conversion.Converter;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterImgDialogModel : ConverterDialogsModel
+    {
+        public ImgType Type =ImgType.JPEG;
+        public string DPI = "50";
+    }
+}

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

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterPPTDialogModel : ConverterDialogsModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterRTFDialogModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterRTFDialogModel : ConverterDialogsModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterTextDialogModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterTextDialogModel : ConverterDialogsModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterWordDialogModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.ConverterDialogs
+{
+    public class ConverterWordDialogModel : ConverterDialogsModel
+    {
+    }
+}

+ 18 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogModel.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageBatchProcessingDialogModel
+    {
+        public static int BatchProcessingIndex = 0;
+
+        public static List<string> FilePaths=new List<string>();
+
+        public static List<string> GetBatchProcessing = new List<string> { "HomePageConverterDialog", "HomePageCompressDialog", "HomePageSetPasswordDialog", "HomePageWatermarkDialog", "HomePageBackgroundDialog", "HomePageHeaderFooterDialog", "HomePageBatesDialog", "HomePageDeleteSafetySettintgsDialog" };
+
+    }
+}

+ 22 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogModel.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageCompressDialogModel
+    {
+        public enum EnumQualityLevel
+        {
+            StatusLarge = 100,
+            StatusStandard = 80,
+            StatusDefault = 45,
+            StatusLittle = 40,
+            StatusMicro = 10
+        }
+
+        public EnumQualityLevel CompressQuality { get; set; } = EnumQualityLevel.StatusLittle;
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterCSVModel: HomePageConverterDialogModel
+    {
+    }
+}

+ 45 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogModel.cs

@@ -0,0 +1,45 @@
+using ComPDFKit_Conversion.Converter;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterDialogModel
+    {
+        public static List<string> GetConverter = new List<string> { "HomePageConverterWord","HomePageConverterExcel","HomePageConverterPPT","HomePageConverterRTF","HomePageConverterHTML"
+            ,"HomePageConverterText","HomePageConverterCSV","HomePageConverterImg" };
+
+        /// <summary>
+        /// 文档地址;
+        /// </summary>
+        public string InputPath = "";
+
+        /// <summary>
+        /// 输出地址;
+        /// </summary>
+        public string OutputPath = "";
+
+        /// <summary>
+        /// 进度;
+        /// </summary>
+        public OnProgress GetProgress = null;
+
+        /// <summary>
+        /// 页码 页码范围;
+        /// </summary>
+        public List<int> PageIndexLists = new List<int> { };
+
+        /// <summary>
+        /// 页面信息
+        /// </summary>
+        public string PageRange = "1,3-4,10";
+
+        /// <summary>
+        /// 文档密码;
+        /// </summary>
+        public string Pawssword = "";
+    }
+}

+ 22 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelModel.cs

@@ -0,0 +1,22 @@
+using ComPDFKit_Conversion.Options;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterExcelModel: HomePageConverterDialogModel
+    {
+        public CPDFConvertExcelOptions excelOption = new CPDFConvertExcelOptions();
+
+        public CPDFConvertExcelOptions ExcelOptions(WorksheetOptions worksheetOptions = WorksheetOptions.ForEachPage, ContentOptions contentOptions = ContentOptions.AllContent)
+        {
+
+            excelOption.ContentOpts = contentOptions;
+            excelOption.WorksheetOpts = worksheetOptions;
+            return excelOption;
+        }
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterHTMLModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterHTMLModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 15 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgModel.cs

@@ -0,0 +1,15 @@
+using ComPDFKit_Conversion.Converter;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterImgModel : HomePageConverterDialogModel
+    {
+        public ImgType Type = ImgType.JPEG;
+        public string DPI = "50";
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterPPTModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterPPTModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterRTFModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterRTFModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterTextModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterTextModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterWordModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 100 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogModel.cs

@@ -0,0 +1,100 @@
+using ComPDFKit.PDFDocument;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageSetPasswordDialogModel
+    {
+        public bool CanOpen { get; set; }
+
+        public bool CanEdit { get; set; }
+
+        public static string PasswordForOpen { get; set; }
+
+        public static string PasswordForEdit { get; set; }
+
+        public enum PrintMod
+        {
+            None,
+            LowDpi,
+            HighDpi
+        }
+
+        public enum ChangeMod
+        {
+            None,
+            ChangePage,
+            FormAndSignature,
+            AnnotAndFormAndSignature,
+            ExceptAbstrat
+        }
+
+        ///<returns>
+        ///生成带有指定权限的CPDFPermissionsInfo对象
+        ///</returns>
+        public CPDFPermissionsInfo CreatePermissionsInfo(PrintMod printMod, ChangeMod changeMod)
+        {
+            CPDFPermissionsInfo permissionsInfo = new CPDFPermissionsInfo();
+            switch (printMod)
+            {
+                case PrintMod.None:
+                    permissionsInfo.AllowsPrinting = false;
+                    permissionsInfo.AllowsHighQualityPrinting = false;
+                    break;
+                case PrintMod.LowDpi:
+                    permissionsInfo.AllowsPrinting = true;
+                    permissionsInfo.AllowsHighQualityPrinting = false;
+                    break;
+                case PrintMod.HighDpi:
+                    permissionsInfo.AllowsHighQualityPrinting = true;
+                    permissionsInfo.AllowsPrinting = true;
+                    break;
+                default:
+                    break;
+            }
+            switch (changeMod)
+            {
+                case ChangeMod.None:
+                    permissionsInfo.AllowsCopying = false;
+                    permissionsInfo.AllowsDocumentAssembly = false;
+                    permissionsInfo.AllowsCommenting = false;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = false;
+                    break;
+                case ChangeMod.ChangePage:
+                    permissionsInfo.AllowsCopying = false;
+                    permissionsInfo.AllowsDocumentAssembly = true;
+                    permissionsInfo.AllowsCommenting = false;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = false;
+                    break;
+                case ChangeMod.FormAndSignature:
+                    permissionsInfo.AllowsCopying = false;
+                    permissionsInfo.AllowsDocumentAssembly = false;
+                    permissionsInfo.AllowsCommenting = false;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = true;
+                    break;
+                case ChangeMod.AnnotAndFormAndSignature:
+                    permissionsInfo.AllowsCopying = false;
+                    permissionsInfo.AllowsDocumentAssembly = false;
+                    permissionsInfo.AllowsCommenting = true;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = true;
+                    break;
+                case ChangeMod.ExceptAbstrat:
+                    permissionsInfo.AllowsCopying = true;
+                    permissionsInfo.AllowsDocumentAssembly = true;
+                    permissionsInfo.AllowsCommenting = true;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = true;
+                    break;
+            }
+            return permissionsInfo;
+        }
+    }
+}

+ 23 - 21
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogModel.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Drawing.Printing;
 using System.Linq;
 using System.Numerics;
 using System.Runtime.Remoting.Channels;
@@ -15,25 +16,23 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
         public bool IsReverseOrder { get; set; }
         public EnumPaperSize EnumPaperSize { get; set; }
         public EnumPageRange EnumPageRange { get; set; }
+        public bool IsIndexReverse { get; set; }
         public EnumPrintOrientation EnumPrintOrientation { get; set; }
         public bool PrintWithAnnot { get; set; }
         public bool PrintWithForm { get; set; }
         public int Copies { get; set; }
         public string PrinterName { get; set; }
         public string CustomizeRange { get; set; }
-        public SizeSetttingsInfo SizeSetttingsInfo { get; set; }
-        public PostModSplitInfo PostModSplitInfo { get; set; }
-        public PostModTileInfo PostModTileInfo { get; set; }
-        public MutipleInfo MutipleInfo { get; set; }
-        public BookletInfo BookletInfo { get; set; }
+        public PrintMod printMod { get; set; }
     }
 
     public class HomePagePrinterDialogModel
     {
+      
     }
 
     public enum EnumPaperSize
-    {
+    { 
         StatusA3,
         StatusA4,
         StatusA5,
@@ -51,6 +50,8 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
         StatusCustomized
     }
 
+
+
     public enum EnumSizeType
     {
         StatusAdaptive,
@@ -69,8 +70,8 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
 
     public enum EnumPrintOrientation
     {
-        StatusHorizontal,
-        StatusVertical,
+        StatusLandscape,
+        StatusPortrait
     }
 
     public enum EnumPrintContent
@@ -80,12 +81,11 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
         StatusDocumentAndForm,
     }
 
-
     public enum EnumPrintMod
     {
         StatusSize,
         StatusPoster,
-        StatusMutiple,
+        StatusMultiple,
         StatusBooklet
     }
 
@@ -124,22 +124,22 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
     {
         StatusLeft,
         StatusRight,
-        StatusLeftTall,
-        StatusRightTall
     }
 
     public abstract class PrintMod { }
 
-    public class SizeSetttingsInfo : PrintMod
+    public class SizeInfo : PrintMod
     {
-        public EnumSizeType SizeType { get; set; }
+        public EnumSizeType EnumSizeType { get; set; }
         public int DisplayRatio { get; set; }
     }
 
 
     public class PosterInfo : PrintMod
     {
-        public bool CutMarks { get; set; }
+        public EnumPosterMod EnumPosterMod; 
+        public bool HasCutMarks { get; set; }
+        public bool HasLabel { get; set; }
         public double OverLap { get; set; }
     }
 
@@ -156,19 +156,21 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
         public int HeightPartNumber { get; set; }
     }
 
-    public class MutipleInfo : PrintMod
+    public class MultipleInfo : PrintMod
     {
-        public bool AutoRotate { set; get; }
+        public EnumPageOrder EnumPageOrder { set; get; }
         public EnumDisplayPageNumber EnumDisplayPageNumber { get; set; }
-        public int WidthPartNumber { get; set; }
-        public int HeightPartNumber { get; set; }
+        public int HorizontalPageNumber { get; set; }
+        public int VerticalPageNumber { get; set; }
+        public bool IsAutoRotate { get; set; }
     }
 
     public class BookletInfo : PrintMod
     {
         public EnumBookletSubset EnumBookletSubset { get; set; }
         public EnumBookletBinding EnumBookletBinding { get; set; }
-        public int BeginPageIndex { get; set; }
-        public int EndPageIndex { get; set; }
+        public int BeginPaperIndex { get; set; }
+        public int EndPaperIndex { get; set; }
+        public bool IsAutoRotate { get; set; }
     }
 }

+ 105 - 85
PDF Office/Model/DialogNames.cs

@@ -1,93 +1,93 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PDF_Office.Model
-{
-    /// <summary>
-    /// 记录弹窗的名称
-    /// </summary>
-    public static class DialogNames
-    {
-        /// <summary>
-        /// 文档解密弹窗 需要传参PDFDocument对象
-        /// </summary>
-        public static string VerifyPassWordDialog = "PassWordDialog";
-
-        /// <summary>
-        /// 全屏模式弹窗
-        /// </summary>
-        public static string FullScreenDialog = "FullScreenDialog";
-
-        /// <summary>
-        /// 压缩弹窗
-        /// </summary>
-        public static string CompressDialog = "CompressDialog";
-
-        /// <summary>
-        /// 解压缩弹窗
-        /// </summary>
-        public static string SetPasswordDialog = "SetPasswordDialog";
-
-        /// <summary>
-        /// 解压缩弹窗
-        /// </summary>
-        public static string CheckPasswordDialog = "CheckPasswordDialog";
-
-        /// <summary>
-        /// 删除安全性设置
-        /// </summary>
-        public static string DeleteSafetySettingsDialog = "DeleteSafetySettingsDialog";
-
-        /// <summary>
-        /// 进度条
-        /// </summary>
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model
+{
+    /// <summary>
+    /// 记录弹窗的名称
+    /// </summary>
+    public static class DialogNames
+    {
+        /// <summary>
+        /// 文档解密弹窗 需要传参PDFDocument对象
+        /// </summary>
+        public static string VerifyPassWordDialog = "PassWordDialog";
+
+        /// <summary>
+        /// 全屏模式弹窗
+        /// </summary>
+        public static string FullScreenDialog = "FullScreenDialog";
+
+        /// <summary>
+        /// 压缩弹窗
+        /// </summary>
+        public static string CompressDialog = "CompressDialog";
+
+        /// <summary>
+        /// 解压缩弹窗
+        /// </summary>
+        public static string SetPasswordDialog = "SetPasswordDialog";
+
+        /// <summary>
+        /// 解压缩弹窗
+        /// </summary>
+        public static string CheckPasswordDialog = "CheckPasswordDialog";
+
+        /// <summary>
+        /// 删除安全性设置
+        /// </summary>
+        public static string DeleteSafetySettingsDialog = "DeleteSafetySettingsDialog";
+
+        /// <summary>
+        /// 进度条
+        /// </summary>
         public static string CompressProgressBarDialog = "CompressProgressBarDialog";
 
-        /// <summary>
-        /// 页面编辑- 提取弹窗
-        /// </summary>
-        public static string ExtractDialog = "ExtractDialog";
-
-        /// <summary>
-        /// 页面编辑-拆分弹窗
-        /// </summary>
-        public static string SplitDialog = "SplitDialog";
-
-        /// <summary>
-        /// 页面编辑-插入弹窗
-        /// </summary>
-        public static string InsertDialog = "InsertDialog";
-
-        ///<summary>
-        ///主页工具-提取弹窗
-        /// </summary>
-        public static string HomePageExtractDialog = "HomePageExtractDialog";
-
-        ///<summary>
-        ///主页工具-插入弹窗
-        /// </summary
-        public static string HomePageInsertDialog = "HomePageInsertDialog";
-
-        ///<summary>
-        ///主页工具-拆分弹窗
-        /// </summary>
-        public static string HomePageSplitDialog = "HomePageSplitDialog";
-
-        ///<summary>
-        ///主页工具-打印弹窗
-        /// </summary>
+        /// <summary>
+        /// 页面编辑- 提取弹窗
+        /// </summary>
+        public static string ExtractDialog = "ExtractDialog";
+
+        /// <summary>
+        /// 页面编辑-拆分弹窗
+        /// </summary>
+        public static string SplitDialog = "SplitDialog";
+
+        /// <summary>
+        /// 页面编辑-插入弹窗
+        /// </summary>
+        public static string InsertDialog = "InsertDialog";
+
+        ///<summary>
+        ///主页工具-提取弹窗
+        /// </summary>
+        public static string HomePageExtractDialog = "HomePageExtractDialog";
+
+        ///<summary>
+        ///主页工具-插入弹窗
+        /// </summary
+        public static string HomePageInsertDialog = "HomePageInsertDialog";
+
+        ///<summary>
+        ///主页工具-拆分弹窗
+        /// </summary>
+        public static string HomePageSplitDialog = "HomePageSplitDialog";
+
+        ///<summary>
+        ///主页工具-打印弹窗
+        /// </summary>
         public static string HomePagePrinterDialog = "HomePagePrinterDialog";
 
-        ///<summary>
-        ///打印弹窗-打印页面设置
-        /// </summary>
+        ///<summary>
+        ///打印弹窗-打印页面设置
+        /// </summary>
         public static string HomePagePrinterPageSetDialog = "HomePagePrinterPageSetDialog";
 
-        ///<summary>
-        ///主页工具-图片转PDF弹窗
+        ///<summary>
+        ///主页工具-图片转PDF弹窗
         /// </summary>
         public static string HomePagePictureToPDFDialog = "HomePagePictureToPDFDialog";
 
@@ -95,5 +95,25 @@ namespace PDF_Office.Model
         ///BOTA-书签-添加书签弹窗
         /// </summary>
         public static string AddBookmarkDialog = "AddBookmarkDialog";
-    }
+        ///<summary>
+        ///主页工具-PDF批量工具
+        /// </summary>
+        public static string HomePageBatchProcessingDialog ="HomePageBatchProcessingDialog";
+
+        ///<summary>
+        ///转档-CSVD,PPT,Text,Word,HTML,Img,RTF,Excel弹窗
+        /// </summary>
+        public static string ConverterCSVDialog = "ConverterCSVDialog";
+        public static string ConverterPPTDialog = "ConverterPPTDialog";
+        public static string ConverterTextDialog = "ConverterTextDialog";
+        public static string ConverterWordDialog = "ConverterWordDialog";
+        public static string ConverterHTMLDialog = "ConverterHTMLDialog";
+        public static string ConverterImgDialog = "ConverterImgDialog";
+        public static string ConverterRTFDialog = "ConverterRTFDialog";
+        public static string ConverterExcelDialog = "ConverterExcelDialog";
+        ///<summary>
+        ///转档进度条弹窗
+        /// </summary>
+        public static string ConverterProgressBarDialog = "ConverterProgressBarDialog";
+    }
 }

+ 12 - 0
PDF Office/Model/ParameterNames.cs

@@ -35,6 +35,8 @@ namespace PDF_Office.Model
 
         public static string InsertType_Custom = "Insert_Custom";
 
+        public static string BatchProcessing_Name = "BatchProcessing_Name";
+
         /// <summary>
         /// 书签
         /// </summary>
@@ -58,5 +60,15 @@ namespace PDF_Office.Model
         /// 用于弹窗传参的数据模型
         /// </summary>
         public static string DataModel = "Model";
+
+        /// <summary>
+        /// 转换类型
+        /// </summary>
+        public static string ConverterType = "ConverterType";
+
+        /// <summary>
+        /// 用于转换数据模型
+        /// </summary>
+        public static string ConverterTypeModel = "ConverterTypeModel";
     }
 }

+ 411 - 65
PDF Office/PDF Office.csproj

@@ -28,6 +28,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <Prefer32Bit>false</Prefer32Bit>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -37,6 +38,7 @@
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="ComOCRKit.Desk, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
@@ -193,6 +195,9 @@
     <Compile Include="CustomControl\ColorDropBoxPop.xaml.cs">
       <DependentUpon>ColorDropBoxPop.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\CommonWritableComboBox.xaml.cs">
+      <DependentUpon>CommonWritableComboBox.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\CustomIconToggleBtn.cs" />
     <Compile Include="CustomControl\DialogContent.cs" />
     <Compile Include="CustomControl\IconAndTextTabItem.cs" />
@@ -217,8 +222,10 @@
     <Compile Include="DataConvert\PropertyPanelVisible.cs" />
     <Compile Include="DataConvert\StringToVisibleConvert.cs" />
     <Compile Include="DataConvert\UnVisivleConvert.cs" />
+    <Compile Include="EventAggregators\EditToolsEvent.cs" />
     <Compile Include="EventAggregators\PageEditNotifyEvent.cs" />
     <Compile Include="EventAggregators\PageEditRefreshEvent.cs" />
+    <Compile Include="Helper\ConverterHelper.cs" />
     <Compile Include="Helper\AdvancedInvokeCommandAction.cs" />
     <Compile Include="Helper\ArrowHelper.cs" />
     <Compile Include="Helper\HomePageEditHelper.cs" />
@@ -235,6 +242,27 @@
     <Compile Include="CustomControl\LoadingControl.xaml.cs">
       <DependentUpon>LoadingControl.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterCSVDialogModel.cs" />
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterDialogsModel.cs" />
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterExcelDialogModel.cs" />
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterHTMLDialogModel.cs" />
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterImgDialogModel.cs" />
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterPPTDialogModel.cs" />
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterRTFDialogModel.cs" />
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterTextDialogModel.cs" />
+    <Compile Include="Model\Dialog\ConverterDialogs\ConverterWordDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSVModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterExcelModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterHTMLModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterImgModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterPPTModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterRTFModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterTextModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWordModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePagePictureToPDFDialogModel.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\CompressDialogModel\CompressDialogModel.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\SaftyDialogs\CheckPasswordDialogModel.cs" />
@@ -262,17 +290,43 @@
       <AutoGen>True</AutoGen>
     </Compile>
     <Compile Include="ViewModels\BOTA\BookmarkContentViewModel.cs" />
-    <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
-    <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\AddBookmarkDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\BookmarkInfoDialogViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundContentViewModel.cs" />
+    <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
+    <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterProgressBarDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterCSVDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterExcelDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterHTMLDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterImgDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterPPTDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterRTFDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterTextDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterWordDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSVViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterExcelViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterImgViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWordViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundCreateBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundCreateColorContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundCreateFileContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundTemplateListBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundTemplateListColorContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundTemplateListFileContentViewModel.cs" />
+    <Compile Include="ViewModels\Tools\ConverterBarContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModBookletContentViewModel.cs" />
-    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModMutipleContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModMultipleContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModPosterContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModSizeContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterPageSetDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\ModInfoSendEvent.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageSplitDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\PageEditDialogs\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\PageEditDialogs\InsertDialogViewModel.cs" />
@@ -320,6 +374,13 @@
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Function.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Properties.cs" />
     <Compile Include="ViewModels\Tools\ToolsBarContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkCreateBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkCreateFileContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkCreateTextContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListFileContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListTextContentViewModel.cs" />
     <Compile Include="Views\BOTA\BookmarkContent.xaml.cs">
       <DependentUpon>BookmarkContent.xaml</DependentUpon>
     </Compile>
@@ -329,6 +390,33 @@
     <Compile Include="Views\BottomToolContent.xaml.cs">
       <DependentUpon>BottomToolContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterCSVDialog.xaml.cs">
+      <DependentUpon>ConverterCSVDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterExcelDialog.xaml.cs">
+      <DependentUpon>ConverterExcelDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterHTMLDialog.xaml.cs">
+      <DependentUpon>ConverterHTMLDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterImgDialog.xaml.cs">
+      <DependentUpon>ConverterImgDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterPPTDialog.xaml.cs">
+      <DependentUpon>ConverterPPTDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterProgressBarDialog.xaml.cs">
+      <DependentUpon>ConverterProgressBarDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterRTFDialog.xaml.cs">
+      <DependentUpon>ConverterRTFDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterTextDialog.xaml.cs">
+      <DependentUpon>ConverterTextDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ConverterDialogs\ConverterWordDialog.xaml.cs">
+      <DependentUpon>ConverterWordDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\BOTA\AddBookmarkDialog.xaml.cs">
       <DependentUpon>AddBookmarkDialog.xaml</DependentUpon>
     </Compile>
@@ -338,6 +426,30 @@
     <Compile Include="Views\Dialog\FullScreenWindow.xaml.cs">
       <DependentUpon>FullScreenWindow.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialog.xaml.cs">
+      <DependentUpon>HomePageBatchProcessingDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialog.xaml.cs">
+      <DependentUpon>HomePageCompressDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSV.xaml.cs">
+      <DependentUpon>HomePageConverterCSV.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterDialog.xaml.cs">
+      <DependentUpon>HomePageConverterDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterExcel.xaml.cs">
+      <DependentUpon>HomePageConverterExcel.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterImg.xaml.cs">
+      <DependentUpon>HomePageConverterImg.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWord.xaml.cs">
+      <DependentUpon>HomePageConverterWord.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialog.xaml.cs">
+      <DependentUpon>HomePageSetPasswordDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageExtractDialog.xaml.cs">
       <DependentUpon>HomePageExtractDialog.xaml</DependentUpon>
     </Compile>
@@ -350,8 +462,8 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModBookletContent.xaml.cs">
       <DependentUpon>HomePagePrinterModBookletContent.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModMutipleContent.xaml.cs">
-      <DependentUpon>HomePagePrinterModMutipleContent.xaml</DependentUpon>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModMultipleContent.xaml.cs">
+      <DependentUpon>HomePagePrinterModMultipleContent.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModPosterContent.xaml.cs">
       <DependentUpon>HomePagePrinterModPosterContent.xaml</DependentUpon>
@@ -410,6 +522,48 @@
     <Compile Include="Views\HomePanel\CloudDrive\CloudDriveContent.xaml.cs">
       <DependentUpon>CloudDriveContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundContent.xaml.cs">
+      <DependentUpon>BackgroundContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkContent.xaml.cs">
+      <DependentUpon>WatermarkContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkCreateBaseContent.xaml.cs">
+      <DependentUpon>WatermarkCreateBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkCreateFileContent.xaml.cs">
+      <DependentUpon>WatermarkCreateFileContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkCreateTextContent.xaml.cs">
+      <DependentUpon>WatermarkCreateTextContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkTemplateListBaseContent.xaml.cs">
+      <DependentUpon>WatermarkTemplateListBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkTemplateListFileContent.xaml.cs">
+      <DependentUpon>WatermarkTemplateListFileContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkTemplateListTextContent.xaml.cs">
+      <DependentUpon>WatermarkTemplateListTextContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundCreateBaseContent.xaml.cs">
+      <DependentUpon>BackgroundCreateBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundCreateColorContent.xaml.cs">
+      <DependentUpon>BackgroundCreateColorContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundCreateFileContent.xaml.cs">
+      <DependentUpon>BackgroundCreateFileContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundTemplateListBaseContent.xaml.cs">
+      <DependentUpon>BackgroundTemplateListBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundTemplateListColorContent.xaml.cs">
+      <DependentUpon>BackgroundTemplateListColorContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundTemplateListFileContent.xaml.cs">
+      <DependentUpon>BackgroundTemplateListFileContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\CloudDrive\CloudFilesContent.xaml.cs">
       <DependentUpon>CloudFilesContent.xaml</DependentUpon>
     </Compile>
@@ -501,6 +655,9 @@
     <Compile Include="Views\Tools\AnnotToolContent.xaml.cs">
       <DependentUpon>AnnotToolContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Tools\ConverterBarContent.xaml.cs">
+      <DependentUpon>ConverterBarContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Tools\ToolsBarContent.xaml.cs">
       <DependentUpon>ToolsBarContent.xaml</DependentUpon>
     </Compile>
@@ -519,6 +676,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="CustomControl\CommonWritableComboBox.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="CustomControl\LoadingControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -623,6 +784,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterCSVDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\BOTA\AddBookmarkDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -635,79 +800,75 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageExtractDialog.xaml">
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterExcelDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageInsertDialog.xaml">
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterHTMLDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePictureToPDFDialog.xaml">
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterImgDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModBookletContent.xaml">
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterPPTDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModMutipleContent.xaml">
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterProgressBarDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModPosterContent.xaml">
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterRTFDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModSizeContent.xaml">
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterTextDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterPageSetDialog.xaml">
+    <Page Include="Views\Dialog\ConverterDialogs\ConverterWordDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageSplitDialog.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\PageEditDialogs\ExtractDialog.xaml">
-      <Generator>MSBuild:Compile</Generator>
+    <Page Include="Views\Dialog\PageEditDialogs\SplitDialog.xaml">
       <SubType>Designer</SubType>
-    </Page>
-    <Page Include="Views\Dialog\PageEditDialogs\InsertDialog.xaml">
       <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
     </Page>
-    <Page Include="Views\Dialog\PageEditDialogs\SplitDialog.xaml">
-      <Generator>MSBuild:Compile</Generator>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialog.xaml">
       <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDialog.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSV.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\ToolsDialogs\CompressDialogs\CompressDialog.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\ToolsDialogs\CompressDialogs\CompressProgressBarDialog.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterExcel.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\ToolsDialogs\SaftyDialogs\CheckPasswordDialog.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterImg.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\ToolsDialogs\SaftyDialogs\DeleteSafetySettingsDialog.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWord.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\ToolsDialogs\SaftyDialogs\SetPasswordDialog.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\VerifyPassWordDialog.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageExtractDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -728,84 +889,73 @@
       <Generator>MSBuild:Compile</Generator>
     </Page>
     <Page Include="Views\HomeContent.xaml">
+      <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageInsertDialog.xaml">
       <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
     </Page>
     <Page Include="Views\HomePanel\CloudDrive\CloudDriveContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\CloudDrive\CloudFilesContent.xaml">
-      <Generator>MSBuild:Compile</Generator>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePictureToPDFDialog.xaml">
       <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\HomeCloudContent.xaml">
+    <Page Include="Views\HomePanel\CloudDrive\CloudFilesContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\HomeGuidContent.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModBookletContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\PDFTools\PDFToolItem.xaml">
-      <Generator>MSBuild:Compile</Generator>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModMultipleContent.xaml">
       <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\HomeToolsContent.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModPosterContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\PDFTools\PDFToolsContent.xaml">
-      <Generator>MSBuild:Compile</Generator>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModSizeContent.xaml">
       <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\PDFTools\QuickToolsContent.xaml">
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterPageSetDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\PromotionContent.xaml">
-      <Generator>MSBuild:Compile</Generator>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageSplitDialog.xaml">
       <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\HomePanel\RecentFiles\DocItemControl.xaml">
+    <Page Include="Views\Dialog\PageEditDialogs\ExtractDialog.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
-    <Page Include="Views\HomePanel\RecentFiles\DocItemListViewControl.xaml">
+    <Page Include="Views\Dialog\PageEditDialogs\InsertDialog.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
-    <Page Include="Views\HomePanel\RecentFiles\RecentFilesView.xaml">
-      <Generator>MSBuild:Compile</Generator>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDialog.xaml">
       <SubType>Designer</SubType>
     </Page>
-    <Page Include="Views\MainContent.xaml">
+    <Page Include="Views\PropertyPanel\AnnotPanel\CommonControls\ColorContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\MainWindow.xaml">
-      <Generator>MSBuild:Compile</Generator>
+    <Page Include="Views\Dialog\ToolsDialogs\CompressDialogs\CompressDialog.xaml">
       <SubType>Designer</SubType>
-    </Page>
-    <Compile Include="App.xaml.cs">
-      <DependentUpon>App.xaml</DependentUpon>
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ViewModels\HomeContentViewModel.cs" />
-    <Compile Include="ViewModels\MainWindowViewModel.cs" />
-    <Compile Include="ViewModels\ViewContentViewModel.cs" />
-    <Compile Include="Views\HomeContent.xaml.cs">
-      <DependentUpon>HomeContent.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="Views\MainWindow.xaml.cs">
-      <DependentUpon>MainWindow.xaml</DependentUpon>
-      <SubType>Code</SubType>
-    </Compile>
-    <Page Include="Views\PageEdit\PageEditContent.xaml">
       <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\ToolsDialogs\CompressDialogs\CompressProgressBarDialog.xaml">
       <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\CommonControls\ColorContent.xaml">
+    <Page Include="Views\Dialog\ToolsDialogs\SaftyDialogs\CheckPasswordDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -817,10 +967,22 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\ToolsDialogs\SaftyDialogs\DeleteSafetySettingsDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\FreetextAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\ToolsDialogs\SaftyDialogs\SetPasswordDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\VerifyPassWordDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\ImageAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -829,24 +991,58 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EditTools\Background\BackgroundContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\StampAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkCreateBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkCreateFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\TextAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkCreateTextContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\TextEditProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkTemplateListBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\CommonControls\SlidContent.xaml">
       <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkTemplateListFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkTemplateListTextContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Background\BackgroundCreateBaseContent.xaml">
       <SubType>Designer</SubType>
     </Page>
     <Page Include="Views\PropertyPanel\PropertyPanelContent.xaml">
@@ -861,6 +1057,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EditTools\Background\BackgroundCreateColorContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Background\BackgroundCreateFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\ViewModular\ThemesContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -869,10 +1073,92 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EditTools\Background\BackgroundTemplateListBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Background\BackgroundTemplateListColorContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Background\BackgroundTemplateListFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\HomePanel\HomeCloudContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\HomePanel\HomeGuidContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\HomePanel\PDFTools\PDFToolItem.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\HomePanel\HomeToolsContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\HomePanel\PDFTools\PDFToolsContent.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\HomePanel\PDFTools\QuickToolsContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\HomePanel\PromotionContent.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\HomePanel\RecentFiles\DocItemControl.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\HomePanel\RecentFiles\DocItemListViewControl.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\HomePanel\RecentFiles\RecentFilesView.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\MainContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\MainWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ViewModels\HomeContentViewModel.cs" />
+    <Compile Include="ViewModels\MainWindowViewModel.cs" />
+    <Compile Include="ViewModels\ViewContentViewModel.cs" />
+    <Compile Include="Views\HomeContent.xaml.cs">
+      <DependentUpon>HomeContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="Views\PageEdit\PageEditContent.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\Tools\AnnotToolContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Tools\ConverterBarContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Tools\ToolsBarContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -899,12 +1185,15 @@
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     </None>
+    <None Include="source\AnalysisWord\Res\word\_rels\document.xml.rels" />
+    <Content Include="source\AnalysisWord\Res\_rels\.rels">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
-    <Folder Include="Views\Dialog\Convertor\" />
     <Folder Include="Views\Edit\" />
     <Folder Include="Views\Forms\" />
     <Folder Include="Views\Scan\" />
@@ -964,6 +1253,63 @@
     <Resource Include="Resources\ToolBarIcon\MyTools\Stamp.png" />
     <Resource Include="Resources\ToolBarIcon\MyTools\Textbox.png" />
     <Resource Include="Resources\ToolBarIcon\MyTools\wavyline2.png" />
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout1.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout10.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout11.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout2.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout3.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout4.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout5.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout6.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout7.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout8.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideLayouts\slideLayout9.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\slideMaster1.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\theme1.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisPPT\Res\thumbnail.jpeg">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisWord\Res\docProps\app.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="source\AnalysisWord\Res\docProps\core.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Resource Include="source\AnalysisWord\Res\word\document.xml" />
+    <Resource Include="source\AnalysisWord\Res\word\document0.xml" />
+    <Resource Include="source\AnalysisWord\Res\word\endnotes.xml" />
+    <Resource Include="source\AnalysisWord\Res\word\footnotes.xml" />
+    <Resource Include="source\AnalysisWord\Res\word\settings.xml" />
+    <Resource Include="source\AnalysisWord\Res\word\theme\theme1.xml" />
+    <Content Include="source\AnalysisWord\Res\[Content_Types].xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
     <Resource Include="Resources\BOTA\empty_bookmark.png" />
     <Resource Include="Resources\PropertyPanel\colorIcon.png" />
     <Content Include="SystemService\PreviewHandler.dll">

+ 2 - 2
PDF Office/SDKLisence.xml

@@ -3,8 +3,8 @@
 	devSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYSXB8erGstkUyaynN7k8ocNCYAAzc9CPxiym2TlqeSUWpLOaOv47bs7x+UqfQzn9hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSnkBnoGhqnvZdAqbtp5o0JTKDl1EzWv/F/0Gw7Q02pypAMFoEMtjKxkVmy+liLW9u9"
 	userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs="
 	userSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4ivEHOmPIqbfhpDnKKj+7Ymj2rXQvfZRmke06HMV+3tt064G64WjPW8+EbGCNZaAh1hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1FKJi6HYB+DuugQyaqI2prfej861QnJrU4s2T/npZK/"
-	ConverterDevKey="mDDCTNY5rV2+FUj2JESUBruJ0643Tv7rNuxACu6g3L/0guIw1r8zZB+o3aw3rs4rrOThmxBXpEDcItvyGx096mF/3Ixg7aD6QZk5HvBEScIPerdM3KnhgwMwCjE0DYOSMCRwAhbA2xjXfXgT5VVo7JZroKOGQB5Qmf2kLl5nQuU="
-	ConverterDevSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4g3S5AixMY+3TX1FpQaugG9sTsnCq4QxIEDzyAI3s3dWjNe3wDsMrmFq51HtjPa2tSFAoV6NtcUJC8skonXVk7kMv7C2jvq4o0q6sQtN3jR42k0n/LkN5UfbQ5Lfel4OfZrk7dh2/DUR87Ps4vBX1hrYkwcNWVMyYvggPV2rTFvfawopGIC034QzjthmhwwX90="
+	ConverterDevKey="Eahwo7OZAYHJaCF7TJQYKSVqC62MzfBdllVXnC5BRR5BQFDKnQ1FJtCRVdug+VNg/ti+/DeA5Sq4IH2CBpQjAZst5705uk5Sz0ZwRu8Qdn9HFGwh2pG6dJEIrl7lOccoZS6+1IxgOTcTeHqYpym3NsmtbhBWE848Pvme3scpW28="
+	ConverterDevSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iccr16WMBclnQACarlyblNUvAm/S8uFbhXMvxwgBSgULSsrbuyF/SIZ3I+dl0qU8EiR4IKrcJxus3VRNu+jx8P7CGq2BlSjPVXRHBI1lV8ukpCIUGmcK+P+Z0QbYdkAHAm6NPgs2c4tp1jOFPPbnUkTtX7riDb9xRCx1YNm3/+xd96PzrVCcmtTizZP+elkr8="
 	ConverterUserkey=" WLUHzXhndQKyrTJVzvZ+dvPXDQDZeJpcSvklX3GJwRX4+urd8eQskYgbeCf0NXLZ/qJkS/k10x+qGad34i4v5rI/ASFIx901c/Nw5C0YJMH7X87dib141tdAmSmQhnKLO5TBi4FiAidboyvnLFLrYGMmS2kLQOXFPwPj5zQUv5A="
 	ConverterUserSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iK16EcneqBPRe2eKQLuJXpA79IONX9GVI/Ap3uWzMcNWaitc2UB6gDeexJXFPVaXOFAoV6NtcUJC8skonXVk7k/oKTJGcYKLPGdXenrzHolQ==">
 </Lisences>

+ 64 - 0
PDF Office/Styles/CheckBoxStyle.xaml

@@ -105,4 +105,68 @@
             </Trigger>
         </ControlTemplate.Triggers>
     </ControlTemplate>
+    <Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
+        <Setter Property="SnapsToDevicePixels" Value="true" />
+        <Setter Property="OverridesDefaultStyle" Value="False" />
+
+        <Setter Property="Height" Value="22" />
+        <Setter Property="IsChecked" Value="False" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="CheckBox">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <Grid Width="{TemplateBinding Height}" Height="{TemplateBinding Height}">
+                            <Rectangle
+                                x:Name="CheckBoxRectangle"
+                                Fill="White"
+                                Opacity="0.3"
+                                RadiusX="2"
+                                RadiusY="2" />
+                            <Rectangle
+                                x:Name="CheckBoxRectangleOut"
+                                RadiusX="1"
+                                RadiusY="2"
+                                Stroke="Black"
+                                StrokeThickness="1" />
+                            <Grid
+                                x:Name="CheckedMark"
+                                Width="20"
+                                Height="20"
+                                Visibility="Collapsed">
+                                <Path
+                                    Data="M1,9 L10,17"
+                                    SnapsToDevicePixels="False"
+                                    Stroke="White"
+                                    StrokeThickness="3" />
+                                <Path
+                                    Data="M8,17 L20,4"
+                                    SnapsToDevicePixels="False"
+                                    Stroke="White"
+                                    StrokeThickness="3" />
+                            </Grid>
+                        </Grid>
+                        <TextBlock
+                            Grid.Column="1"
+                            Margin="14,0,0,0"
+                            VerticalAlignment="Center"
+                            FontSize="18"
+                            Foreground="Black"
+                            Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" />
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="CheckedMark" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="CheckBoxRectangle" Property="Fill" Value="#FF00A8E0" />
+                            <Setter TargetName="CheckBoxRectangle" Property="Opacity" Value="1" />
+                            <Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 </ResourceDictionary>

+ 36 - 1
PDF Office/Styles/CustomBtnStyle.xaml

@@ -385,4 +385,39 @@
             </Setter.Value>
         </Setter>
     </Style>
-</ResourceDictionary>
+
+
+    <Style x:Key="HomePageCompressBtn" TargetType="Button">
+        <Setter Property="Background" Value="White"/>
+        <Setter Property="BorderBrush" Value="White"/>
+        <Setter Property="HorizontalAlignment" Value="Center"/>
+
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border x:Name="border" BorderBrush="White" BorderThickness="1,1,1,1" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" >
+                        <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter Property="Background" TargetName="border" Value="#1A000000"/>
+                            <Setter Property="BorderBrush" TargetName="border" Value= "AntiqueWhite"/>
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter Property="Background" TargetName="border" Value="#26000000"/>
+                            <Setter Property="BorderBrush" TargetName="border" Value= "WhiteSmoke"/>
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter Property="Background" TargetName="border" Value="White"/>
+                            <Setter Property="BorderBrush" TargetName="border" Value="White"/>
+                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="Black"/>
+                            <Setter Property="Opacity" TargetName="contentPresenter" Value="1"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>
+    
+    

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

@@ -0,0 +1,217 @@
+using ComPDFKit.PDFDocument;
+using ComPDFKit_Conversion.Options;
+using ComPDFKitViewer.PdfViewer;
+using Microsoft.Office.Interop.Excel;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Controls;
+using System.Windows.Forms;
+using static Dropbox.Api.Files.FileCategory;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterCSVDialogViewModel : BindableBase,IDialogAware
+    {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        public ConverterCSVDialogModel ConverterCSVModel = new ConverterCSVDialogModel();
+
+        public CPDFViewer currentViewer;
+
+        public IDialogService dialogs;
+
+        public string CurrentPageIndex="1";
+
+        public string PageRangeText { set; get; } = "0";
+
+        public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
+        public ConverterCSVDialogViewModel(IDialogService dialogService)
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            ConverterCommnad = new DelegateCommand(converter);
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            dialogs = dialogService;
+        }
+
+        #region 逻辑函数
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                   this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private  void converter()
+        {
+            FolderBrowserDialog dlg = new FolderBrowserDialog();
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                ConverterCSVModel.OutputPath =dlg.SelectedPath.Trim();
+            }
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterCSVModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterCSVModel.PageIndexLists, ConverterCSVModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.ConverterType,"CSV");
+            value.Add(ParameterNames.ConverterTypeModel, ConverterCSVModel);
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+            dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
+            {
+
+            });
+            
+        }
+
+        private void radiobutton(string e)
+        {
+            string radioButton = e;
+            if (radioButton != null)
+            {
+                switch (radioButton)
+                {
+                    case "ForEachPageRadioBtn":
+                        break;
+                    case "OnlyTableRadioBtn":
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        }
+        #endregion
+
+        #region 构架行为
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            CPDFViewer pdfViewer = null;
+            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            if (pdfViewer != null)
+            {
+                currentViewer = pdfViewer;
+                ConverterCSVModel.InputPath = pdfViewer.Document.FilePath;
+                FileInfo fileinfo = new FileInfo(ConverterCSVModel.InputPath);
+                ConverterCSVModel.OutputPath = fileinfo.DirectoryName;
+            }
+        }
+        #endregion
+    }
+}

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

@@ -0,0 +1,218 @@
+using ComPDFKit_Conversion.Options;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterExcelDialogViewModel : BindableBase, IDialogAware
+    {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        public ConverterExcelDialogModel ConverterExcelModel = new ConverterExcelDialogModel();
+
+        public CPDFViewer currentViewer;
+
+        public string CurrentPageIndex = "1";
+
+        public IDialogService dialogs;
+
+        public string PageRangeText { set; get; } = "0";
+
+        public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
+        public ConverterExcelDialogViewModel(IDialogService dialogService)
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            ConverterCommnad = new DelegateCommand(converter);
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            dialogs = dialogService;
+        }
+        #region 逻辑函数
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private void converter()
+        {
+            FolderBrowserDialog dlg = new FolderBrowserDialog();
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                ConverterExcelModel.OutputPath = dlg.SelectedPath.Trim();
+            }
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterExcelModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterExcelModel.PageIndexLists, ConverterExcelModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            if (ConverterExcelModel.excelOption == null) {
+                ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions();
+            }
+
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.ConverterType, "Excel");
+            value.Add(ParameterNames.ConverterTypeModel, ConverterExcelModel);
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+            dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
+            {
+
+            });
+            
+        }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+
+        private void radiobutton(string e) {
+            string radioButton=e;
+            if (radioButton != null) {
+                switch (radioButton)
+                {
+                    case "ForEachPageRadioBtn":
+                        ConverterExcelModel.excelOption=ConverterExcelModel.ExcelOptions();
+                        break;
+                    case "ForTheDocRadioBtn":
+                        ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument);
+                        break;
+                    case "OnlyTableRadioBtn":
+                        ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachTable, ContentOptions.OnlyTable);
+                        break;
+                    default:
+                        break;
+                }
+            }
+        
+        }
+        #endregion
+
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            CPDFViewer pdfViewer = null;
+            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            if (pdfViewer != null)
+            {
+                currentViewer = pdfViewer;
+                ConverterExcelModel.InputPath = pdfViewer.Document.FilePath;
+                FileInfo fileinfo = new FileInfo(ConverterExcelModel.InputPath);
+                ConverterExcelModel.OutputPath = fileinfo.DirectoryName;
+            }
+        }
+        #endregion
+    }
+}

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

@@ -0,0 +1,192 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterHTMLDialogViewModel : BindableBase, IDialogAware
+    {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        public ConverterHTMLDialogModel ConverterHTMLModel = new ConverterHTMLDialogModel();
+
+        public CPDFViewer currentViewer;
+
+        public IDialogService dialogs;
+
+        public string CurrentPageIndex = "1";
+
+        public string PageRangeText { set; get; } = "0";
+
+        public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
+        public ConverterHTMLDialogViewModel(IDialogService dialogService)
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            dialogs = dialogService;
+
+        }
+        #region 逻辑函数
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private void converter()
+        {
+
+            FolderBrowserDialog dlg = new FolderBrowserDialog();
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                ConverterHTMLModel.OutputPath = dlg.SelectedPath.Trim();
+            }
+         
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterHTMLModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterHTMLModel.PageIndexLists, ConverterHTMLModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            //result = await ConverterHelper.TxtConvert(ConverterTextModel.InputPath, ConverterTextModel.OutputPath, ConverterTextModel.GetProgress, ConverterTextModel.PageIndexLists, ConverterTextModel.Pawssword);
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.ConverterType, "HTML");
+            value.Add(ParameterNames.ConverterTypeModel, ConverterHTMLModel);
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+            dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
+            {
+
+            });
+        }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+        #endregion
+
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            CPDFViewer pdfViewer = null;
+            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            if (pdfViewer != null)
+            {
+                currentViewer = pdfViewer;
+                ConverterHTMLModel.InputPath = pdfViewer.Document.FilePath;
+                FileInfo fileinfo = new FileInfo(ConverterHTMLModel.InputPath);
+                ConverterHTMLModel.OutputPath = fileinfo.DirectoryName;
+            }
+        }
+        #endregion
+    }
+}

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

@@ -0,0 +1,303 @@
+using ComPDFKit_Conversion.Converter;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterImgDialogViewModel : BindableBase, IDialogAware
+    {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        public ConverterImgDialogModel ConverterImgModel = new ConverterImgDialogModel();
+
+        public CPDFViewer currentViewer;
+
+        public string CurrentPageIndex = "1";
+
+        public IDialogService dialogs;
+
+        public string PageRangeText { set; get; } = "0";
+
+        public string PageRangeSelectIndex { set; get; } = "0";
+
+        public List<string> ImageTypeFamily { set; get; } =new List<string>();
+
+        private int imageTypeSelectedIndex;
+        /// <summary>
+        /// 图像类型的下拉框索引值
+        /// 如果只需要根据选中项的索引判断,则可以不用再采取command绑定命令的形式,而是可以通过一个int类型属性绑定的形式,然后在set方法里进行处理
+        /// </summary>
+        public int ImageTypeSelectedIndex
+        {
+            get { return imageTypeSelectedIndex; }
+            set
+            {
+                SetProperty(ref imageTypeSelectedIndex, value);
+                
+                UpdateImageType(ImageTypeSelectedIndex);
+            }
+        }
+
+        private int imageDPISelectedIndex;
+        /// <summary>
+        /// 图像类型的下拉框索引值
+        /// 如果只需要根据选中项的索引判断,则可以不用再采取command绑定命令的形式,而是可以通过一个int类型属性绑定的形式,然后在set方法里进行处理
+        /// </summary>
+        public int ImageDPISelectedIndex
+        {
+            get { return imageDPISelectedIndex; }
+            set
+            {
+                SetProperty(ref imageDPISelectedIndex, value);
+                
+                UpdateImageDPI(ImageDPISelectedIndex);
+            }
+        }
+
+        private void SetImageTypeOrigin()
+        {
+            this.ImageTypeFamily.Add("JPEG");
+            this.ImageTypeFamily.Add("JPG");
+            this.ImageTypeFamily.Add("PNG");
+            this.ImageTypeFamily.Add("GIF");
+            this.ImageTypeFamily.Add("TIFF");
+            this.ImageTypeFamily.Add("TGA");
+            this.ImageTypeFamily.Add("BMP");
+            this.ImageTypeFamily.Add("JPEG-2000");
+        }
+
+        public List<string> ImageDPIFamily { set; get; } = new List<string>();
+        private void SetImageDPIOrigin()
+        {
+            this.ImageDPIFamily.Add("50 dpi");
+            this.ImageDPIFamily.Add("72 dpi");
+            this.ImageDPIFamily.Add("96 dpi");
+            this.ImageDPIFamily.Add("150 dpi");
+            this.ImageDPIFamily.Add("300 dpi");
+            this.ImageDPIFamily.Add("600 dpi");
+        }
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
+        public ConverterImgDialogViewModel(IDialogService dialogService)
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            dialogs = dialogService;
+        }
+
+        #region 逻辑函数
+        /// <summary>
+        /// 根据下拉框选项,选择不同的图片类型
+        /// </summary>
+        /// <param name="index"></param>
+        private void UpdateImageType(int index)
+        {
+            switch (index)
+            {
+                //case结果是同样的情况下,case可堆叠在一起,表示处理方式一样
+                case 0:
+                case 1:
+                case 3:
+                case 4:
+                case 5:
+                case 6:
+                case 7:
+                    this.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                case 2:
+                    this.ConverterImgModel.Type = ImgType.PNG;
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        private void UpdateImageDPI(int index)
+        {
+            switch (index)
+            {
+                case 0:
+                    Trace.WriteLine("50");
+                    break;
+                case 1:
+                    Trace.WriteLine("72");
+                    break;
+                case 2:
+                    Trace.WriteLine("96");
+                    break;
+                case 3:
+                    Trace.WriteLine("150");
+                    break;
+                case 4:
+                    Trace.WriteLine("300");
+                    break;
+                case 5:
+                    Trace.WriteLine("600");
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private  void converter()
+        {
+            FolderBrowserDialog dlg = new FolderBrowserDialog();
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                ConverterImgModel.OutputPath = dlg.SelectedPath.Trim();
+            }
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterImgModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterImgModel.PageIndexLists, ConverterImgModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+           
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.ConverterType, "Img");
+            value.Add(ParameterNames.ConverterTypeModel, ConverterImgModel);
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+            dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
+            {
+
+            });
+        }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+        #endregion
+
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            CPDFViewer pdfViewer = null;
+            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            if (pdfViewer != null)
+            {
+                currentViewer = pdfViewer;
+                ConverterImgModel.InputPath = pdfViewer.Document.FilePath;
+                FileInfo fileinfo = new FileInfo(ConverterImgModel.InputPath);
+                ConverterImgModel.OutputPath = fileinfo.DirectoryName;
+                SetImageTypeOrigin();
+                SetImageDPIOrigin();
+            }
+        }
+        #endregion
+    }
+}

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

@@ -0,0 +1,190 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterPPTDialogViewModel : BindableBase, IDialogAware
+    {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        public ConverterPPTDialogModel ConverterPPTModel = new ConverterPPTDialogModel();
+
+        public CPDFViewer currentViewer;
+
+        public IDialogService dialogs;
+
+        public string CurrentPageIndex = "1";
+
+        public string PageRangeText { set; get; } = "0";
+
+        public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
+
+        #region 委托声明
+
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
+        public ConverterPPTDialogViewModel(IDialogService dialogService)
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            dialogs = dialogService;
+        }
+        #region 逻辑函数
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private void converter()
+        {
+            FolderBrowserDialog dlg = new FolderBrowserDialog();
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                ConverterPPTModel.OutputPath = dlg.SelectedPath.Trim();
+            }
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterPPTModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterPPTModel.PageIndexLists, ConverterPPTModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.ConverterType, "PPT");
+            value.Add(ParameterNames.ConverterTypeModel, ConverterPPTModel);
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+            dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
+            {
+
+            });
+        }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+        #endregion
+
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            CPDFViewer pdfViewer = null;
+            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            if (pdfViewer != null)
+            {
+                currentViewer = pdfViewer;
+                ConverterPPTModel.InputPath = pdfViewer.Document.FilePath;
+                FileInfo fileinfo = new FileInfo(ConverterPPTModel.InputPath);
+                ConverterPPTModel.OutputPath = fileinfo.DirectoryName;
+            }
+        }
+        #endregion
+    }
+}

+ 163 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs

@@ -0,0 +1,163 @@
+using ComPDFKit.PDFDocument;
+using ComPDFKit_Conversion.Converter;
+using ComPDFKit_Conversion.Options;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Mime;
+using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterProgressBarDialogViewModel : BindableBase,IDialogAware
+    {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        private string _pageIndex = "0";
+
+        /// <value>
+        /// 当前页
+        /// </value>
+        public string PageIndex
+        {
+            get { return _pageIndex; }
+            set
+            {
+                SetProperty(ref _pageIndex, value);
+            }
+        }
+
+        private string _pageNumber = "";
+        /// <value>
+        /// 总页数
+        /// </value>
+        public string PageNumber
+        {
+            get { return _pageNumber; }
+            set
+            {
+                SetProperty(ref _pageNumber, value);
+            }
+        }
+        #endregion
+
+        public ConverterProgressBarDialogViewModel()
+        {
+
+        }
+        #region 逻辑函数
+        private void SetProgress(int pageIndex)
+        {
+            PageIndex=pageIndex.ToString();
+        }
+        #endregion
+        
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+            ConverterHelper.Clear();
+
+        }
+
+        public async void OnDialogOpened(IDialogParameters parameters)
+        {
+            bool result=false;
+            string convertType="";
+            OnProgress GetProgress = null;
+            GetProgress += SetProgress;
+            parameters.TryGetValue<string>(ParameterNames.ConverterType, out convertType);
+            switch (convertType)
+            {
+                case "CSV":
+                    ConverterCSVDialogModel ConverterCSVModel;
+                    parameters.TryGetValue<ConverterCSVDialogModel>(ParameterNames.ConverterTypeModel, out ConverterCSVModel);
+                    if (ConverterCSVModel != null)
+                    {
+                        PageNumber = ConverterCSVModel.PageIndexLists.Count().ToString();
+                        result = await ConverterHelper.CSVConvert(ConverterCSVModel.InputPath, ConverterCSVModel.OutputPath, GetProgress, ConverterCSVModel.PageIndexLists, ConverterCSVModel.Pawssword);
+                       
+                    }
+                    break;
+                case "Excel":
+                    ConverterExcelDialogModel ConverterExcelModel;
+                    parameters.TryGetValue<ConverterExcelDialogModel>(ParameterNames.ConverterTypeModel, out ConverterExcelModel);
+                    if (ConverterExcelModel != null)
+                    {
+                        PageNumber = ConverterExcelModel.PageIndexLists.Count().ToString();
+                        result = await ConverterHelper.ExcelConvert(ConverterExcelModel.InputPath, ConverterExcelModel.OutputPath, GetProgress, ConverterExcelModel.PageIndexLists, ConverterExcelModel.Pawssword, ConverterExcelModel.excelOption);
+                    }
+                    break;
+                case "HTML":
+                    ConverterHTMLDialogModel ConverterHTMLModel;
+                    parameters.TryGetValue<ConverterHTMLDialogModel>(ParameterNames.ConverterTypeModel, out ConverterHTMLModel);
+                    if (ConverterHTMLModel != null)
+                    {
+                        PageNumber = ConverterHTMLModel.PageIndexLists.Count().ToString();
+                    }
+                    break;
+                case "Img":
+                    ConverterImgDialogModel ConverterImgModel;
+                    parameters.TryGetValue<ConverterImgDialogModel>(ParameterNames.ConverterTypeModel, out ConverterImgModel);
+                    if (ConverterImgModel != null)
+                    {
+                        PageNumber = ConverterImgModel.PageIndexLists.Count().ToString();
+                        result = await ConverterHelper.ImgConvert(ConverterImgModel.InputPath, ConverterImgModel.OutputPath, GetProgress, ConverterImgModel.PageIndexLists, ConverterImgModel.Pawssword, ConverterImgModel.Type);
+                    }
+                    break;
+                case "PPT":
+                    ConverterPPTDialogModel ConverterPPTModel;
+                    parameters.TryGetValue<ConverterPPTDialogModel>(ParameterNames.ConverterTypeModel, out ConverterPPTModel);
+                    if (ConverterPPTModel != null)
+                    {
+                        PageNumber = ConverterPPTModel.PageIndexLists.Count().ToString();
+                        result = await ConverterHelper.PPTConvert(ConverterPPTModel.InputPath, ConverterPPTModel.OutputPath, GetProgress, ConverterPPTModel.PageIndexLists, ConverterPPTModel.Pawssword);
+                    }
+                    break;
+                case "RTF":
+                    ConverterRTFDialogModel ConverterRTFModel;
+                    parameters.TryGetValue<ConverterRTFDialogModel>(ParameterNames.ConverterTypeModel, out ConverterRTFModel);
+                    if (ConverterRTFModel != null)
+                    {
+                        PageNumber = ConverterRTFModel.PageIndexLists.Count().ToString();
+                    }
+                        break;
+                case "Text":
+                    ConverterTextDialogModel ConverterTextModel;
+                    parameters.TryGetValue<ConverterTextDialogModel>(ParameterNames.ConverterTypeModel, out ConverterTextModel);
+                    if (ConverterTextModel != null)
+                    {
+                        PageNumber = ConverterTextModel.PageIndexLists.Count().ToString();
+                        result = await ConverterHelper.TxtConvert(ConverterTextModel.InputPath, ConverterTextModel.OutputPath, GetProgress, ConverterTextModel.PageIndexLists, ConverterTextModel.Pawssword);
+                    }
+                    break;
+                case "Word":
+                    ConverterWordDialogModel ConverterWordModel;
+                    parameters.TryGetValue<ConverterWordDialogModel>(ParameterNames.ConverterTypeModel, out ConverterWordModel);
+                    if (ConverterWordModel != null) {
+                        PageNumber = ConverterWordModel.PageIndexLists.Count().ToString();
+                        result = await ConverterHelper.WordConvert(ConverterWordModel.InputPath, ConverterWordModel.OutputPath, GetProgress, ConverterWordModel.PageIndexLists, ConverterWordModel.Pawssword);
+                    }
+                    break;
+                default:
+                    break;
+            }
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+        }
+        #endregion
+    }
+}

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

@@ -0,0 +1,189 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterRTFDialogViewModel : BindableBase, IDialogAware
+    {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        public ConverterRTFDialogModel ConverterRTFModel = new ConverterRTFDialogModel();
+
+        public CPDFViewer currentViewer;
+
+        public IDialogService dialogs;
+
+        public string CurrentPageIndex = "1";
+
+        public string PageRangeText { set; get; } = "0";
+
+        public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
+        #region 委托声明
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
+        public ConverterRTFDialogViewModel(IDialogService dialogService)
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            dialogs = dialogService;
+        }
+
+        #region 逻辑函数
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private void converter()
+        {
+            FolderBrowserDialog dlg = new FolderBrowserDialog();
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                ConverterRTFModel.OutputPath = dlg.SelectedPath.Trim();
+            }
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterRTFModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterRTFModel.PageIndexLists, ConverterRTFModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            //result = await ConverterHelper.TxtConvert(ConverterTextModel.InputPath, ConverterTextModel.OutputPath, ConverterTextModel.GetProgress, ConverterTextModel.PageIndexLists, ConverterTextModel.Pawssword);
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.ConverterType, "RTF");
+            value.Add(ParameterNames.ConverterTypeModel, ConverterRTFModel);
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+            dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
+            {
+
+            });
+        }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+        #endregion
+
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            CPDFViewer pdfViewer = null;
+            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            if (pdfViewer != null)
+            {
+                currentViewer = pdfViewer;
+                ConverterRTFModel.InputPath = pdfViewer.Document.FilePath;
+                FileInfo fileinfo = new FileInfo(ConverterRTFModel.InputPath);
+                ConverterRTFModel.OutputPath = fileinfo.DirectoryName;
+            }
+        }
+        #endregion
+    }
+}

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

@@ -0,0 +1,190 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterTextDialogViewModel : BindableBase, IDialogAware
+    {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        public ConverterTextDialogModel ConverterTextModel = new ConverterTextDialogModel();
+
+        public CPDFViewer currentViewer;
+
+        public IDialogService dialogs;
+
+        public string CurrentPageIndex = "1";
+
+        public string PageRangeText { set; get; } = "0";
+
+        public string PageRangeSelectIndex { set; get; } = "0";
+
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
+        public ConverterTextDialogViewModel(IDialogService dialogService)
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            dialogs = dialogService;
+        }
+        #region 逻辑函数
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private  void converter()
+        {
+            FolderBrowserDialog dlg = new FolderBrowserDialog();
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                ConverterTextModel.OutputPath = dlg.SelectedPath.Trim();
+            }
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterTextModel.PageRange, PageRangeText,true, CurrentPageIndex);
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterTextModel.PageIndexLists, ConverterTextModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.ConverterType, "Text");
+            value.Add(ParameterNames.ConverterTypeModel, ConverterTextModel);
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+            dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
+            {
+
+            });
+        }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+        #endregion
+
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            CPDFViewer pdfViewer = null;
+            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            if (pdfViewer != null)
+            {
+                currentViewer = pdfViewer;
+                ConverterTextModel.InputPath = pdfViewer.Document.FilePath;
+                FileInfo fileinfo = new FileInfo(ConverterTextModel.InputPath);
+                ConverterTextModel.OutputPath=fileinfo.DirectoryName;
+            }
+        }
+        #endregion
+    }
+}

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

@@ -0,0 +1,209 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
+{
+    public class ConverterWordDialogViewModel : BindableBase, IDialogAware
+    {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
+        public ConverterWordDialogModel ConverterWordModel = new ConverterWordDialogModel();
+
+        public CPDFViewer currentViewer;
+
+        public IDialogService dialogs;
+
+        public string CurrentPageIndex = "1";
+
+        public string PageRangeText { set; get; } = "0";
+
+        public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
+        public ConverterWordDialogViewModel(IDialogService dialogService)
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            ConverterCommnad = new DelegateCommand(converter);
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
+            dialogs = dialogService;
+        }
+        #region 逻辑函数
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private void converter()
+        {
+            FolderBrowserDialog dlg = new FolderBrowserDialog();
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                ConverterWordModel.OutputPath = dlg.SelectedPath.Trim();
+            }
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterWordModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterWordModel.PageIndexLists, ConverterWordModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.ConverterType, "Word");
+            value.Add(ParameterNames.ConverterTypeModel, ConverterWordModel);
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+            dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
+            {
+
+            });
+        }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+
+        private void radiobutton(string e)
+        {
+            string radioButton = e;
+            if (radioButton != null)
+            {
+                switch (radioButton)
+                {
+                    case "FlowingTextRadioBtn":
+                        break;
+                    case "PageLayoutRadioBtn":
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        }
+        #endregion
+
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            CPDFViewer pdfViewer = null;
+            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            if (pdfViewer != null)
+            {
+                currentViewer = pdfViewer;
+                ConverterWordModel.InputPath = pdfViewer.Document.FilePath;
+                FileInfo fileinfo = new FileInfo(ConverterWordModel.InputPath);
+                ConverterWordModel.OutputPath = fileinfo.DirectoryName;
+            }
+        }
+        #endregion
+    }
+}

+ 110 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs

@@ -0,0 +1,110 @@
+using ComPDFKitViewer.PdfViewer;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageBatchProcessingDialogViewModel : BindableBase, IDialogAware, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+        public IRegionManager BatchProcessingRegion;
+
+        private string batchProcessingRegionName;
+        public string BatchProcessingRegionName
+        {
+            get
+            {
+                return batchProcessingRegionName;
+            }
+            set
+            {
+                SetProperty(ref batchProcessingRegionName, value);
+            }
+        }
+
+        private Visibility batchProcessingVisible = Visibility.Collapsed;
+        public Visibility BatchProcessingVisible
+        {
+            get { return batchProcessingVisible; }
+            set { SetProperty(ref batchProcessingVisible, value); }
+        }
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand<string> DelegateChangeBatchProcessingCommand { get; set; }
+        #endregion
+        public HomePageBatchProcessingDialogViewModel(IRegionManager regionManager)
+        {
+            BatchProcessingRegion = regionManager;
+            BatchProcessingRegionName = Guid.NewGuid().ToString();
+            DelegateChangeBatchProcessingCommand= new DelegateCommand<string>(ChangeBatchProcessing);
+        }
+        #region 逻辑函数
+        public void ChangeBatchProcessing(string index) {
+            if (index=="0"||index =="1"||index=="2") { 
+            NavigationParameters param = new NavigationParameters();
+            param.Add(ParameterNames.FilePath, HomePageBatchProcessingDialogModel.FilePaths);
+            BatchProcessingVisible = Visibility.Collapsed;
+            BatchProcessingRegion.RequestNavigate(BatchProcessingRegionName, HomePageBatchProcessingDialogModel.GetBatchProcessing[int.Parse(index)], param);
+            BatchProcessingVisible = Visibility.Visible;
+            }
+        }
+        #endregion
+
+        public string Title => "PDF批量工具";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 构架行为
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            string batchprocessingname = "";
+            string[] filepath = null;
+            parameters.TryGetValue<string>(ParameterNames.BatchProcessing_Name, out batchprocessingname);
+            parameters.TryGetValue<string[]>(ParameterNames.FilePath, out filepath);
+            if (batchprocessingname != null || filepath != null) {
+                fileNames = filepath.ToList();
+                ChangeBatchProcessing(batchprocessingname);
+            }
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

+ 355 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogViewModel.cs

@@ -0,0 +1,355 @@
+using ComPDFKit.PDFDocument;
+using PDF_Office.CustomControl;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Windows;
+using System.Windows.Forms;
+using DataTable = System.Data.DataTable;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+using Task = System.Threading.Tasks.Task;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageCompressDialogViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+        private CPDFDocument tempDocument;
+
+        public List<int> fileNamesView = new List<int>();
+
+        private int fileNamesIndex = 0;
+
+        private IntPtr compressingIntpr = IntPtr.Zero;
+
+        private CPDFDocument.GetPageIndexDelegate indexDelegate = null;
+
+        HomePageCompressDialogModel homePageCompressDialogModel=new HomePageCompressDialogModel();
+
+        private DataTable pdfDataTable = new DataTable();
+        public DataTable PDFDataTable
+        {
+            get { return pdfDataTable; }
+            set
+            {
+                SetProperty(ref pdfDataTable, value);
+            }
+        }
+
+        private string compressGridIsEnabled="True";
+        public string CompressGridIsEnabled
+        {
+            get
+            {
+                return compressGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref compressGridIsEnabled, value);
+            }
+        }
+
+        private string setCompressGridIsEnabled = "True";
+        public string SetCompressGridIsEnabled
+        {
+            get
+            {
+                return setCompressGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setCompressGridIsEnabled, value);
+            }
+        }
+
+        private string removeIsEnable = "False";
+        public string RemoveIsEnable
+        {
+            get { return removeIsEnable; }
+            set
+            {
+                SetProperty(ref removeIsEnable, value);
+            }
+        }
+
+        private string selectFileName = "False";
+        public string SelectFileName
+        {
+            get { return selectFileName; }
+            set
+            {
+                SetProperty(ref selectFileName, value);
+            }
+        }
+
+        private Visibility addFileVisibility = Visibility.Hidden;
+        public Visibility AddFileVisibility
+        {
+            get { return addFileVisibility; }
+            set
+            {
+                SetProperty(ref addFileVisibility, value);
+                RaisePropertyChanged();
+
+            }
+        }
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand ADDPDFCommand { get; set; }
+
+        public DelegateCommand RemovePDFFileCommand { get; set; }
+
+        public DelegateCommand ADDPDFFilesCommand { get; set; }
+
+        public DelegateCommand CompressCommand { get; set; }
+
+        public DelegateCommand<string> RadioButtonCommand{ get; set; }
+        #endregion
+
+        public HomePageCompressDialogViewModel()
+        {
+            PDFDataTable.Columns.Add("FileName");
+            PDFDataTable.Columns.Add("FileSize");
+            PDFDataTable.Columns.Add("FileState");
+            ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
+            RemovePDFFileCommand = new DelegateCommand(removepdffile);
+            CompressCommand = new DelegateCommand(compress);
+            RadioButtonCommand = new DelegateCommand<string>(RadioButton);
+        }
+        #region 逻辑函数
+        private void RadioButton(string sender) {
+            if (sender != "") {
+
+                switch (sender) {
+                    case "LargeQualityRadioBtn":
+                        homePageCompressDialogModel.CompressQuality = HomePageCompressDialogModel.EnumQualityLevel.StatusLarge;
+                        break;
+                    case "StandardQualityRadioBtn":
+                        homePageCompressDialogModel.CompressQuality = HomePageCompressDialogModel.EnumQualityLevel.StatusStandard;
+                        break;
+                    case "LittleQualityRadioBtn":
+                        homePageCompressDialogModel.CompressQuality = HomePageCompressDialogModel.EnumQualityLevel.StatusLittle;
+                        break;
+                    case "MicroQualityRadioBtn":
+                        homePageCompressDialogModel.CompressQuality = HomePageCompressDialogModel.EnumQualityLevel.StatusMicro;
+                        break;
+                        default:
+                        homePageCompressDialogModel.CompressQuality = HomePageCompressDialogModel.EnumQualityLevel.StatusDefault;
+                        break;
+
+                }
+            }
+        }
+
+        private int GetIndex(int pageindex)
+        {
+            PDFDataTable.Rows[fileNamesIndex]["FileState"]="已经压缩"+pageindex.ToString()+"页";
+            return 0;
+        }
+
+        private async void compress() {
+            CompressGridIsEnabled = "False";
+            //GC.KeepAlive(indexDelegate);
+            fileNamesIndex = 0;
+            foreach (var filename in fileNames)
+            {
+                CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
+                if (document == null) {
+                    PDFDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
+                    continue;
+                }
+                FileInfo fileinfo = new FileInfo(filename);
+                string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
+                indexDelegate += GetIndex;
+                compressingIntpr = document.CompressFile_Init(((float)homePageCompressDialogModel.CompressQuality), indexDelegate);
+                tempDocument = document;
+                await Task.Run<bool>(() => { return document.CompressFile_Start(compressingIntpr, filename+"compress.pdf"); });
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+                document.Release();
+            }
+            CompressGridIsEnabled = "True";
+            MessageBoxEx.Show("已完成");
+            
+        }
+        #endregion
+
+        #region 批量处理逻辑函数
+        /// <summary>
+        /// 添加PDF文件
+        /// </summary>
+        private void addpicture()
+        {
+            System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
+            dlg.Multiselect = true;
+            dlg.Filter = "PDF|*.pdf;*.PDF;";
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                fileNames.AddRange(dlg.FileNames.ToList());
+                RemoveExcess(ref fileNames);
+                SetCompressGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+                updateListview("待确定");
+            }
+        }
+
+        /// <summary>
+        /// 删除重复的文件
+        /// </summary>
+        public void RemoveExcess(ref List<string> Filenames)
+        {
+            List<string> filenames = new List<string>();
+            foreach (var fileName in Filenames)
+            {
+                if (!filenames.Contains(fileName))
+                {
+                    filenames.Add(fileName);
+                }
+            }
+            Filenames.Clear();
+            Filenames = filenames;
+        }
+
+        /// <summary>
+        /// 添加PDF文件夹
+        /// </summary>
+        private void addpicturefiles()
+        {
+            FolderBrowserDialog dialog = new FolderBrowserDialog();
+            dialog.Description = "请选择文件路径";
+            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+
+                string foldPath = dialog.SelectedPath;
+                var apps = System.IO.Directory.GetFiles(foldPath);
+                foreach (string app in apps)
+                {
+                    var fi = new FileInfo(app);
+                    if (fi.Extension == ".pdf" || fi.Extension == ".PDF")
+                    {
+                        fileNames.Add(app);
+                    }
+                }
+                RemoveExcess(ref fileNames);
+                updateListview("待确定");
+                SetCompressGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+            }
+            
+        }
+        /// <summary>
+        /// 更新listview显示
+        /// state 状态显示字符串
+        /// </summary>
+        public void updateListview(string state)
+        {
+            DataTable pdfdatatable = new DataTable();
+            pdfdatatable.Columns.Add("FileName");
+            pdfdatatable.Columns.Add("FileSize");
+            pdfdatatable.Columns.Add("FileState");
+            foreach (var fileName in fileNames)
+            {
+                string file_all = fileName;
+                FileInfo f = new FileInfo(file_all);
+                string file_size = (((float)f.Length) / 1024).ToString() + " K";
+                pdfdatatable.Rows.Add(f.Name, file_size, state);
+            }
+            PDFDataTable = pdfdatatable;
+            HomePageBatchProcessingDialogModel.FilePaths = fileNames;
+
+        }
+        /// <summary>
+        /// 逆序int类型集合
+        /// </summary>
+        public void Reverseorder(ref List<int> Numbers)
+        {
+            Numbers = Numbers.OrderBy(a => a).ToList();
+            Numbers.Reverse();
+        }
+
+        /// <summary>
+        /// 打开文件PDF
+        /// </summary>
+        public void openfiledialog()
+        {
+
+            foreach (int filenamesview in fileNamesView)
+            {
+                System.Diagnostics.Process.Start(fileNames[filenamesview]);
+            }
+        }
+
+        /// <summary>
+        /// 删除文件PDF
+        /// </summary>
+        public void removepdffile()
+        {
+            Reverseorder(ref fileNamesView);
+            foreach (int filenamesview in fileNamesView)
+            {
+                //Trace.WriteLine(filenamesview);
+                fileNames.Remove(fileNames[filenamesview]);
+            }
+            if (fileNames.Count < 1)
+            {
+                SetCompressGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            updateListview("待确定");
+        }
+
+
+        public void PDFFileCount()
+        {
+            if (fileNames.Count == 0)
+            {
+                SetCompressGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            else
+            {
+                SetCompressGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+            }
+        }
+        #endregion
+
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            List<string> filepath = new List<string>();
+            navigationContext.Parameters.TryGetValue<List<string>>(ParameterNames.FilePath, out filepath);
+            if (filepath != null)
+            {
+
+                fileNames = filepath;
+                PDFFileCount();
+                updateListview("待确定");
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+            if(tempDocument!=null)
+            tempDocument.CompressFile_Cancel(compressingIntpr);
+        }
+        #endregion
+    }
+}

+ 63 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVViewModel.cs

@@ -0,0 +1,63 @@
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterCSVViewModel : BindableBase, INavigationAware
+    {
+        #region 委托声明
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+
+        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
+        #endregion
+
+        public HomePageConverterCSVViewModel()
+        {
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+        }
+        #region 逻辑函数
+        private void radiobutton(string e)
+        {
+            string radioButton = e;
+            if (radioButton != null)
+            {
+                switch (radioButton)
+                {
+                    case "ForEachPageRadioBtn":
+                        break;
+                    case "OnlyTableRadioBtn":
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        }
+        #endregion
+
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
+            if (homePageConverterVM != null)
+            {
+                homePageConverterDialogViewModel = homePageConverterVM;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

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

@@ -0,0 +1,467 @@
+using ComPDFKit.PDFDocument;
+using ComPDFKit_Conversion.Converter;
+using Microsoft.Office.Interop.Word;
+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 PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Windows;
+using System.Windows.Forms;
+using DataTable = System.Data.DataTable;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterDialogViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+        public HomePageConverterCSVModel ConverterCSVModel = new HomePageConverterCSVModel();
+        public HomePageConverterExcelModel ConverterExcelModel = new HomePageConverterExcelModel();
+        public HomePageConverterHTMLModel ConverterHTMLModel = new HomePageConverterHTMLModel();
+        public HomePageConverterImgModel ConverterImgModel = new HomePageConverterImgModel();
+        public HomePageConverterPPTModel ConverterPPTModel = new HomePageConverterPPTModel();
+        public HomePageConverterRTFModel ConverterRTFModel = new HomePageConverterRTFModel();
+        public HomePageConverterTextModel ConverterTextModel = new HomePageConverterTextModel();
+        public HomePageConverterWordModel ConverterWordModel = new HomePageConverterWordModel();
+
+        private CPDFDocument tempDocument;
+
+        public string PageNumber = "";
+
+        public IRegionManager ConverterRegion;
+
+        public int ConverterTypeIndex=0;
+
+        public List<int> fileNamesView = new List<int>();
+
+        private int fileNamesIndex = 0;
+
+        public List<string> ConverterTypeFamily { set; get; } = new List<string>();
+
+        private void SetImageTypeOrigin()
+        {
+            this.ConverterTypeFamily.Add("Word");
+            this.ConverterTypeFamily.Add("Excel");
+            this.ConverterTypeFamily.Add("PPT");
+            this.ConverterTypeFamily.Add("RTF");
+            this.ConverterTypeFamily.Add("HTML");
+            this.ConverterTypeFamily.Add("Text");
+            this.ConverterTypeFamily.Add("CSV");
+            this.ConverterTypeFamily.Add("Img");
+        }
+
+        private string converterGridIsEnabled = "True";
+        public string ConverterGridIsEnabled
+        {
+            get
+            {
+                return converterGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref converterGridIsEnabled, value);
+            }
+        }
+
+        private string setConverterGridIsEnabled = "True";
+        public string SetConverterGridIsEnabled
+        {
+            get
+            {
+                return setConverterGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setConverterGridIsEnabled, value);
+            }
+        }
+
+        private DataTable pdfDataTable = new DataTable();
+        public DataTable PDFDataTable
+        {
+            get { return pdfDataTable; }
+            set
+            {
+                SetProperty(ref pdfDataTable, value);
+            }
+        }
+
+        private string removeIsEnable = "False";
+        public string RemoveIsEnable
+        {
+            get { return removeIsEnable; }
+            set
+            {
+                SetProperty(ref removeIsEnable, value);
+            }
+        }
+
+        private string selectFileName = "False";
+        public string SelectFileName
+        {
+            get { return selectFileName; }
+            set
+            {
+                SetProperty(ref selectFileName, value);
+            }
+        }
+
+        private string converterRegionName;
+        public string ConverterRegionName
+        {
+            get
+            {
+                return converterRegionName;
+            }
+            set
+            {
+                SetProperty(ref converterRegionName, value);
+            }
+        }
+
+        private Visibility converterVisible = Visibility.Collapsed;
+        public Visibility ConverterVisible
+        {
+            get { return converterVisible; }
+            set { SetProperty(ref converterVisible, value); }
+        }
+
+        private Visibility addFileVisibility = Visibility.Hidden;
+        public Visibility AddFileVisibility
+        {
+            get { return addFileVisibility; }
+            set
+            {
+                SetProperty(ref addFileVisibility, value);
+                RaisePropertyChanged();
+
+            }
+        }
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand ADDPDFCommand { get; set; }
+
+        public DelegateCommand RemovePDFFileCommand { get; set; }
+
+        public DelegateCommand ConvertCommand { get; set; }
+
+        public DelegateCommand ADDPDFFilesCommand { get; set; }
+        #endregion
+
+        public HomePageConverterDialogViewModel(IRegionManager converterRegion)
+        {
+
+            SetImageTypeOrigin();
+            PDFDataTable.Columns.Add("FileName");
+            PDFDataTable.Columns.Add("FileSize");
+            PDFDataTable.Columns.Add("FileState");
+            ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
+            RemovePDFFileCommand = new DelegateCommand(removepdffile);
+            ConvertCommand = new DelegateCommand(convert);
+            ConverterRegion = converterRegion;
+            ConverterRegionName=Guid.NewGuid().ToString();
+        }
+        #region 逻辑函数
+        private void SetProgress(int pageIndex)
+        {
+            PDFDataTable.Rows[fileNamesIndex]["FileState"] = "已经转换" + pageIndex.ToString() + "页";
+            pageIndex.ToString();
+        }
+
+        private async void convert()
+        {
+
+            bool result = false;
+            OnProgress GetProgress = null;
+            GetProgress += SetProgress;
+            fileNamesIndex = 0;
+            ConverterGridIsEnabled = "False";
+            foreach (var filename in fileNames)
+            {
+                FileInfo fileinfo = new FileInfo(filename);
+                string OutputPath = fileinfo.DirectoryName;
+                char[] enumerationSeparator = new char[] { ',' };
+                char[] rangeSeparator = new char[] { '-' };
+                List<int> PageIndexLists=new List<int>();
+                CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
+                if (document == null)
+                {
+                    PDFDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
+                    continue;
+                }
+                if (!CommonHelper.GetPagesInRange(ref PageIndexLists, "1-" + document.PageCount.ToString(),document.PageCount, enumerationSeparator, rangeSeparator))
+                { //TODO
+                    Trace.WriteLine("输入不对");
+                    MessageBoxEx.Show("输入不对");
+                    return;
+                }
+                switch (ConverterTypeIndex)
+                {
+                    case 0:
+                        if (ConverterWordModel != null)
+                        {
+                            PageNumber = ConverterWordModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.WordConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterWordModel.Pawssword);
+                        }
+                        break;
+
+                    case 1:
+                        if (ConverterExcelModel != null)
+                        {
+                            PageNumber = ConverterExcelModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.ExcelConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterExcelModel.Pawssword, ConverterExcelModel.excelOption);
+                        }
+                        break;
+                    case 2:
+
+                        if (ConverterPPTModel != null)
+                        {
+                            PageNumber = ConverterPPTModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.PPTConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterPPTModel.Pawssword);
+                        }
+                        break;
+                    case 3:
+
+                        if (ConverterRTFModel != null)
+                        {
+                            PageNumber = ConverterRTFModel.PageIndexLists.Count().ToString();
+                        }
+                        break;
+                    case 4:
+
+                        if (ConverterHTMLModel != null)
+                        {
+                            PageNumber = ConverterHTMLModel.PageIndexLists.Count().ToString();
+                        }
+                        break;
+                    case 5:
+
+                        if (ConverterTextModel != null)
+                        {
+                            PageNumber = ConverterTextModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.TxtConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterTextModel.Pawssword);
+                        }
+                        break;
+                    case 6:
+                        if (ConverterCSVModel != null)
+                        {
+                            PageNumber = ConverterCSVModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.CSVConvert(filename, OutputPath, GetProgress, ConverterCSVModel.PageIndexLists, ConverterCSVModel.Pawssword);
+                        }
+                        break;
+                    case 7:
+
+                        if (ConverterImgModel != null)
+                        {
+                            PageNumber = ConverterImgModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.ImgConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterImgModel.Pawssword, ConverterImgModel.Type);
+                        }
+                        break;
+                    default:
+                        break;
+                }
+                document.Release();
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+            }
+            ConverterGridIsEnabled = "True";
+        }
+        #endregion
+
+        #region 批量处理逻辑函数
+        /// <summary>
+        /// 添加PDF文件
+        /// </summary>
+        private void addpicture()
+        {
+            System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
+            dlg.Multiselect = true;
+            dlg.Filter = "PDF|*.pdf;*.PDF;";
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                fileNames.AddRange(dlg.FileNames.ToList());
+                RemoveExcess(ref fileNames);
+                SetConverterGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+                updateListview("待确定");
+            }
+        }
+
+        /// <summary>
+        /// 删除重复的文件
+        /// </summary>
+        public void RemoveExcess(ref List<string> Filenames)
+        {
+            List<string> filenames = new List<string>();
+            foreach (var fileName in Filenames)
+            {
+                if (!filenames.Contains(fileName))
+                {
+                    filenames.Add(fileName);
+                }
+            }
+            Filenames.Clear();
+            Filenames = filenames;
+        }
+
+        /// <summary>
+        /// 添加PDF文件夹
+        /// </summary>
+        private void addpicturefiles()
+        {
+            FolderBrowserDialog dialog = new FolderBrowserDialog();
+            dialog.Description = "请选择文件路径";
+            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+
+                string foldPath = dialog.SelectedPath;
+                var apps = System.IO.Directory.GetFiles(foldPath);
+                foreach (string app in apps)
+                {
+                    var fi = new FileInfo(app);
+                    if (fi.Extension == ".pdf" || fi.Extension == ".PDF")
+                    {
+                        fileNames.Add(app);
+                    }
+                }
+                RemoveExcess(ref fileNames);
+                updateListview("待确定");
+                SetConverterGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+            }
+
+        }
+        /// <summary>
+        /// 更新listview显示
+        /// state 状态显示字符串
+        /// </summary>
+        public void updateListview(string state)
+        {
+            DataTable pdfdatatable = new DataTable();
+            pdfdatatable.Columns.Add("FileName");
+            pdfdatatable.Columns.Add("FileSize");
+            pdfdatatable.Columns.Add("FileState");
+            foreach (var fileName in fileNames)
+            {
+                string file_all = fileName;
+                FileInfo f = new FileInfo(file_all);
+                string file_size = (((float)f.Length) / 1024).ToString() + " K";
+                pdfdatatable.Rows.Add(f.Name, file_size, state);
+            }
+            PDFDataTable = pdfdatatable;
+            HomePageBatchProcessingDialogModel.FilePaths = fileNames;
+
+        }
+        /// <summary>
+        /// 逆序int类型集合
+        /// </summary>
+        public void Reverseorder(ref List<int> Numbers)
+        {
+            Numbers = Numbers.OrderBy(a => a).ToList();
+            Numbers.Reverse();
+        }
+
+        /// <summary>
+        /// 打开文件PDF
+        /// </summary>
+        public void openfiledialog()
+        {
+
+            foreach (int filenamesview in fileNamesView)
+            {
+                System.Diagnostics.Process.Start(fileNames[filenamesview]);
+            }
+        }
+
+        /// <summary>
+        /// 删除文件PDF
+        /// </summary>
+        public void removepdffile()
+        {
+            Reverseorder(ref fileNamesView);
+            foreach (int filenamesview in fileNamesView)
+            {
+                //Trace.WriteLine(filenamesview);
+                fileNames.Remove(fileNames[filenamesview]);
+            }
+            if (fileNames.Count < 1)
+            {
+                SetConverterGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            updateListview("待确定");
+        }
+
+
+        public void PDFFileCount()
+        {
+            if (fileNames.Count == 0)
+            {
+                SetConverterGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            else
+            {
+                SetConverterGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+            }
+        }
+        public void ChangeConverter(int index)
+        {
+            ConverterTypeIndex=index;
+            NavigationParameters param = new NavigationParameters();
+            param.Add(ParameterNames.ViewContentViewModel, this);
+            if (index == 0 || index == 1 || index == 6 || index == 7)
+            {
+                ConverterVisible = Visibility.Collapsed;
+                ConverterRegion.RequestNavigate(ConverterRegionName, HomePageConverterDialogModel.GetConverter[index], param);
+                ConverterVisible = Visibility.Visible;
+            }
+            else { ConverterVisible = Visibility.Collapsed; }
+
+        }
+        #endregion
+
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            List<string> filepath = new List<string>();
+            navigationContext.Parameters.TryGetValue<List<string>>(ParameterNames.FilePath, out filepath);
+            if (filepath != null)
+            {
+                fileNames = filepath;
+                PDFFileCount();
+                updateListview("待确定");
+                ChangeConverter(0);
+            }
+        }
+       
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+            ConverterHelper.Clear();
+        }
+        #endregion
+    }
+}

+ 73 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelViewModel.cs

@@ -0,0 +1,73 @@
+using ComPDFKit_Conversion.Options;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterExcelViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        public ConverterExcelDialogModel ConverterExcelModel = new ConverterExcelDialogModel();
+
+        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+        #endregion
+
+        public HomePageConverterExcelViewModel()
+        {
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+        }
+        #region 逻辑函数
+        private void radiobutton(string e)
+        {
+            string radioButton = e;
+            if (radioButton != null)
+            {
+                switch (radioButton)
+                {
+                    case "ForEachPageRadioBtn":
+                        homePageConverterDialogViewModel. ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions();
+                        break;
+                    case "ForTheDocRadioBtn":
+                        homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument);
+                        break;
+                    case "OnlyTableRadioBtn":
+                        homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachTable, ContentOptions.OnlyTable);
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        }
+        #endregion
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
+            if (homePageConverterVM != null)
+            {
+                homePageConverterDialogViewModel = homePageConverterVM;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

+ 67 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgViewModel.cs

@@ -0,0 +1,67 @@
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterImgViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        public List<string> ImageTypeFamily { set; get; } = new List<string>();
+
+        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
+
+        private void SetImageTypeOrigin()
+        {
+            this.ImageTypeFamily.Add("JPEG");
+            this.ImageTypeFamily.Add("JPG");
+            this.ImageTypeFamily.Add("PNG");
+            this.ImageTypeFamily.Add("GIF");
+            this.ImageTypeFamily.Add("TIFF");
+            this.ImageTypeFamily.Add("TGA");
+            this.ImageTypeFamily.Add("BMP");
+            this.ImageTypeFamily.Add("JPEG-2000");
+        }
+
+        public List<string> ImageDPIFamily { set; get; } = new List<string>();
+        private void SetImageDPIOrigin()
+        {
+            this.ImageDPIFamily.Add("50 dpi");
+            this.ImageDPIFamily.Add("72 dpi");
+            this.ImageDPIFamily.Add("96 dpi");
+            this.ImageDPIFamily.Add("150 dpi");
+            this.ImageDPIFamily.Add("300 dpi");
+            this.ImageDPIFamily.Add("600 dpi");
+        }
+        #endregion
+
+        public HomePageConverterImgViewModel()
+        {
+            SetImageTypeOrigin();
+            SetImageDPIOrigin();
+        }
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
+            if (homePageConverterVM != null)
+            {
+                homePageConverterDialogViewModel = homePageConverterVM;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

+ 56 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordViewModel.cs

@@ -0,0 +1,56 @@
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterWordViewModel : BindableBase, INavigationAware
+    {
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+
+        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
+
+        public HomePageConverterWordViewModel()
+        {
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+        }
+        private void radiobutton(string e)
+        {
+            string radioButton = e;
+            if (radioButton != null)
+            {
+                switch (radioButton)
+                {
+                    case "FlowingTextRadioBtn":
+                        break;
+                    case "PageLayoutRadioBtn":
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        }
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
+            if (homePageConverterVM != null)
+            {
+                homePageConverterDialogViewModel = homePageConverterVM;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 474 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogViewModel.cs

@@ -0,0 +1,474 @@
+using ComPDFKit.PDFDocument;
+using PDF_Office.CustomControl;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Windows;
+using System.Windows.Forms;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageSetPasswordDialogViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+        private int fileNamesIndex = 0;
+
+        private HomePageSetPasswordDialogModel setPasswordDialogModel = new HomePageSetPasswordDialogModel();
+
+        public List<int> fileNamesView = new List<int>();
+
+        private bool _canOpen;
+        public bool CanOpen
+        {
+            get { return _canOpen; }
+            set
+            {
+                _canOpen = value;
+                RaisePropertyChanged("isChecked");
+            }
+        }
+
+        private bool _canEdit;
+        public bool CanEdit
+        {
+            get { return _canEdit; }
+            set
+            {
+                _canEdit = value;
+                RaisePropertyChanged("isChecked");
+            }
+        }
+
+        private string _changeMod = "0";
+        ///<value>
+        ///"0"为ChangeMod.None;
+        ///"1"为ChangeMod.ChangePage;
+        ///"2"为ChangeMod.FormAndSignature;
+        ///"3"为ChangeMod.AnnotAndFormAndSignature;
+        ///"4"为ChangeMod.ExceptAbstrat;
+        ///</value>
+        public string ChangeMod
+        {
+            get { return _changeMod; }
+            set
+            {
+                _changeMod = value;
+            }
+        }
+
+        private string _printMod = "0";
+        ///<value>
+        ///"0"为PrintMod.None;
+        ///"1"为PrintMod.LowDpi;
+        ///"2"为PrintMod.HighDpi;
+        ///</value>
+        public string PrintMod
+        {
+            get { return _printMod; }
+            set
+            {
+                _printMod = value;
+            }
+        }
+
+        private string safetyGridIsEnabled = "True";
+        public string SafetyGridIsEnabled
+        {
+            get
+            {
+                return safetyGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref safetyGridIsEnabled, value);
+            }
+        }
+
+        private string setSafetyGridIsEnabled = "True";
+        public string SetSafetyGridIsEnabled
+        {
+            get
+            {
+                return setSafetyGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setSafetyGridIsEnabled, value);
+            }
+        }
+
+        private string _isEnableConfirm = "False";
+        public string IsEnabledConfirm
+        {
+            get { return _isEnableConfirm; }
+            set
+            {
+                SetProperty(ref _isEnableConfirm, value);
+            }
+        }
+
+        private DataTable pdfDataTable = new DataTable();
+        public DataTable PDFDataTable
+        {
+            get { return pdfDataTable; }
+            set
+            {
+                SetProperty(ref pdfDataTable, value);
+            }
+        }
+
+        private string removeIsEnable = "False";
+        public string RemoveIsEnable
+        {
+            get { return removeIsEnable; }
+            set
+            {
+                SetProperty(ref removeIsEnable, value);
+            }
+        }
+
+        private string selectFileName = "False";
+        public string SelectFileName
+        {
+            get { return selectFileName; }
+            set
+            {
+                SetProperty(ref selectFileName, value);
+            }
+        }
+
+        private Visibility addFileVisibility = Visibility.Hidden;
+        public Visibility AddFileVisibility
+        {
+            get { return addFileVisibility; }
+            set
+            {
+                SetProperty(ref addFileVisibility, value);
+                RaisePropertyChanged();
+
+            }
+        }
+        #endregion
+
+        #region 委托声明
+
+        public DelegateCommand DelegateSetOpenCommand { get; set; }
+
+        public DelegateCommand DelegateSetEditCommand { get; set; }
+
+        public DelegateCommand DelegateCanOpenTextChangedCommand { get; set; }
+
+        public DelegateCommand DelegateCanEditTextChangedCommand { get; set; }
+
+        public DelegateCommand DelegateConfirmEncryptCommand { get; set; }
+
+        public DelegateCommand DelegateCancelEncryptCommand { get; set; }
+
+        public DelegateCommand ADDPDFCommand { get; set; }
+
+        public DelegateCommand RemovePDFFileCommand { get; set; }
+
+        public DelegateCommand ADDPDFFilesCommand { get; set; }
+        #endregion
+
+        public HomePageSetPasswordDialogViewModel()
+        {
+            PDFDataTable.Columns.Add("FileName");
+            PDFDataTable.Columns.Add("FileSize");
+            PDFDataTable.Columns.Add("FileState");
+            HomePageSetPasswordDialogModel.PasswordForOpen = "";
+            HomePageSetPasswordDialogModel.PasswordForEdit = "";
+            DelegateConfirmEncryptCommand = new DelegateCommand(ConfirmEncrypt);
+            DelegateSetOpenCommand = new DelegateCommand(SetCanOpen);
+            DelegateSetEditCommand = new DelegateCommand(SetCanEdit);
+            DelegateCanOpenTextChangedCommand = new DelegateCommand(CanOpenTextChanged);
+            DelegateCanEditTextChangedCommand = new DelegateCommand(CanEditTextChanged);
+            ADDPDFCommand = new DelegateCommand(addpdf);
+            ADDPDFFilesCommand = new DelegateCommand(addpdffiles);
+            RemovePDFFileCommand = new DelegateCommand(removepdffile);
+        }
+
+        #region 检查和初始化
+        private void CheckCanConfirmEncrypt()
+        {
+            if (setPasswordDialogModel.CanOpen)
+            {
+                if (HomePageSetPasswordDialogModel.PasswordForOpen.Length > 0)
+                {
+                    IsEnabledConfirm = "True";
+                    return;
+                }
+            }
+            if (setPasswordDialogModel.CanEdit)
+            {
+                if (HomePageSetPasswordDialogModel.PasswordForEdit.Length > 0)
+                {
+                    IsEnabledConfirm = "True";
+                    return;
+                }
+            }
+            IsEnabledConfirm = "False";
+        }
+
+        private void InitPermissionsDictionary(ref Dictionary<string, HomePageSetPasswordDialogModel.PrintMod> GetPrintMod, ref Dictionary<string, HomePageSetPasswordDialogModel.ChangeMod> GetChangeMod)
+        {
+            GetPrintMod.Add("0", HomePageSetPasswordDialogModel.PrintMod.None);
+            GetPrintMod.Add("1", HomePageSetPasswordDialogModel.PrintMod.LowDpi);
+            GetPrintMod.Add("2", HomePageSetPasswordDialogModel.PrintMod.HighDpi);
+
+            GetChangeMod.Add("0", HomePageSetPasswordDialogModel.ChangeMod.None);
+            GetChangeMod.Add("1", HomePageSetPasswordDialogModel.ChangeMod.ChangePage);
+            GetChangeMod.Add("2", HomePageSetPasswordDialogModel.ChangeMod.FormAndSignature);
+            GetChangeMod.Add("3", HomePageSetPasswordDialogModel.ChangeMod.AnnotAndFormAndSignature);
+            GetChangeMod.Add("4", HomePageSetPasswordDialogModel.ChangeMod.ExceptAbstrat);
+        }
+        #endregion
+        #region 逻辑函数
+        public void SetCanOpen()
+        {
+            setPasswordDialogModel.CanOpen = CanOpen;
+            CheckCanConfirmEncrypt();
+        }
+
+        public void SetCanEdit()
+        {
+            setPasswordDialogModel.CanEdit = CanEdit;
+            CheckCanConfirmEncrypt();
+        }
+
+        public void CanOpenTextChanged()
+        {
+            CheckCanConfirmEncrypt();
+        }
+
+        public void CanEditTextChanged()
+        {
+            CheckCanConfirmEncrypt();
+        }
+
+        public void ConfirmEncrypt()
+        {
+            SafetyGridIsEnabled = "False";
+            string openPassword = "";
+            string editPassword = "";
+            CPDFPermissionsInfo permissionsInfo = new CPDFPermissionsInfo();
+            if (setPasswordDialogModel.CanOpen)
+            {
+                if (!string.IsNullOrEmpty(HomePageSetPasswordDialogModel.PasswordForOpen))
+                {
+                    openPassword = HomePageSetPasswordDialogModel.PasswordForOpen;
+                }
+            }
+            if (setPasswordDialogModel.CanEdit)
+            {
+                if (!string.IsNullOrEmpty(HomePageSetPasswordDialogModel.PasswordForEdit))
+                {
+                    editPassword = HomePageSetPasswordDialogModel.PasswordForEdit;
+                    Dictionary<string, HomePageSetPasswordDialogModel.PrintMod> GetPrintMod = new Dictionary<string, HomePageSetPasswordDialogModel.PrintMod>();
+                    Dictionary<string, HomePageSetPasswordDialogModel.ChangeMod> GetChangeMod = new Dictionary<string, HomePageSetPasswordDialogModel.ChangeMod>(); ;
+                    InitPermissionsDictionary(ref GetPrintMod, ref GetChangeMod);
+                    permissionsInfo = setPasswordDialogModel.CreatePermissionsInfo(GetPrintMod[PrintMod], GetChangeMod[ChangeMod]);
+                }
+            }
+            fileNamesIndex = 0;
+            foreach (var filename in fileNames)
+            {
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "待完成";
+                CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
+                if (document == null)
+                {
+                    PDFDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
+                    continue;
+                }
+                FileInfo fileinfo = new FileInfo(filename);
+                string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
+                if (document == null)
+                {
+                    return;
+                }
+                document.Encrypt(openPassword, editPassword, permissionsInfo);
+                document.WriteToFilePath(filename + "SetPassword");
+
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+                document.Release();
+            }
+            SafetyGridIsEnabled = "True";
+            MessageBoxEx.Show("已完成");
+        }
+        #endregion
+
+        #region 批量处理逻辑函数
+        /// <summary>
+        /// 添加PDF文件
+        /// </summary>
+        private void addpdf()
+        {
+            System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
+            dlg.Multiselect = true;
+            dlg.Filter = "PDF|*.pdf;*.PDF;";
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                fileNames.AddRange(dlg.FileNames.ToList());
+                RemoveExcess(ref fileNames);
+                SetSafetyGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+                updateListview("待确定");
+            }
+        }
+
+        /// <summary>
+        /// 删除重复的文件
+        /// </summary>
+        public void RemoveExcess(ref List<string> Filenames)
+        {
+            List<string> filenames = new List<string>();
+            foreach (var fileName in Filenames)
+            {
+                if (!filenames.Contains(fileName))
+                {
+                    filenames.Add(fileName);
+                }
+            }
+            Filenames.Clear();
+            Filenames = filenames;
+        }
+
+        /// <summary>
+        /// 添加PDF文件夹
+        /// </summary>
+        private void addpdffiles()
+        {
+            FolderBrowserDialog dialog = new FolderBrowserDialog();
+            dialog.Description = "请选择文件路径";
+            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+
+                string foldPath = dialog.SelectedPath;
+                var apps = System.IO.Directory.GetFiles(foldPath);
+                foreach (string app in apps)
+                {
+                    var fi = new FileInfo(app);
+                    if (fi.Extension == ".pdf" || fi.Extension == ".PDF")
+                    {
+                        fileNames.Add(app);
+                    }
+                }
+                RemoveExcess(ref fileNames);
+                updateListview("待确定");
+                SetSafetyGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+            }
+        }
+
+        /// <summary>
+        /// 更新listview显示
+        /// state 状态显示字符串
+        /// </summary>
+        public void updateListview(string state)
+        {
+            DataTable pdfdatatable = new DataTable();
+            pdfdatatable.Columns.Add("FileName");
+            pdfdatatable.Columns.Add("FileSize");
+            pdfdatatable.Columns.Add("FileState");
+            foreach (var fileName in fileNames)
+            {
+                string file_all = fileName;
+                FileInfo f = new FileInfo(file_all);
+                string file_size = (((float)f.Length) / 1024).ToString() + " K";
+                pdfdatatable.Rows.Add(f.Name, file_size, state);
+            }
+            PDFDataTable = pdfdatatable;
+            HomePageBatchProcessingDialogModel.FilePaths = fileNames;
+
+        }
+
+        
+
+        /// <summary>
+        /// 逆序int类型集合
+        /// </summary>
+        public void Reverseorder(ref List<int> Numbers)
+        {
+            Numbers = Numbers.OrderBy(a => a).ToList();
+            Numbers.Reverse();
+        }
+
+        /// <summary>
+        /// 打开文件PDF
+        /// </summary>
+        public void openfiledialog()
+        {
+
+            foreach (int filenamesview in fileNamesView)
+            {
+                System.Diagnostics.Process.Start(fileNames[filenamesview]);
+            }
+        }
+
+        /// <summary>
+        /// 删除文件PDF
+        /// </summary>
+        public void removepdffile()
+        {
+            Reverseorder(ref fileNamesView);
+            foreach (int filenamesview in fileNamesView)
+            {
+                //Trace.WriteLine(filenamesview);
+                fileNames.Remove(fileNames[filenamesview]);
+            }
+            if (fileNames.Count < 1)
+            {
+                SetSafetyGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            updateListview("待确定");
+        }
+
+        public void PDFFileCount()
+        {
+            if (fileNames.Count == 0)
+            {
+                SetSafetyGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            else
+            {
+                SetSafetyGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+            }
+        }
+        #endregion
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            List<string> filepath = new List<string>();
+            navigationContext.Parameters.TryGetValue<List<string>>(ParameterNames.FilePath, out filepath);
+            if (filepath != null)
+            {
+
+                fileNames = filepath;
+                PDFFileCount();
+                updateListview("待确定");
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 68 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs

@@ -21,7 +21,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         #region 参数和属性
         public CPDFDocument document;
 
-        private CPDFViewer currentViewer;
+        public CPDFViewer currentViewer;
 
         private HomePageExtractDialogModel extractModel = new HomePageExtractDialogModel();
 
@@ -46,6 +46,10 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         public DelegateCommand ExtractToSingleFileCommand { get; set; }
 
         public DelegateCommand DeleteAfterExtractCommand { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
         #endregion
 
         public HomePageExtractDialogViewModel()
@@ -54,6 +58,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             ExtractCommand = new DelegateCommand(extract);
             ExtractToSingleFileCommand = new DelegateCommand(extractToSingleFile);
             DeleteAfterExtractCommand = new DelegateCommand(deleteAfterExtract);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
 
         }
         #region 逻辑函数
@@ -135,6 +141,67 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             }
 
         }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ExtractPreview = e as PageTurningPreview;
+            if (ExtractPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "1" || PageRangeSelectIndex == "2")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ExtractPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                ExtractPreview.PageIndex.Text = (ExtractPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ExtractPreview.CurrentIndex = 0;
+                ExtractPreview.CurrentPage.Text = (ExtractPreview.PageIndexLists[ExtractPreview.CurrentIndex] + 1).ToString();
+                ExtractPreview.AwaitRenderBitmap(ExtractPreview.document);
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ExtractPreview = e as PageTurningPreview;
+            if (ExtractPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
+                char[] enumerationSeparator = new char[] { ',' };
+                char[] rangeSeparator = new char[] { '-' };
+
+                if (!CommonHelper.GetPagesInRange(ref ExtractPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                { //TODO
+                    ExtractPreview.PageIndexLists.Add(0);
+
+                    return;
+                }
+                else
+                {
+                    ExtractPreview.PageIndex.Text = (ExtractPreview.PageIndexLists.Last<int>() + 1).ToString();
+                    ExtractPreview.CurrentIndex = 0;
+                    ExtractPreview.CurrentPage.Text = (ExtractPreview.PageIndexLists[ExtractPreview.CurrentIndex] + 1).ToString();
+                    ExtractPreview.AwaitRenderBitmap(ExtractPreview.document);
+                }
+            }
+        }
         #endregion
 
         #region 框架行为

+ 1 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageInsertDialogViewModel.cs

@@ -17,7 +17,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         #region 参数和属性
         public CPDFDocument document;
 
-        private CPDFViewer currentViewer;
+        public CPDFViewer currentViewer;
 
         private HomePageInsertDialogModel insertModel = new HomePageInsertDialogModel();
 

+ 76 - 22
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs

@@ -23,9 +23,39 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
     {
         #region 参数和属性
         private List<string> fileNames;
-        
+
+        private int fileNamesIndex = 0;
+
         public List<int> fileNamesView = new List<int>();
+
         public HomePagePictureToPDFDialogModel pictureToPDFModel=new HomePagePictureToPDFDialogModel();
+
+        private string pictureToPDFGridIsEnabled = "True";
+        public string PictureToPDFGridIsEnabled
+        {
+            get
+            {
+                return pictureToPDFGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref pictureToPDFGridIsEnabled, value);
+            }
+        }
+
+        private string setPictureToPDFGridIsEnabled = "True";
+        public string SetPictureToPDFGridIsEnabled
+        {
+            get
+            {
+                return setPictureToPDFGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setPictureToPDFGridIsEnabled, value);
+            }
+        }
+
         private DataTable imagesDataTable = new DataTable();
         public DataTable ImagesDataTable
         {
@@ -68,6 +98,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         }
 
         #endregion
+
         #region 委托声明
 
         public DelegateCommand ToPDFCommand { get; set; }
@@ -92,16 +123,19 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         }
         #region 逻辑函数
         private void topdf() {
-            updateListview("正在转换");
-            DataTable imagesdatayable = new DataTable();
-            imagesdatayable.Columns.Add("FileName");
-            imagesdatayable.Columns.Add("FileSize");
-            imagesdatayable.Columns.Add("FileState");
+            PictureToPDFGridIsEnabled = "False";
             if (pictureToPDFModel.Mode == HomePagePictureToPDFDialogModel.ToPDFFileMode.NewFiles)
             {
+                fileNamesIndex = 0;
                 foreach (var filename in fileNames)
                 {
+                    ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "准备转换";
                     Image img = Image.FromFile(filename);
+                    if (img == null)
+                    {
+                        ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
+                        continue;
+                    }
                     CPDFDocument topdfdoc = CPDFDocument.CreateDocument();
                     FileInfo fileinfo = new FileInfo(filename);
                     JpegInsertPage(ref topdfdoc, filename, fileinfo,img.Width,img.Height);
@@ -109,8 +143,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                     topdfdoc.WriteToFilePath(savefilename(filename));
                     topdfdoc.Release();
                     string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
-                    imagesdatayable.Rows.Add(fileinfo.Name, file_size, "确认");
-                    ImagesDataTable = imagesdatayable;
+                    ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                    fileNamesIndex++;
                 }
                 System.Diagnostics.Process.Start("Explorer", "/select," + savefilename(fileNames[0]));
             }
@@ -119,13 +153,19 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 CPDFDocument topdfdoc = CPDFDocument.CreateDocument();
                 int pageindex = 0;
                 foreach (var filename in fileNames) {
+                    ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "准备转换";
                     Image img = Image.FromFile(filename);
+                    if (img == null)
+                    {
+                        ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
+                        continue;
+                    }
                     FileInfo fileinfo = new FileInfo(filename);
                     JpegInsertPage(ref topdfdoc, filename, fileinfo,img.Width, img.Height);
                     pageindex++;
                     string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
-                    imagesdatayable.Rows.Add(fileinfo.Name, file_size, "确认");
-                    ImagesDataTable = imagesdatayable;
+                    ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                    fileNamesIndex++;
                 }
                 System.Diagnostics.Process.Start("Explorer", "/select," + savefilename(fileNames[0]));
                 topdfdoc.WriteToFilePath(savefilename(fileNames[0]));
@@ -151,13 +191,19 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 int pageindex = topdfdoc.PageCount;
                 foreach (var filename in fileNames)
                 {
+                    ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "准备转换";
                     Image img = Image.FromFile(filename);
+                    if (img == null)
+                    {
+                        ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
+                        continue;
+                    }
                     FileInfo fileinfo = new FileInfo(filename);
                     JpegInsertPage(ref topdfdoc, filename, fileinfo, img.Width, img.Height, pageindex);
                     pageindex++;
                     string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
-                    imagesdatayable.Rows.Add(fileinfo.Name, file_size, "确认");
-                    ImagesDataTable = imagesdatayable;
+                    ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                    fileNamesIndex++;
                 }
                 topdfdoc.WriteToLoadedPath();
                 System.Diagnostics.Process.Start("Explorer", "/select," + topdfdoc.FilePath);
@@ -174,7 +220,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             FileInfo file = new FileInfo(filename);
             return filename.Replace(file.Name, "") +pictureToPDFModel.FrontFileNameLabel+file.Name+pictureToPDFModel.RearFileNameLabel+".pdf";
         }
+        #endregion
 
+        #region 批量处理逻辑函数
         /// <summary>
         /// 选择PDF文件
         /// </summary>
@@ -202,6 +250,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             {
                 fileNames.AddRange(dlg.FileNames.ToList());
                 RemoveExcess(ref fileNames);
+                SetPictureToPDFGridIsEnabled = "True";
                 AddFileVisibility = Visibility.Collapsed;
                 updateListview("待确定");
             }
@@ -229,6 +278,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 }
                 RemoveExcess(ref fileNames);
                 updateListview("待确定");
+                SetPictureToPDFGridIsEnabled = "True";
                 AddFileVisibility = Visibility.Collapsed;
             }
         }
@@ -245,15 +295,17 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             }
             if (fileNames.Count < 1)
             {
+                SetPictureToPDFGridIsEnabled = "False";
                 AddFileVisibility = Visibility.Visible;
             }
             updateListview("待确定");
         }
 
-        /// <summary>
-        /// 打开文件图片
-        /// </summary>
-        public void openfiledialog(){
+
+            /// <summary>
+            /// 打开文件图片
+            /// </summary>
+            public void openfiledialog(){
 
             foreach (int filenamesview in fileNamesView)
             {
@@ -291,21 +343,23 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         /// state 状态显示字符串
         /// </summary>
         public void updateListview( string state) {
-            DataTable imagesdatayable = new DataTable();
-            imagesdatayable.Columns.Add("FileName");
-            imagesdatayable.Columns.Add("FileSize");
-            imagesdatayable.Columns.Add("FileState");
+            DataTable imagesdatatable = new DataTable();
+            imagesdatatable.Columns.Add("FileName");
+            imagesdatatable.Columns.Add("FileSize");
+            imagesdatatable.Columns.Add("FileState");
             foreach (var fileName in fileNames)
             {
                 string file_all = fileName;
                 FileInfo f = new FileInfo(file_all);
                 string file_size = (((float)f.Length)/1024).ToString()+" K";
-                imagesdatayable.Rows.Add(f.Name, file_size, state);
+                imagesdatatable.Rows.Add(f.Name, file_size, state);
             }
-            ImagesDataTable = imagesdatayable;
+            ImagesDataTable = imagesdatatable;
 
         }
+        #endregion
 
+        #region 图片转换
         /// <summary>
         /// 图片转PNG
         /// picturefile 图片文件名

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1958 - 229
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs


+ 186 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModBookletContentViewModel.cs

@@ -1,17 +1,182 @@
-using Prism.Commands;
+using ComPDFKit.PDFDocument;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter;
+using Prism.Commands;
+using Prism.Events;
 using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
+using System.Management.Instrumentation;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 {
     public class HomePagePrinterModBookletContentViewModel : BindableBase, INavigationAware
     {
-        public HomePagePrinterModBookletContentViewModel()
+        private IEventAggregator eventAggregator;
+
+        private CPDFDocument document;
+
+        private bool _isAutoRotate;
+        public bool IsAutoRotate
+        {
+            get { return _isAutoRotate; }
+            set { _isAutoRotate = value; }
+        }
+
+        private int? _paperFrom;
+        public int? PaperFrom
+        {
+            get
+            {
+                return _paperFrom;
+            }
+            set
+            {
+                if (PaperTo == null)
+                {
+                    SetProperty(ref _paperFrom, 1);
+                }
+                else if (value < PaperTo)
+                {
+                    SetProperty(ref _paperFrom, value);
+                }
+                else
+                {
+                    SetProperty(ref _paperFrom, PaperTo);
+                }
+            }
+        }
+
+        private int? _paperTo;
+        public int? PaperTo
+        {
+            get
+            {
+                return _paperTo;
+            }
+            set
+            {
+                if (value < MaxPaperNumber)
+                {
+                    SetProperty(ref _paperTo, value);
+                }
+                else
+                {
+                    SetProperty(ref _paperTo, MaxPaperNumber);
+                }
+            }
+        }
+
+        private List<string> _subsetList;
+        public List<string> SubsetList
+        {
+            get { return _subsetList; }
+            set { _subsetList = value; }
+        }
+
+        private int _subsetIndex = 0;
+        public int SubsetIndex
+        {
+            get { return _subsetIndex; }
+            set
+            {
+                _subsetIndex = value;
+                InitBookletInfo();
+                SendBookletInfo();
+            }
+        }
+
+        private List<string> _bindingList;
+        public List<string> BindingList
+        {
+            get { return _bindingList; }
+            set { _bindingList = value; }
+        }
+
+        private int _bindingIndex = 0;
+        public int BindingIndex
+        {
+            get { return _bindingIndex; }
+            set
+            {
+                _bindingIndex = value;
+                InitBookletInfo();
+                SendBookletInfo();
+            }
+        }
+
+        private BookletInfo _bookletInfo;
+        public BookletInfo BookletInfo
+        {
+            get { return _bookletInfo; }
+            set { _bookletInfo = value; }
+        }
+
+        private int _maxPaperNumber;
+        public int MaxPaperNumber
         {
+            get { return _maxPaperNumber; }
+            set { _maxPaperNumber = value; }
+        }
+
+        public HomePagePrinterModBookletContentViewModel(IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+
+            SubsetList = new List<string>();
+            InitSubsetList();
+            BindingList = new List<string>();
+            InitBindingList();
+
+            BookletInfo = new BookletInfo();
+        }
 
+        private void InitSubsetList()
+        {
+            SubsetList.Clear();
+            SubsetList.Add("双面");
+            SubsetList.Add("仅正面");
+            SubsetList.Add("仅背面");
+        }
+
+        private void InitBindingList()
+        {
+            BindingList.Clear();
+            BindingList.Add("左");
+            BindingList.Add("右");
+        }
+
+        private void InitBookletInfo()
+        {
+            BookletInfo.EnumBookletSubset = (EnumBookletSubset)SubsetIndex;
+            BookletInfo.EnumBookletBinding = (EnumBookletBinding)BindingIndex;
+            if (PaperFrom != null)
+            {
+                BookletInfo.BeginPaperIndex = (int)PaperFrom;
+            }
+            else
+            {
+                BookletInfo.BeginPaperIndex = 1;
+            }
+            if (PaperTo != null)
+            {
+                BookletInfo.EndPaperIndex = (int)PaperTo;
+            }
+            else
+            {
+                BookletInfo.EndPaperIndex = MaxPaperNumber;
+            }
+            BookletInfo.IsAutoRotate = IsAutoRotate;
+        }
+
+        public void SendBookletInfo()
+        {
+            if (BookletInfo != null)
+            {
+                this.eventAggregator.GetEvent<ModInfoSendEvent>().Publish(BookletInfo);
+            }
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -25,6 +190,25 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
+            if (navigationContext.Parameters.ContainsKey("document"))
+            {
+                document = navigationContext.Parameters.GetValue<CPDFDocument>("document");
+                MaxPaperNumber = (document.PageCount % 4 == 0) ? (document.PageCount / 4) : (document.PageCount / 4 + 1);
+                if (PaperFrom == null)
+                {
+                    PaperFrom = 1;
+                }
+                if (PaperTo == null)
+                {
+                    PaperTo = MaxPaperNumber;
+                }
+                InitBookletInfo();
+                SendBookletInfo();
+            }
+            else
+            {
+                Trace.WriteLine("No Key Named{0}", "document");
+            }
         }
     }
 }

+ 249 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModMultipleContentViewModel.cs

@@ -0,0 +1,249 @@
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
+{
+    public class HomePagePrinterModMultipleContentViewModel : BindableBase, INavigationAware
+    {
+        private IEventAggregator eventAggregator;
+
+        private int? _verticalPageNumber;
+        public int? VerticalPageNumber
+        {
+            get { return _verticalPageNumber; }
+            set { SetProperty(ref _verticalPageNumber, value); }
+        }
+
+        private int? _horizontalPageNumber;
+        public int? HorizontalPageNumber
+        {
+            get { return _horizontalPageNumber; }
+            set { SetProperty(ref _horizontalPageNumber, value); }
+        }
+
+        private bool _isAutoRotate;
+        public bool IsAutoRotate
+        {
+            get { return _isAutoRotate; }
+            set { _isAutoRotate = value; }
+        }
+
+        private List<string> _pageMatrixList;
+        public List<string> PageMatrixList
+        {
+            get { return _pageMatrixList; }
+            set { _pageMatrixList = value; }
+        }
+
+        private int _pageMatrixIndex;
+        /// <summary>
+        /// <para>0: 1x2</para>
+        /// <para>1: 2x2</para>
+        /// <para>2: 3x2</para>
+        /// <para>3: 3x3</para>
+        /// <para>4: 4x4</para>
+        /// <para>5: 自定义</para>
+        /// </summary>
+        public int PageMatrixIndex
+        {
+            get { return _pageMatrixIndex; }
+            set
+            {
+                _pageMatrixIndex = value;
+                if (_pageMatrixIndex < 5)
+                {
+                    EnableCustomiseMatrix = false;
+                }
+                else
+                {
+                    EnableCustomiseMatrix = true;
+                }
+                SetPageMatrixValue(value);
+            }
+        }
+
+        private List<string> _pageOrderList;
+        public List<string> PageOrderList
+        {
+            get { return _pageOrderList; }
+            set { _pageOrderList = value; }
+        }
+
+        private int _pageOrderIndex;
+        /// <summary>
+        /// <para>0: Horizontal</para>
+        /// <para>1: HorizontalReversed</para>
+        /// <para>0: Vertical</para>
+        /// <para>0: VerticalReversed</para>
+        /// </summary>
+        public int PageOrderIndex
+        {
+            get { return _pageOrderIndex; }
+            set
+            {
+                _pageOrderIndex = value; 
+                InitMultipleInfo();
+                SendMultipleInfo();
+            }
+        }
+
+        private bool _enableCustomiseMatrix;
+        public bool EnableCustomiseMatrix
+        {
+            get { return _enableCustomiseMatrix; }
+            set
+            {
+                SetProperty(ref _enableCustomiseMatrix, value);
+            }
+        }
+
+        private MultipleInfo _multipleInfo;
+        /// <summary>
+        /// 多页参数
+        /// </summary>
+        public MultipleInfo MultipleInfo
+        {
+            get { return _multipleInfo; }
+            set { _multipleInfo = value; }
+        }
+
+        public HomePagePrinterModMultipleContentViewModel(IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+
+            PageMatrixIndex = 0;
+            PageOrderIndex = 0;
+            PageMatrixList = new List<string>();
+            InitPageMatrixList();
+            PageOrderList = new List<string>();
+            InitPageOrderList();
+
+            MultipleInfo = new MultipleInfo();
+        }
+
+        public void SendMultipleInfo()
+        {
+            if (MultipleInfo != null)
+            {
+                this.eventAggregator.GetEvent<ModInfoSendEvent>().Publish(MultipleInfo);
+            }
+        }
+
+        private void InitPageMatrixList()
+        {
+            PageMatrixList.Clear();
+            PageMatrixList.Add("2");
+            PageMatrixList.Add("4");
+            PageMatrixList.Add("6");
+            PageMatrixList.Add("9");
+            PageMatrixList.Add("16");
+            PageMatrixList.Add("自定义");
+        }
+
+        private void InitPageOrderList()
+        {
+            PageOrderList.Clear();
+            PageOrderList.Add("横向");
+            PageOrderList.Add("横向倒序");
+            PageOrderList.Add("纵向");
+            PageOrderList.Add("纵向倒序");
+        }
+
+        private void SetPageMatrixValue(int pageMatrixIndex)
+        {
+            switch (pageMatrixIndex)
+            {
+                case 0:
+                    HorizontalPageNumber = 1;
+                    VerticalPageNumber = 2;
+                    InitMultipleInfo();
+                    SendMultipleInfo();
+
+                    break;
+
+                case 1:
+                    HorizontalPageNumber = 2;
+                    VerticalPageNumber = 2;
+                    InitMultipleInfo();
+
+                    SendMultipleInfo();
+
+                    break;
+
+                case 2:
+                    HorizontalPageNumber = 3;
+                    VerticalPageNumber = 2;
+                    InitMultipleInfo();
+
+                    SendMultipleInfo();
+
+                    break;
+
+                case 3:
+                    HorizontalPageNumber = 3;
+                    VerticalPageNumber = 3;
+                    InitMultipleInfo();
+
+                    SendMultipleInfo();
+
+                    break;
+                case 4:
+                    HorizontalPageNumber = 4;
+                    VerticalPageNumber = 4;
+                    InitMultipleInfo();
+
+                    SendMultipleInfo();
+
+                    break;
+                case 5:
+                    HorizontalPageNumber = null;
+                    VerticalPageNumber = null;
+
+                    break;
+            }
+        }
+
+        private void InitMultipleInfo()
+        {
+            if (HorizontalPageNumber == null)
+            {
+                HorizontalPageNumber = 1;
+            }
+
+            if (VerticalPageNumber == null)
+            {
+                VerticalPageNumber = 1;
+            }
+            if (MultipleInfo != null)
+            {
+                MultipleInfo.VerticalPageNumber = (int)VerticalPageNumber;
+                MultipleInfo.HorizontalPageNumber = (int)HorizontalPageNumber;
+                MultipleInfo.EnumDisplayPageNumber = EnumDisplayPageNumber.StatusTwo;
+                MultipleInfo.IsAutoRotate = IsAutoRotate;
+                MultipleInfo.EnumPageOrder = (EnumPageOrder)PageOrderIndex;
+            }
+
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            InitMultipleInfo();
+            SendMultipleInfo();
+        }
+    }
+}

+ 131 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModSizeContentViewModel.cs

@@ -1,16 +1,143 @@
-using Prism.Commands;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter;
+using Prism.Commands;
+using Prism.Events;
 using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Management.Instrumentation;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 {
     public class HomePagePrinterModSizeContentViewModel : BindableBase, INavigationAware
     {
-        public HomePagePrinterModSizeContentViewModel()
+        private IEventAggregator eventAggregator;
+
+        private bool _isStatusAdaptive = true;
+        public bool IsStatusAdaptive
+        {
+            get { return _isStatusAdaptive; }
+            set
+            {
+                SetProperty(ref _isStatusAdaptive, value);
+            }
+        }
+
+        private bool _isStatusActural = false;
+        public bool IsStatusActural
+        {
+            get { return _isStatusActural; }
+            set
+            {
+                SetProperty(ref _isStatusActural, value);
+            }
+        }
+        
+        private bool _isStatusCustomized = false;
+        public bool IsStatusCustomized
+        {
+            get { return _isStatusCustomized; }
+            set { SetProperty(ref _isStatusCustomized, value); }
+        }
+
+        private string _displayRatio = "100";
+        public string DisplayRatio
+        {
+            get { return _displayRatio; }
+            set { SetProperty(ref _displayRatio, value); }
+        }
+
+        private SizeInfo _sizeInfo;
+        public SizeInfo SizeInfo
+        {
+            get { return _sizeInfo; }
+            set { _sizeInfo = value; }
+        }
+
+        public DelegateCommand SetStatusAdaptiveCommand { get; set; }
+        public DelegateCommand SetStatusActuralCommand { get; set; }
+        public DelegateCommand SetStatusCustomizedCommand { get; set; }
+        public DelegateCommand SetDisplayRatioCommand { get; set; }
+
+        //public DelegateCommand sendSizeInfoCommand;
+        //public DelegateCommand SendSizeInfoCommand => this.SendSizeInfoCommand ?? (this.sendSizeInfoCommand = new DelegateCommand(() => this.eventAggregator.GetEvent<ModInfoSendEvent>().Publish(PrintMod)));
+
+        public DelegateCommand SendSizeInfoCommand { get; set; }
+
+        public HomePagePrinterModSizeContentViewModel(IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+            SizeInfo = new SizeInfo();
+            SetStatusAdaptiveCommand = new DelegateCommand(SetStatusAdaptive);
+            SetStatusActuralCommand = new DelegateCommand(SetStatusActural);
+            SetStatusCustomizedCommand = new DelegateCommand(SetStatusCustomized);
+            SetDisplayRatioCommand = new DelegateCommand(SetDisplayRatio);
+        }
+
+        public void SendSizeInfo()
+        {
+            if(SizeInfo!= null)
+            {
+                this.eventAggregator.GetEvent<ModInfoSendEvent>().Publish(SizeInfo);
+            }
+        }
+
+        public void SetStatusActural()
+        {
+            IsStatusActural = true;
+            IsStatusAdaptive = false;
+            IsStatusCustomized = false;
+
+            SizeInfo.EnumSizeType = EnumSizeType.StatusActural;
+
+            SendSizeInfo();
+        }
+
+        public void SetStatusAdaptive()
+        {
+            IsStatusActural = false;
+            IsStatusAdaptive = true;
+            IsStatusCustomized = false;
+
+            SizeInfo.EnumSizeType = EnumSizeType.StatusAdaptive;
+            SendSizeInfo();
+        }
+
+        public void SetStatusCustomized()
+        {
+            IsStatusActural = false;
+            IsStatusAdaptive = false;
+            IsStatusCustomized = true;
+
+            SizeInfo.EnumSizeType = EnumSizeType.StatusCustomized;
+        }
+
+        public void SetDisplayRatio()
+        {
+            int previousDisplayRatio = SizeInfo.DisplayRatio;
+            SizeInfo.DisplayRatio = int.Parse(DisplayRatio);
+            if (previousDisplayRatio != SizeInfo.DisplayRatio)
+            {
+                SendSizeInfo();
+            }
+        }
+
+        private void InitSizeInfo()
         {
+            if (IsStatusAdaptive)
+            {
+                SizeInfo.EnumSizeType = EnumSizeType.StatusAdaptive;
+            }
+            else if (IsStatusActural)
+            {
+                SizeInfo.EnumSizeType = EnumSizeType.StatusActural;
+            }
+            else
+            {
+                SizeInfo.EnumSizeType = EnumSizeType.StatusCustomized;
+            }
+            SizeInfo.DisplayRatio = int.Parse(DisplayRatio);
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -24,6 +151,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
+            InitSizeInfo();
+            SendSizeInfo();
         }
     }
 }

+ 212 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterPageSetDialogViewModel.cs

@@ -1,23 +1,233 @@
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.InteropServices;
+using System.Windows;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 {
     public class HomePagePrinterPageSetDialogViewModel : BindableBase, IDialogAware
     {
+        private int _paperSizeIndex;
+        public int PaperSizeIndex
+        {
+            get { return _paperSizeIndex; }
+            set { _paperSizeIndex = value; }
+        }
+
+        private int _paperSizeWidth;
+        public int PaperSizeWidth
+        {
+            get { return _paperSizeWidth; }
+            set
+            {
+                SetProperty(ref _paperSizeWidth, value);
+            }
+        }
+
+        private int _paperSizeHeight;
+        public int PaperSizeHeight
+        {
+            get { return _paperSizeHeight; }
+            set
+            {
+                SetProperty(ref _paperSizeHeight, value);
+            }
+        }
+
+        private List<string> _paperSizeNameList;
+        public List<string> PaperSizeNameList
+        {
+            get { return _paperSizeNameList; }
+            set { _paperSizeNameList = value; }
+        }
+
+        public Dictionary<EnumPaperSize, string> GetPaperSizeNameFromEnumPaperSize;
+
+        private int _leftMargin;
+        public int LeftMargin
+        {
+            get { return _leftMargin; }
+            set { _leftMargin = value; }
+        }
+
+        private int _rightMargin;
+        public int RightMargin
+        {
+            get { return _rightMargin; }
+            set { _rightMargin = value; }
+        }
+
+        private int _bottomMargin;
+        public int BottomMargin
+        {
+            get { return _bottomMargin; }
+            set { _bottomMargin = value; }
+        }
+
+        private int _topMargin;
+        public int TopMargin
+        {
+            get { return _topMargin; }
+            set { _topMargin = value; }
+        }
+
+        private int[] _paperMargin;
+        public int[] PaperMargin
+        {
+            get { return _paperMargin; }
+            set { _paperMargin = value; }
+        }
+
+        private Visibility _isPageSizeStackPanelsVisible = Visibility.Hidden;
+        public Visibility IsPageSizeStackPanelsVisible
+        {
+            get { return _isPageSizeStackPanelsVisible; }
+            set { SetProperty(ref _isPageSizeStackPanelsVisible, value); }
+        }
+
+        public DelegateCommand SetPaperSizeCommand { get; set; }
+        public DelegateCommand ConfirmSetPageSizeCommand { get; set; }
+        public DelegateCommand CancelSetPageSizeCommand { get; set; }
+
         public HomePagePrinterPageSetDialogViewModel()
         {
+            HomePagePrinterDialogModel homePagePrinterDialogModel = new HomePagePrinterDialogModel();
+            SetPaperSizeCommand = new DelegateCommand(SetPaperSize);
+            ConfirmSetPageSizeCommand = new DelegateCommand(ConfirmSetPageSize);
+            CancelSetPageSizeCommand = new DelegateCommand(CancelSetPageSize);
 
+            GetPaperSizeNameFromEnumPaperSize = new Dictionary<EnumPaperSize, string> { };
+            InitGetPaperSizeNameFromEnumPaperSize(ref GetPaperSizeNameFromEnumPaperSize);
+            InitPaperSizeList();
         }
 
-        public string Title => "";
+        public void InitGetPaperSizeNameFromEnumPaperSize(ref Dictionary<EnumPaperSize, string> Dictionary)
+        {
+            GetPaperSizeNameFromEnumPaperSize.Clear();
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusA3, "A3");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusA4, "A4");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusA5, "A5");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusB5, "B5");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusNo10Envelope, "10号信封");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusChoukei3Envelope, "Choukei 3信封");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusDLEnvelope, "DL信封");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusJISB5, "JIS B5");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusROC16K, "ROC 16K");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusExtraLargeBA3, "超大型B/A3型");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusTabloid, "小报用纸");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusExraLargeTabloid, "小报用纸(特大)");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusAmericanLegal, "美国法定用纸");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusAmericanLetter, "美国信纸");
+            GetPaperSizeNameFromEnumPaperSize.Add(EnumPaperSize.StatusCustomized, "自定义");
+        }
+
+        public void InitPaperSizeList()
+        {
+            PaperSizeNameList = new List<string>();
+            for (int temp = 0; temp < GetPaperSizeNameFromEnumPaperSize.Count; temp++)
+            {
+                PaperSizeNameList.Add(GetPaperSizeNameFromEnumPaperSize[(EnumPaperSize)temp]);
+            }
+        }
+
+        public void SetPaperSize()
+        {
+            IsPageSizeStackPanelsVisible = Visibility.Hidden;
+            switch (PaperSizeIndex)
+            {
+                case (int)EnumPaperSize.StatusA3:
+                    PaperSizeWidth = 297;
+                    PaperSizeHeight = 420;
+                    break;
+                case (int)EnumPaperSize.StatusA4:
+                    PaperSizeWidth = 210;
+                    PaperSizeHeight = 297;
+                    break;
+                case (int)EnumPaperSize.StatusA5:
+                    PaperSizeWidth = 148;
+                    PaperSizeHeight = 210;
+                    break;
+                case (int)EnumPaperSize.StatusB5:
+                    PaperSizeWidth = 176;
+                    PaperSizeHeight = 250;
+                    break;
+                case (int)EnumPaperSize.StatusNo10Envelope:
+                    PaperSizeWidth = 458;
+                    PaperSizeHeight = 324;
+                    break;
+                case (int)EnumPaperSize.StatusChoukei3Envelope:
+                    PaperSizeWidth = 120;
+                    PaperSizeHeight = 235;
+                    break;
+                case (int)EnumPaperSize.StatusDLEnvelope:
+                    PaperSizeWidth = 220;
+                    PaperSizeHeight = 110;
+                    break;
+                case (int)EnumPaperSize.StatusJISB5:
+                    PaperSizeWidth = 176;
+                    PaperSizeHeight = 276;
+                    break;
+                case (int)EnumPaperSize.StatusROC16K:
+                    PaperSizeWidth = 197;
+                    PaperSizeHeight = 273;
+                    break;
+                case (int)EnumPaperSize.StatusExtraLargeBA3:
+                    PaperSizeWidth = 330;
+                    PaperSizeHeight = 483;
+                    break;
+                case (int)EnumPaperSize.StatusTabloid:
+                    PaperSizeWidth = 431;
+                    PaperSizeHeight = 279;
+                    break;
+                case (int)EnumPaperSize.StatusExraLargeTabloid:
+                    PaperSizeWidth = 305;
+                    PaperSizeHeight = 457;
+                    break;
+                case (int)EnumPaperSize.StatusAmericanLegal:
+                    PaperSizeWidth = 216;
+                    PaperSizeHeight = 356;
+                    break;
+                case (int)EnumPaperSize.StatusAmericanLetter:
+                    PaperSizeWidth = 216;
+                    PaperSizeHeight = 279;
+                    break;
+                case (int)EnumPaperSize.StatusCustomized:
+                    IsPageSizeStackPanelsVisible = Visibility.Visible;
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        public void ConfirmSetPageSize()
+        {
+            var dialogResult = new DialogResult(ButtonResult.OK);
+            dialogResult.Parameters.Add("LeftMargin", LeftMargin);
+            dialogResult.Parameters.Add("TopMargin", TopMargin);
+            dialogResult.Parameters.Add("RightMargin", RightMargin);
+            dialogResult.Parameters.Add("BottomMargin", BottomMargin);
+            dialogResult.Parameters.Add("PaperWidth", PaperSizeWidth);
+            dialogResult.Parameters.Add("PaperHeight", PaperSizeHeight);
+            dialogResult.Parameters.Add("PaperSizeIndex", PaperSizeIndex);
+            RequestClose.Invoke(dialogResult);
+        }
+
+        public void CancelSetPageSize()
+        {
+            var dialogResult = new DialogResult(ButtonResult.Cancel);
+            RequestClose.Invoke(dialogResult);
+        }
 
         public event Action<IDialogResult> RequestClose;
 
+        public string Title => "";
+
+
         public bool CanCloseDialog()
         {
             return true;
@@ -25,11 +235,11 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 
         public void OnDialogClosed()
         {
+
         }
 
         public void OnDialogOpened(IDialogParameters parameters)
         {
-
         }
     }
 }

+ 14 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/ModInfoSendEvent.cs

@@ -0,0 +1,14 @@
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter;
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
+{
+    internal class ModInfoSendEvent : PubSubEvent<PrintMod>
+    {
+    }
+}

+ 100 - 32
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageSplitDialogViewModel.cs

@@ -9,6 +9,7 @@ using PDF_Office.Helper;
 using System.Diagnostics;
 using PDF_Office.CustomControl;
 using PDF_Office.Model.HomePageToolsDialogs;
+using System.Linq;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
 {
@@ -17,7 +18,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         #region 参数和属性
         public CPDFDocument document;
 
-        private CPDFViewer currentViewer;
+        public CPDFViewer currentViewer;
 
         private HomePageSplitDialogModel splitModel = new HomePageSplitDialogModel();
 
@@ -25,9 +26,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
 
         private string savefilename { get; set; }
 
-        private string pageRangeText = "0";
         public string PageRangeText { set; get; } = "0";
-        
+
         public string PageRangeSelectIndex { set; get; } = "0";
 
         private string averagePagesIsCheck = "True";
@@ -93,7 +93,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         public string AveragePagesText { set; get; } = "";
 
         public string AverageFilesText { set; get; } = "";
-        
+
 
         private string filePathName = "";
         public string FilePathName
@@ -105,14 +105,14 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             }
         }
 
-        public string FileNameLabelText{ set; get; } = "part";
-        
+        public string FileNameLabelText { set; get; } = "part";
+
+
+        public string FileNameDeimiterText { set; get; } = "-";
 
-        public string FileNameDeimiterText{ set; get; } = "-";
-        
 
         public string FrontFileIsCheck { set; get; } = "True";
-       
+
         public string FileNameLabelIsCheck { set; get; } = "True";
 
         public string FileNameDeimiterIsCheck { set; get; } = "True";
@@ -158,6 +158,10 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         public DelegateCommand FileNameDeimiterChangeCommand { get; set; }
 
         public DelegateCommand FileNameLabelChangeCommand { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
         #endregion
 
         public HomePageSplitDialogViewModel()
@@ -172,6 +176,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             FileNameDeimiterCommand = new DelegateCommand(fileNameDeimiter);
             FileNameDeimiterChangeCommand = new DelegateCommand(fileNameDeimiter);
             FileNameLabelChangeCommand = new DelegateCommand(fileNameLabel);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
 
 
         }
@@ -424,38 +430,100 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 }
             }
         }
-        #endregion
 
-        #region 构架行为
-        public string Title => "";
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var SplitPreview = e as PageTurningPreview;
+            if (SplitPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "1" || PageRangeSelectIndex == "2")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref SplitPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
 
-        public event Action<IDialogResult> RequestClose;
+                }
+                SplitPreview.PageIndex.Text = (SplitPreview.PageIndexLists.Last<int>() + 1).ToString();
+                SplitPreview.CurrentIndex = 0;
+                SplitPreview.CurrentPage.Text = (SplitPreview.PageIndexLists[SplitPreview.CurrentIndex] + 1).ToString();
+                SplitPreview.AwaitRenderBitmap(SplitPreview.document);
+            }
+        }
 
-        public bool CanCloseDialog()
+        private void CmbPageTextChangedEvent(object e)
         {
-            return true;
+            var SplitPreview = e as PageTurningPreview;
+            if (SplitPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
+                char[] enumerationSeparator = new char[] { ',' };
+                char[] rangeSeparator = new char[] { '-' };
+
+                if (!CommonHelper.GetPagesInRange(ref SplitPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                { //TODO
+                    SplitPreview.PageIndexLists.Add(0);
+
+                    return;
+                }
+                else
+                {
+                    SplitPreview.PageIndex.Text = (SplitPreview.PageIndexLists.Last<int>() + 1).ToString();
+                    SplitPreview.CurrentIndex = 0;
+                    SplitPreview.CurrentPage.Text = (SplitPreview.PageIndexLists[SplitPreview.CurrentIndex] + 1).ToString();
+                    SplitPreview.AwaitRenderBitmap(SplitPreview.document);
+                }
+            }
         }
+    
+    #endregion
 
-        public void OnDialogClosed()
-        {
+    #region 构架行为
+    public string Title => "";
 
-        }
+    public event Action<IDialogResult> RequestClose;
 
-        public void OnDialogOpened(IDialogParameters parameters)
+    public bool CanCloseDialog()
+    {
+        return true;
+    }
+
+    public void OnDialogClosed()
+    {
+
+    }
+
+    public void OnDialogOpened(IDialogParameters parameters)
+    {
+        CPDFViewer viewer = null;
+        string filepath = "";
+        parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out viewer);
+        parameters.TryGetValue<string>(ParameterNames.FilePath, out filepath);
+        if (viewer != null && viewer.Document != null)
         {
-            CPDFViewer viewer = null;
-            string filepath = "";
-            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out viewer);
-            parameters.TryGetValue<string>(ParameterNames.FilePath, out filepath);
-            if (viewer != null && viewer.Document != null)
-            {
-                currentViewer = viewer;
-                document = viewer.Document;
-                savefilename = currentViewer.Document.FileName;
-                FilePathName = savefilename + "-" + "part" + ".pdf";
-                savefilepath = filepath.Replace(savefilename + ".pdf", "");
-            }
+            currentViewer = viewer;
+            document = viewer.Document;
+            savefilename = currentViewer.Document.FileName;
+            FilePathName = savefilename + "-" + "part" + ".pdf";
+            savefilepath = filepath.Replace(savefilename + ".pdf", "");
         }
-        #endregion
     }
+    #endregion
+}
 }

+ 1 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs

@@ -32,7 +32,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
         #region 逻辑函数
         private void ConfirmCheckPassword()
         {
-            if (false)//预留,用于检测输入密码的权限,以及是否输入了正确的密码
+            if (false)//TODO: 用于检测输入密码的权限,以及是否输入了正确的密码
             {  }
             var dialogResult = new DialogResult(ButtonResult.OK);
             dialogResult.Parameters.Add("CheckPassword", true);

+ 95 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs

@@ -0,0 +1,95 @@
+using Dropbox.Api.Sharing;
+using PDF_Office.EventAggregators;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Windows;
+using System.Linq;
+using System.Windows.Controls;
+using Visibility = System.Windows.Visibility;
+using Dropbox.Api.FileProperties;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundContentViewModel : BindableBase,INavigationAware
+    {
+        public IEventAggregator eventAggregator;
+        public IRegionManager backgroundRegion;
+
+        public string TemplateListName = "BackgroundTemplateListBaseContent";
+        public string CreateName = "BackgroundCreateBaseContent";
+
+        private string _backgroundSettingsRegionName;
+        public string BackgroundSettingsRegionName
+        {
+            get { return _backgroundSettingsRegionName; }
+            set { _backgroundSettingsRegionName = value;}
+        }
+
+        private Visibility _backgroundSettingsVisible = Visibility.Collapsed;
+        public Visibility BackgroundSettingsVisible
+        {
+            get { return _backgroundSettingsVisible; }
+            set { _backgroundSettingsVisible = value; }
+        }
+
+        /// <summary>
+        /// 退出EditTool
+        /// </summary>
+        public DelegateCommand CloseEditToolCommand { get; set; }
+
+        public DelegateCommand<string> EnterSelectedContentCommand { get; set; }
+
+        public BackgroundContentViewModel( IRegionManager regionManager, IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+            this.backgroundRegion = regionManager;
+            BackgroundSettingsVisible = Visibility.Visible;
+            BackgroundSettingsRegionName = Guid.NewGuid().ToString();
+
+            CloseEditToolCommand = new DelegateCommand(CloseEditTool);
+            EnterSelectedContentCommand = new DelegateCommand<string>(EnterSelectedContent);
+
+            eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Subscribe(EnterTemplateListOrCreate);
+        }
+
+        public void CloseEditTool()
+        {
+            this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish();
+        }
+
+        public void EnterTemplateListOrCreate(EnumTemplateListOrCreate enumTemplateListOrCreate)
+        {
+            if(enumTemplateListOrCreate == EnumTemplateListOrCreate.StatusTemplate)
+            {
+                EnterSelectedContent(TemplateListName);
+            }
+            else
+            {
+                EnterSelectedContent(CreateName);
+            }
+        }
+
+        public void EnterSelectedContent(string SelectedContentName)
+        {
+            backgroundRegion.RequestNavigate(BackgroundSettingsRegionName, SelectedContentName);
+            BackgroundSettingsVisible = Visibility.Visible;
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            EnterSelectedContent(TemplateListName);
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 92 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundCreateBaseContentViewModel.cs

@@ -0,0 +1,92 @@
+using PDF_Office.EventAggregators;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundCreateBaseContentViewModel : BindableBase, INavigationAware
+    {
+        IEventAggregator eventAggregator;
+        IRegionManager backgroundCreateRegion;
+
+
+        private string backgroundCreateRegionName;
+
+        public string BackgroundCreateRegionName
+        {
+            get => backgroundCreateRegionName;
+            set => SetProperty(ref backgroundCreateRegionName, value);
+        }
+
+        private string _currentCreateName;
+        public string CurrentCreateName
+        {
+            get => _currentCreateName;
+            set=>_currentCreateName= value;
+        }
+
+
+        private System.Windows.Visibility backgroundCreateVisible;
+        public System.Windows.Visibility BackgroundCreateVisible
+        {
+            get => backgroundCreateVisible;
+            set => SetProperty(ref backgroundCreateVisible, value);
+        }
+
+        public DelegateCommand<object> ChangeCreateModCommand { get; set; }
+        public DelegateCommand EnterTemplateListCommand { get; set; }
+
+
+        public BackgroundCreateBaseContentViewModel(IRegionManager regionManager,IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+            this.backgroundCreateRegion = regionManager;
+            BackgroundCreateRegionName = Guid.NewGuid().ToString();
+            ChangeCreateModCommand = new DelegateCommand<object>(ChangeCreateMod);
+            EnterTemplateListCommand = new DelegateCommand(EnterTemplateList);
+            EnterSelectedCreateMod("BackgroundCreateColorContent");
+        }
+
+        public void EnterTemplateList()
+        {
+            this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(EnumTemplateListOrCreate.StatusTemplate);
+        }
+
+        public void EnterSelectedCreateMod(string currentCreateName)
+        {
+            backgroundCreateRegion.RequestNavigate(BackgroundCreateRegionName, currentCreateName);
+            backgroundCreateVisible = System.Windows.Visibility.Visible;
+        }
+
+        public void ChangeCreateMod(object e)
+        {
+            var args = e as Button;
+            if (args != null)
+            {
+                CurrentCreateName = args.Name;
+                EnterSelectedCreateMod(CurrentCreateName);
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 5 - 10
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModMutipleContentViewModel.cs

@@ -1,19 +1,14 @@
-using Prism.Commands;
-using Prism.Mvvm;
-using Prism.Regions;
+using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
 
-namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
+namespace PDF_Office.ViewModels.EditTools.Background
 {
-    public class HomePagePrinterModMutipleContentViewModel : BindableBase, INavigationAware
+    internal class BackgroundCreateColorContentViewModel : INavigationAware
     {
-        public HomePagePrinterModMutipleContentViewModel()
-        {
-
-        }
-
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;

+ 25 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundCreateFileContentViewModel.cs

@@ -0,0 +1,25 @@
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    internal class BackgroundCreateFileContentViewModel : INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 92 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListBaseContentViewModel.cs

@@ -0,0 +1,92 @@
+using Dropbox.Api.FileProperties;
+using PDF_Office.EventAggregators;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Drawing.Printing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundTemplateListBaseContentViewModel : BindableBase, INavigationAware
+    {
+        public IRegionManager backgroundTemplateListRegion;
+        private readonly IEventAggregator eventAggregator;
+
+        private string _currentTemplateListName;
+        public string CurrentTemplateListName
+        {
+            get { return _currentTemplateListName; }
+            set { _currentTemplateListName = value; }
+        }
+
+        private string backgroundTemplateListRegionName;
+
+        public string BackgroundTemplateListRegionName
+        {
+            get => backgroundTemplateListRegionName;
+            set => SetProperty(ref backgroundTemplateListRegionName, value);
+        }
+
+
+        private System.Windows.Visibility backgroundTemplateListVisible;
+        public System.Windows.Visibility BackgroundTemplateListVisible
+        {
+            get => backgroundTemplateListVisible;
+            set => SetProperty(ref backgroundTemplateListVisible, value);
+        }
+
+        public DelegateCommand<object> ChangeTemplateListModCommand { get; set; }
+        public DelegateCommand EnterCreateCommand { get; set; }
+
+        public BackgroundTemplateListBaseContentViewModel(IRegionManager backgroundTemplateListRegion, IEventAggregator eventAggregator)
+        {
+            this.backgroundTemplateListRegion = backgroundTemplateListRegion;
+            this.eventAggregator = eventAggregator;
+            BackgroundTemplateListRegionName = Guid.NewGuid().ToString();
+            ChangeTemplateListModCommand = new DelegateCommand<object>(ChangeTemplateListMod);
+            EnterCreateCommand = new DelegateCommand(EnterCreate);
+            EnterSelectedTemplateListMod("BackgroundTemplateListColorContent");
+        }
+
+        public void EnterCreate()
+        {
+            this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(EnumTemplateListOrCreate.StatusCreate);
+        }
+
+        public void EnterSelectedTemplateListMod(string currentTemplateListName)
+        {
+            backgroundTemplateListRegion.RequestNavigate(BackgroundTemplateListRegionName, currentTemplateListName);
+            backgroundTemplateListVisible = System.Windows.Visibility.Visible;
+        }
+
+        public void ChangeTemplateListMod(object e)
+        {
+            var args = e as Button;
+            if (args != null)
+            {
+                CurrentTemplateListName = args.Name;
+                EnterSelectedTemplateListMod(CurrentTemplateListName);
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 25 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListColorContentViewModel.cs

@@ -0,0 +1,25 @@
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    internal class BackgroundTemplateListColorContentViewModel : INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 25 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListFileContentViewModel.cs

@@ -0,0 +1,25 @@
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundTemplateListFileContentViewModel : INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 28 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs

@@ -0,0 +1,28 @@
+using PDF_Office.EventAggregators;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkContentViewModel : BindableBase
+    {
+        public IEventAggregator eventAggregator;
+
+
+        public DelegateCommand CloseEditToolCommand { get; set; }
+        public WatermarkContentViewModel(IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+            CloseEditToolCommand = new DelegateCommand(CloseEditTool);
+        }
+        public void CloseEditTool()
+        {
+            this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish();
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateBaseContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkCreateBaseContentViewModel : BindableBase
+    {
+        public WatermarkCreateBaseContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkCreateFileContentViewModel : BindableBase
+    {
+        public WatermarkCreateFileContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkCreateTextContentViewModel : BindableBase
+    {
+        public WatermarkCreateTextContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListBaseContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkTemplateListBaseContentViewModel : BindableBase
+    {
+        public WatermarkTemplateListBaseContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListFileContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkTemplateListFileContentViewModel : BindableBase
+    {
+        public WatermarkTemplateListFileContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListTextContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkTemplateListTextContentViewModel : BindableBase
+    {
+        public WatermarkTemplateListTextContentViewModel()
+        {
+
+        }
+    }
+}

+ 36 - 4
PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
 using PDF_Office.Model;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using PDF_Office.Model.PDFTool;
 using PDF_Office.Views.HomePanel.PDFTools;
 using Prism.Commands;
@@ -35,18 +36,24 @@ namespace PDF_Office.ViewModels.HomePanel
             System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
             dlg.Multiselect = false;
             dlg.Filter = "PDF|*.pdf;*.PDF;";
-            if (toolItem.Tag == PDFToolType.Merge)
+            if (toolItem.Tag == PDFToolType.Compress || toolItem.Tag == PDFToolType.Security)
             {
                 dlg.Multiselect = true;
-                dlg.Filter = "Picture|*.png;*.PNG;*.jpg;*.JPG;*bmp;*jpeg;*gif;*tiff;*webp;";
+            }
+                if (toolItem.Tag == PDFToolType.Merge)
+            {
+                dlg.Multiselect = true;
+                dlg.Filter = "Picture|*.png;*.PNG;*.jpg;*.JPG;*bmp;*jpeg;*gif;*tiff;";
             }
             if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 CPDFViewer viewer = new CPDFViewer();
-                viewer.InitDocument(dlg.FileName);
+                
                 switch (toolItem.Tag)
                 {
                     case PDFToolType.Split:
+                        
+                        viewer.InitDocument(dlg.FileName);
                         DialogParameters splitvalue = new DialogParameters();
                         splitvalue.Add(ParameterNames.PDFViewer, viewer);
                         splitvalue.Add(ParameterNames.FilePath, dlg.FileName);
@@ -54,6 +61,7 @@ namespace PDF_Office.ViewModels.HomePanel
                         break;
 
                     case PDFToolType.Extract:
+                        viewer.InitDocument(dlg.FileName);
                         DialogParameters extractvalue = new DialogParameters();
                         extractvalue.Add(ParameterNames.PDFViewer, viewer);
                         extractvalue.Add(ParameterNames.FilePath, dlg.FileName);
@@ -61,6 +69,7 @@ namespace PDF_Office.ViewModels.HomePanel
                         break;
 
                     case PDFToolType.Insert:
+                        viewer.InitDocument(dlg.FileName);
                         DialogParameters insertvalue = new DialogParameters();
                         insertvalue.Add(ParameterNames.PDFViewer, viewer);
                         insertvalue.Add(ParameterNames.FilePath, dlg.FileName);
@@ -68,6 +77,12 @@ namespace PDF_Office.ViewModels.HomePanel
                         break;
 
                     case PDFToolType.Compress:
+                        DialogParameters compresspdf = new DialogParameters();
+                        compresspdf.Add(ParameterNames.BatchProcessing_Name, "1");
+                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+                        compresspdf.Add(ParameterNames.FilePath, dlg.FileNames);
+                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, compresspdf, e => { });
                         break;
 
                     case PDFToolType.Merge:
@@ -77,13 +92,30 @@ namespace PDF_Office.ViewModels.HomePanel
                         break;
 
                     case PDFToolType.Print:
+                        viewer.InitDocument(dlg.FileName);
                         DialogParameters printvalue = new DialogParameters();
-                        printvalue.Add(ParameterNames.PDFViewer, viewer); ;
+                        printvalue.Add(ParameterNames.PDFViewer, viewer);
                         printvalue.Add(ParameterNames.FilePath, dlg.FileName);
                         dialogs.ShowDialog(DialogNames.HomePagePrinterDialog, printvalue, e => { });
                         break;
 
                     case PDFToolType.Security:
+                        DialogParameters securitypdf = new DialogParameters();
+                        securitypdf.Add(ParameterNames.BatchProcessing_Name, "2");
+                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 2;
+                        securitypdf.Add(ParameterNames.FilePath, dlg.FileNames);
+                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, securitypdf, e => { });
+                        
+                        break;
+                    case PDFToolType.ConvertPDF:
+                        DialogParameters convertpdf = new DialogParameters();
+                        convertpdf.Add(ParameterNames.BatchProcessing_Name, "0");
+                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
+                        convertpdf.Add(ParameterNames.FilePath, dlg.FileNames);
+                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdf, e => { });
+
                         break;
                 }
 

+ 7 - 7
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -128,16 +128,16 @@ namespace PDF_Office.ViewModels.PageEdit
             }
         }
 
-        private bool isMutiSelected;
+        private bool isMultiSelected;
         /// <summary>
         /// 是否有多选 用于判断倒序和替换功能
         /// </summary>
-        public bool IsMutiSelected
+        public bool IsMultiSelected
         {
-            get { return isMutiSelected; }
+            get { return isMultiSelected; }
             set
             {
-                SetProperty(ref isMutiSelected, value);
+                SetProperty(ref isMultiSelected, value);
             }
         }
 
@@ -327,7 +327,7 @@ namespace PDF_Office.ViewModels.PageEdit
 
             SplitCommand = new DelegateCommand(SplitCommandEvent);
             InsertCommand = new DelegateCommand<object>(InsertCommandEvent);
-            ReplaceCommand = new DelegateCommand(ReplaceCommandEvent, CanReplaceCommandExcute).ObservesProperty(() => IsMutiSelected);
+            ReplaceCommand = new DelegateCommand(ReplaceCommandEvent, CanReplaceCommandExcute).ObservesProperty(() => IsMultiSelected);
             ExtractCommand = new DelegateCommand(ExtractCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
             DeleteCommand = new DelegateCommand(DeleteCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
             LeftRotateCommand = new DelegateCommand(LeftRotateCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
@@ -421,7 +421,7 @@ namespace PDF_Office.ViewModels.PageEdit
             else
             {
                 insertIndex = listSelecedIndex+1;
-                if(isMutiSelected)
+                if(isMultiSelected)
                 {
                     insertIndex = maxSelectedIndex+1;
                 }
@@ -590,7 +590,7 @@ namespace PDF_Office.ViewModels.PageEdit
         /// <returns></returns>
         private bool CanReplaceCommandExcute()
         {
-            return !IsMutiSelected;
+            return !IsMultiSelected;
         }
 
         /// <summary>

+ 92 - 0
PDF Office/ViewModels/Tools/ConverterBarContentViewModel.cs

@@ -0,0 +1,92 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Controls;
+
+namespace PDF_Office.ViewModels.Tools
+{
+    public class ConverterBarContentViewModel : BindableBase, INavigationAware
+    {
+        private bool isFirstLoad = true;
+
+        private CPDFViewer PDFViewer;
+
+        public IDialogService dialogs;
+
+        private ViewContentViewModel viewContentViewModel;
+
+        public DelegateCommand<object> ToConverterCommand { get; set; }
+
+        public ConverterBarContentViewModel(IDialogService dialogService)
+        {
+            dialogs = dialogService;
+            ToConverterCommand = new DelegateCommand<object>(toconverter);
+        }
+
+        private void toconverter(object sender)
+        {
+            var args = sender as Button;
+            if (args != null)
+            {
+                DialogParameters value = new DialogParameters();
+                value.Add(ParameterNames.PDFViewer, PDFViewer);
+                switch (args.Name) {
+                    case "ConverterWordBtn":
+                        dialogs.ShowDialog(DialogNames.ConverterWordDialog, value, e => { });
+                        break;
+                    case "ConverterExcelBtn":
+                        dialogs.ShowDialog(DialogNames.ConverterExcelDialog, value, e => { });
+                        break;
+                    case "ConverterPPTBtn":
+                        dialogs.ShowDialog(DialogNames.ConverterPPTDialog, value, e => { });
+                        break;
+                    case "ConverterRTFBtn":
+                        dialogs.ShowDialog(DialogNames.ConverterRTFDialog, value, e => { });
+                        break;
+                    case "ConverterCSVBtn":
+                        dialogs.ShowDialog(DialogNames.ConverterCSVDialog, value, e => { });
+                        break;
+                    case "ConverterHTMLBtn":
+                        dialogs.ShowDialog(DialogNames.ConverterHTMLDialog, value, e => { });
+                        break;
+                    case "ConverterTextBtn":
+                        dialogs.ShowDialog(DialogNames.ConverterTextDialog, value, e => { });
+                        break;
+                    case "ConverterImgBtn":
+                        dialogs.ShowDialog(DialogNames.ConverterImgDialog, value, e => { });
+                        break;
+                    default:
+                        break;
+
+
+                }
+            }
+            }
+
+            public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+            
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
+            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
+            if (PDFViewer != null)
+            {
+                isFirstLoad = false;
+            }
+        }
+    }
+}

+ 23 - 2
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -1,6 +1,8 @@
 using ComPDFKitViewer.PdfViewer;
+using PDF_Office.EventAggregators;
 using PDF_Office.Model;
 using Prism.Commands;
+using Prism.Events;
 using Prism.Mvvm;
 using Prism.Regions;
 using Prism.Services.Dialogs;
@@ -19,6 +21,8 @@ namespace PDF_Office.ViewModels.Tools
 
         public IDialogService dialogs;
 
+        public IEventAggregator eventAggregator;
+
         /// <summary>
         /// 是否是第一次加载
         /// </summary>
@@ -30,15 +34,32 @@ namespace PDF_Office.ViewModels.Tools
 
         public DelegateCommand CancelPasswordCommand { get; set; }
 
-        public ToolsBarContentViewModel(IDialogService dialogService)
+        public DelegateCommand<object> SetEditToolsCommand { get; set; }
+
+        public DelegateCommand SetWatermarkCommand { get; set; }
+
+
+
+        public ToolsBarContentViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
         {
             dialogs= dialogService;
-
+            this.eventAggregator= eventAggregator;
             CompressCommand = new DelegateCommand(OpenCompressDialog);
             SetPasswordCommand = new DelegateCommand(OpenSetPasswordDialog);
             CancelPasswordCommand = new DelegateCommand(OpenCancelPasswordDialog);
+            SetEditToolsCommand = new DelegateCommand<object>(SetEditTools);
         }
 
+        private void SetEditTools(object e)
+        {
+            var args = e as System.Windows.Controls.Button;
+            if (args != null)
+            {
+                this.eventAggregator.GetEvent<EnterSelectedEditToolEvent>().Publish(args.Name);
+            }
+        }
+
+
         private void OpenCompressDialog()
         {
             DialogParameters value = new DialogParameters();

+ 139 - 15
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -20,6 +20,9 @@ using PDFSettings;
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.ViewModels.Tools;
 using PDF_Office.Views;
+using Prism.Events;
+using PDF_Office.EventAggregators;
+using PDF_Office.Views.EditTools.Background;
 
 namespace PDF_Office.ViewModels
 {
@@ -47,6 +50,10 @@ namespace PDF_Office.ViewModels
 
         public string ReadModeRegionName { get; set; }
 
+        public string ConverterBarContentRegionName { get; set; }
+
+       public string BackgroundContentRegionName{get; set;}
+
         /// <summary>
         /// 底部工具栏 RegionName
         /// </summary>
@@ -61,6 +68,37 @@ namespace PDF_Office.ViewModels
 
         public Action PageEditRedo { get; set; }
 
+        /// <summary>
+        ///工具条
+        ///0:收起
+        ///40:显示
+        /// </summary>
+        private int toolRowHeight = 40;
+        public int ToolRowHeight
+        {
+            get { return toolRowHeight; }
+            set
+            {
+                SetProperty(ref toolRowHeight, value);
+            }
+        }
+
+        /// <summary>
+        /// 水印,背景侧边栏宽度
+        /// 0:收起
+        /// 260:显示
+        /// </summary>
+        private int propertyColumnWidth = 0;
+        public int PropertyColumnWidth
+        {
+            get { return propertyColumnWidth; }
+            set
+            {
+                SetProperty(ref propertyColumnWidth, value);
+            }
+        }
+
+
         private int gridToolRow = 1;
 
         /// <summary>
@@ -104,6 +142,19 @@ namespace PDF_Office.ViewModels
             }
         }
 
+        private Visibility gridVisibility = Visibility.Visible;
+        /// <summary>
+        /// 是否正在加载中
+        /// </summary>
+        public Visibility GridVisibility
+        {
+            get { return gridVisibility; }
+            set
+            {
+                SetProperty(ref gridVisibility, value);
+            }
+        }
+
         private Visibility isLoading = Visibility.Collapsed;
 
         /// <summary>
@@ -118,18 +169,33 @@ namespace PDF_Office.ViewModels
             }
         }
 
+        private Visibility converterBarContentVisible = Visibility.Collapsed;
         private Visibility toolsbarContentVisible = Visibility.Collapsed;
 
+        /// <summary>
+        /// 控制ToolsBarContent的显示
+        /// 留意:显示前需要先注入内容、设置好行和跨行数
+        /// </summary>
+        public Visibility ConverterBarContentVisible
+        {
+            get { return converterBarContentVisible; }
+            set
+            {
+                SetProperty(ref converterBarContentVisible, value);
+            }
+        }
+
+        private Visibility toolsBarContentVisible = Visibility.Collapsed;
         /// <summary>
         /// 控制ToolsBarContent的显示
         /// 留意:显示前需要先注入内容、设置好行和跨行数
         /// </summary>
         public Visibility ToolsBarContentVisible
         {
-            get { return toolsbarContentVisible; }
+            get { return toolsBarContentVisible; }
             set
             {
-                SetProperty(ref toolsbarContentVisible, value);
+                SetProperty(ref toolsBarContentVisible, value);
             }
         }
 
@@ -288,19 +354,17 @@ namespace PDF_Office.ViewModels
         public DelegateCommand UndoCommand { get; set; }
 
         public DelegateCommand RedoCommand { get; set; }
-
         public DelegateCommand<object> MenuEnterReadMode { get; set; }
+        #endregion
+        public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
 
-        #endregion 命令
-
-        public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
             region = regionManager;
             dialogs = dialogService;
 
             LoadFile = new DelegateCommand(loadFile);
             Load = new DelegateCommand(LoadControl);
-            SaveFile = new DelegateCommand(() => { saveFile(); });
+            SaveFile = new DelegateCommand(()=> { saveFile(); });
             SaveAsFile = new DelegateCommand(() => { saveAsFile(); });
             UndoCommand = new DelegateCommand(Undo);
             RedoCommand = new DelegateCommand(Redo);
@@ -315,8 +379,9 @@ namespace PDF_Office.ViewModels
 
             //未显示时无法注册上Region名称
             ToolContentVisible = Visibility.Visible;
-            ToolContentRegionName = RegionNames.ToolContentRegionName;
-            ToolsBarContentRegionName = RegionNames.ToolsBarContentRegionName;
+            ToolContentRegionName = Guid.NewGuid().ToString();
+            ToolsBarContentRegionName = Guid.NewGuid().ToString();
+            ConverterBarContentRegionName = Guid.NewGuid().ToString();
 
             ToolContentVisible = Visibility.Collapsed;
             ToolsBarContentVisible = Visibility.Collapsed;
@@ -324,6 +389,10 @@ namespace PDF_Office.ViewModels
             barContentByTabItem = new Dictionary<string, string>();
             InitialregionNameByTabItem(ref regionNameByTabItem);
             InitialbarContentByTabItem(ref barContentByTabItem);
+
+
+            eventAggregator.GetEvent<EnterSelectedEditToolEvent>().Subscribe(EnterEditTools);
+            eventAggregator.GetEvent<CloseEditToolEvent>().Subscribe(CloseEditTool);
         }
 
         private void MenuEnterReadModeEvent(object obj)
@@ -336,7 +405,7 @@ namespace PDF_Office.ViewModels
             dictionary.Add("TabItemTool", ToolsBarContentRegionName);
             //其他工具菜单栏共用一个ToolsBarContentRegionName
             dictionary.Add("TabItemAnnotation", ToolsBarContentRegionName);
-            dictionary.Add("TabItemConvert", ToolsBarContentRegionName);
+            dictionary.Add("TabItemConvert", ConverterBarContentRegionName);
             dictionary.Add("TabItemScan", ToolsBarContentRegionName);
             dictionary.Add("TabItemEdit", ToolsBarContentRegionName);
             dictionary.Add("TabItemForm", ToolsBarContentRegionName);
@@ -348,13 +417,41 @@ namespace PDF_Office.ViewModels
             dictionary.Add("TabItemPageEdit", "PageEditContent");
             dictionary.Add("TabItemTool", "ToolsBarContent");
             dictionary.Add("TabItemAnnotation", "AnnotToolContent");
-            dictionary.Add("TabItemConvert", "");
+            dictionary.Add("TabItemConvert", "ConverterBarContent");
             dictionary.Add("TabItemScan", "");
             dictionary.Add("TabItemEdit", "");
             dictionary.Add("TabItemForm", "");
             dictionary.Add("TabItemFill", "FillAndSignContent");
         }
 
+        private void UpdateShowContent(string currentBar)
+        {
+            ToolContentVisible = Visibility.Collapsed;
+            ToolsBarContentVisible = Visibility.Collapsed;
+            ConverterBarContentVisible = Visibility.Collapsed;
+            switch (currentBar)
+            {
+                case "TabItemTool":
+                    ToolsBarContentVisible = Visibility.Visible;
+                    break;
+                case "TabItemConvert":
+                    ConverterBarContentVisible = Visibility.Visible;
+                    break;
+                case "TabItemPageEdit":
+                    ToolContentVisible = Visibility.Visible;
+                    break;
+                case "WatermarkContent":
+                    ToolContentVisible = Visibility.Visible;
+                    break;
+                case "BackgroundContent":
+                    ToolContentVisible = Visibility.Visible;
+                    break;
+
+                default:
+                    break;
+            }
+        }
+
         private void UndoManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
         {
             if (e.PropertyName == "CanSave")
@@ -732,6 +829,7 @@ namespace PDF_Office.ViewModels
         /// <param name="isPageEdit"></param>
         private void ShowContent(string currentBar, bool isToolMode = false)
         {
+            GridVisibility = Visibility.Visible;
             //显示页面编辑或其他工具
             if (currentBar == "TabItemPageEdit" || isToolMode)
             {
@@ -749,6 +847,7 @@ namespace PDF_Office.ViewModels
                 }
                 else//进入水印等其他工具模式
                 {
+                    GridVisibility = Visibility.Collapsed;
                     if (GridToolRow != 0)
                     {
                         GridToolRow = 0;
@@ -760,8 +859,8 @@ namespace PDF_Office.ViewModels
                     }
                 }
                 //ToolContent的visible跟toolsbarContent 的visible是互斥的
-                ToolContentVisible = Visibility.Visible;
-                ToolsBarContentVisible = Visibility.Collapsed;
+                UpdateShowContent(currentBar);
+
             }
             else
             {
@@ -769,11 +868,36 @@ namespace PDF_Office.ViewModels
                 {
                     GridToolRow = 1;
                 }
-                ToolContentVisible = Visibility.Collapsed;
-                ToolsBarContentVisible = Visibility.Visible;
+                UpdateShowContent(currentBar);
             }
         }
 
+        /// <summary>
+        /// 从二级工具栏进入需要修改界面布局的场景
+        /// </summary>
+        /// <param name="EditToolName"></param>
+        private void EnterEditTools(string EditToolName)
+        {
+            EnterSelectedEditTool(EditToolName);
+        }
+
+        private void CloseEditTool()
+        {
+            currentBar = "TabItemTool";
+            EnterSelectedBar(currentBar);
+        }
+        /// <summary>
+        /// 二级菜单指定目标处理
+        /// </summary>
+        /// <param name="e"></param>
+        private void EnterSelectedEditTool(string EditToolName)
+        {
+            currentBar = EditToolName;
+            EnterToolMode(EditToolName);
+        }
+
+ 
+
         /// <summary>
         /// 进入工具编辑(如页面编辑、水印、密文等)模式
         /// </summary>

+ 1 - 14
PDF Office/Views/BOTA/BOTAContent.xaml

@@ -2,14 +2,11 @@
     x:Class="PDF_Office.Views.BOTA.BOTAContent"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:bota="clr-namespace:PDF_Office.ViewModels.BOTA"
     xmlns:convert="clr-namespace:PDF_Office.DataConvert"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
     xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
-    d:DataContext="{d:DesignInstance Type=bota:BOTAContentViewModel}"
     d:DesignHeight="450"
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
@@ -70,12 +67,8 @@
             Background="Transparent"
             Style="{StaticResource TabControlWithUnderLineStyle}"
             TabStripPlacement="Left">
-
             <!--  建立一个空的标头占位  -->
-            <TabItem
-                Height="0"
-                Margin="0"
-                BorderThickness="0" />
+            <TabItem Height="0" />
             <TabItem
                 Name="TabItemThumbnail"
                 Width="48"
@@ -118,12 +111,6 @@
                 Height="48"
                 Header="签名"
                 Visibility="{Binding ElementName=MenuSign, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
-            <i:Interaction.Triggers>
-                <i:EventTrigger EventName="SelectionChanged">
-                    <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
-                </i:EventTrigger>
-            </i:Interaction.Triggers>
         </TabControl>
-        <ContentControl Grid.Column="1" prism:RegionManager.RegionName="{Binding BOTAContentRegionName}" />
     </Grid>
 </UserControl>

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

@@ -0,0 +1,97 @@
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterCSVDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:converterdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.ConverterDialogs"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="529"
+    Height="416"
+    d:DataContext="{d:DesignInstance Type=converterdialogs:ConverterCSVDialogViewModel}"
+    d:DesignHeight="416"
+    d:DesignWidth="529"
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <cus:DialogContent Header="PDF转CSV">
+        <cus:DialogContent.Content>
+            <Grid Grid.Row="1">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="212" />
+                    <ColumnDefinition Width="*" />
+                </Grid.ColumnDefinitions>
+                <Grid Grid.Column="0">
+                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" />
+                </Grid>
+                <Grid Grid.Column="1">
+                    <StackPanel Margin="18,16,0,0">
+                        <StackPanel>
+                            <RadioButton
+                                Name="ForEachPageRadioBtn"
+                                Command="{Binding RadioButtonCommand}"
+                                CommandParameter="{Binding ElementName=ForEachPageRadioBtn, Path=Name}">
+                                <TextBlock Text="将每个页面转换为一个单独的文档" />
+                            </RadioButton>
+                            <RadioButton
+                                Name="OnlyTableRadioBtn"
+                                Margin="0,6,0,0"
+                                Command="{Binding RadioButtonCommand}"
+                                CommandParameter="{Binding ElementName=ForTheDocRadioBtn, Path=Name}">
+                                <TextBlock Text="只提取表格" />
+                            </RadioButton>
+                        </StackPanel>
+                        <StackPanel Margin="0,14,0,0" Orientation="Vertical">
+                            <TextBlock
+                                Width="48"
+                                Height="20"
+                                HorizontalAlignment="Left"
+                                Text="页面范围" />
+                            <cus:WritableComboBox
+                                x:Name="PageRangeComboBox"
+                                Width="228"
+                                Height="28.55"
+                                Margin="0,4,0,0"
+                                HorizontalAlignment="Left"
+                                IsCurrentPage="True"
+                                Loaded="PageRangeComboBox_Loaded"
+                                SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}"
+                                Text="{Binding PageRangeText, Mode=TwoWay}">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </cus:WritableComboBox>
+                        </StackPanel>
+                    </StackPanel>
+                </Grid>
+            </Grid>
+        </cus:DialogContent.Content>
+        <cus:DialogContent.BottmBar>
+            <Grid>
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="0,0,124,0"
+                    HorizontalAlignment="Right"
+                    Command="{Binding CancelCommand}"
+                    Content="取消" />
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="16,0"
+                    HorizontalAlignment="Right"
+                    Command="{Binding ConverterCommnad}"
+                    Content="转换" />
+            </Grid>
+        </cus:DialogContent.BottmBar>
+    </cus:DialogContent>
+</UserControl>

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

@@ -0,0 +1,47 @@
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.ConverterDialogs;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs;
+using System.Diagnostics;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.ConverterDialogs
+{
+    /// <summary>
+    /// Interaction logic for ConverterCSVDialog
+    /// </summary>
+    public partial class ConverterCSVDialog : UserControl
+    {
+        public ConverterCSVDialog()
+        {
+            InitializeComponent();
+        }
+        private void ConverterPreview_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ConverterPreview.document = ((ConverterCSVDialogViewModel)this.DataContext).currentViewer.Document;
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, "1-" + ConverterPreview.document.PageCount.ToString(), ConverterPreview.document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
+            ConverterPreview.PageIndex.Text = ConverterPreview.document.PageCount.ToString();
+        }
+        private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
+        {
+            PageRangeComboBox.CurrentPage = true;
+            if (PageRangeComboBox.CurrentPage)
+            {
+                ComboBoxItem comboBoxItem = new ComboBoxItem();
+                comboBoxItem.Content = "当前页面";
+                PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
+                
+            }
+        }
+    }
+}

+ 96 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml

@@ -0,0 +1,96 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterExcelDialog"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+             xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
+             xmlns:prism="http://prismlibrary.com/"           
+             Width="529"
+             Height="416"
+             d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
+             d:DesignHeight="416"
+             d:DesignWidth="529"
+             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             mc:Ignorable="d">
+    <cus:DialogContent Header="PDF转Excel">
+        <cus:DialogContent.Content>
+            <Grid Grid.Row="1">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="212"/>
+                    <ColumnDefinition Width="*"/>
+                </Grid.ColumnDefinitions>
+                <Grid Grid.Column="0">
+                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
+                </Grid>
+                <Grid Grid.Column="1">
+                    <StackPanel Orientation="Vertical" Margin="18,16,0,0">
+                        <StackPanel Orientation="Vertical">
+                            <TextBlock Text="Excel工作簿设置:" Height="20"/>
+                            <StackPanel Orientation="Vertical" Margin="0,7,0,0">
+                                <RadioButton Name="ForEachPageRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForEachPageRadioBtn,Path=Name}" IsChecked="True">
+                                    <TextBlock Text="将每个页面转换为一个单独的工作表"/>
+                                </RadioButton>
+                                <RadioButton Margin="0,6,0,0" Name="ForTheDocRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForTheDocRadioBtn,Path=Name}">
+                                    <TextBlock Text="将所有页面转换为一个工作表格式"/>
+                                </RadioButton>
+                                <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">
+                                    <ComboBoxItem Content="支持一个表格提取到单独的工作表"/>
+                                    <ComboBoxItem Content="支持按页面提取表格到单独的工作表"/>
+                                    <ComboBoxItem Content="支持将所有表格提取到一个工作表"/>
+                                </ComboBox>
+                            </StackPanel>
+                        </StackPanel>
+                        <StackPanel Orientation="Vertical"  Margin="0,16,0,0">
+                            <StackPanel Orientation="Vertical">
+                                <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
+                                <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0">
+                                    <TextBlock Text="在需要时识别文本"/>
+                                </CheckBox>
+                                <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left">
+                                </ComboBox>
+                            </StackPanel>
+                            <StackPanel Orientation="Vertical" Margin="0,14,0,0">
+                                <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
+                                <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                    <i:Interaction.Triggers>
+                                        <i:EventTrigger EventName="SelectionChanged">
+                                            <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                        </i:EventTrigger>
+                                        <i:EventTrigger EventName="TextChanged">
+                                            <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                        </i:EventTrigger>
+                                    </i:Interaction.Triggers>
+                                </cus:WritableComboBox>
+                            </StackPanel>
+                        </StackPanel>
+                    </StackPanel>
+                </Grid>
+            </Grid>
+        </cus:DialogContent.Content>
+        <cus:DialogContent.BottmBar>
+            <Grid>
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="0,0,124,0"
+                    HorizontalAlignment="Right"
+                    Content="取消" 
+                    Command="{Binding CancelCommand}"/>
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="16,0"
+                    HorizontalAlignment="Right"
+                    Content="转换" 
+                    Command = "{Binding ConverterCommnad}"/>
+            </Grid>
+        </cus:DialogContent.BottmBar>
+    </cus:DialogContent>
+</UserControl>

+ 64 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml.cs

@@ -0,0 +1,64 @@
+using ComPDFKit_Conversion.Options;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.ConverterDialogs;
+using System.Diagnostics;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.ConverterDialogs
+{
+    /// <summary>
+    /// Interaction logic for ConverterExcelDialog
+    /// </summary>
+    public partial class ConverterExcelDialog : UserControl
+    {
+        public ConverterExcelDialog()
+        {
+            InitializeComponent();
+        }
+        private void ConverterPreview_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ConverterPreview.document = ((ConverterExcelDialogViewModel)this.DataContext).currentViewer.Document;
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, "1-" + ConverterPreview.document.PageCount.ToString(), ConverterPreview.document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
+            ConverterPreview.PageIndex.Text = ConverterPreview.document.PageCount.ToString();
+        }
+        private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
+        {
+            PageRangeComboBox.CurrentPage = true;
+            if (PageRangeComboBox.CurrentPage)
+            {
+                ComboBoxItem comboBoxItem = new ComboBoxItem();
+                comboBoxItem.Content = "当前页面";
+                PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
+
+            }
+        }
+
+        private void OnlyTableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            switch (OnlyTableComboBox.SelectedIndex) { 
+                case 0:
+                    ((ConverterExcelDialogViewModel)this.DataContext).ConverterExcelModel.excelOption = ((ConverterExcelDialogViewModel)this.DataContext).ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachTable, ContentOptions.OnlyTable);
+                    break;
+                case 1:
+                    ((ConverterExcelDialogViewModel)this.DataContext).ConverterExcelModel.excelOption = ((ConverterExcelDialogViewModel)this.DataContext).ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachPage, ContentOptions.OnlyTable);
+                    break;
+                case 2:
+                    ((ConverterExcelDialogViewModel)this.DataContext).ConverterExcelModel.excelOption = ((ConverterExcelDialogViewModel)this.DataContext).ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument, ContentOptions.OnlyTable);
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+}

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

@@ -0,0 +1,75 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterHTMLDialog"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+             xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
+             xmlns:prism="http://prismlibrary.com/"           
+             Width="480"
+             Height="416"
+             d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
+             d:DesignHeight="416"
+             d:DesignWidth="480"
+             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             mc:Ignorable="d">
+    <cus:DialogContent Header="PDF转HTML">
+        <cus:DialogContent.Content>
+            <Grid Grid.Row="1">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="212"/>
+                    <ColumnDefinition Width="*"/>
+                </Grid.ColumnDefinitions>
+                <Grid Grid.Column="0">
+                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
+                </Grid>
+                <Grid Grid.Column="1">
+                    <StackPanel Orientation="Vertical"  Margin="18,16,0,0">
+                        <StackPanel Orientation="Vertical">
+                            <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
+                            <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0">
+                                <TextBlock Text="在需要时识别文本"/>
+                            </CheckBox>
+                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left">
+                            </ComboBox>
+                        </StackPanel>
+                        <StackPanel Orientation="Vertical" Margin="0,14,0,0">
+                            <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
+                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </cus:WritableComboBox>
+                        </StackPanel>
+                    </StackPanel>
+                </Grid>
+            </Grid>
+        </cus:DialogContent.Content>
+        <cus:DialogContent.BottmBar>
+            <Grid>
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="0,0,124,0"
+                    HorizontalAlignment="Right"
+                    Content="取消" 
+                    Command="{Binding CancelCommand}"/>
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="16,0"
+                    HorizontalAlignment="Right"
+                    Content="转换" 
+                    Command = "{Binding ConverterCommnad}"/>
+            </Grid>
+        </cus:DialogContent.BottmBar>
+    </cus:DialogContent>
+</UserControl>

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

@@ -0,0 +1,47 @@
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.ConverterDialogs;
+using System.Diagnostics;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.ConverterDialogs
+{
+    /// <summary>
+    /// Interaction logic for ConverterHTMLDialog
+    /// </summary>
+    public partial class ConverterHTMLDialog : UserControl
+    {
+        public ConverterHTMLDialog()
+        {
+            InitializeComponent();
+        }
+        private void ConverterPreview_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ConverterPreview.document = ((ConverterHTMLDialogViewModel)this.DataContext).currentViewer.Document;
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, "1-" + ConverterPreview.document.PageCount.ToString(), ConverterPreview.document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
+            ConverterPreview.PageIndex.Text = ConverterPreview.document.PageCount.ToString();
+        }
+
+        private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
+        {
+            PageRangeComboBox.CurrentPage = true;
+            if (PageRangeComboBox.CurrentPage)
+            {
+                ComboBoxItem comboBoxItem = new ComboBoxItem();
+                comboBoxItem.Content = "当前页面";
+                PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
+
+            }
+        }
+    }
+}

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

@@ -0,0 +1,107 @@
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterImgDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:converterdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.ConverterDialogs"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="480"
+    Height="416"
+    d:DataContext="{d:DesignInstance Type=converterdialogs:ConverterImgDialogViewModel}"
+    d:DesignHeight="416"
+    d:DesignWidth="480"
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <cus:DialogContent Header="PDF转图片">
+        <cus:DialogContent.Content>
+            <Grid Grid.Row="1">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="212" />
+                    <ColumnDefinition Width="*" />
+                </Grid.ColumnDefinitions>
+                <Grid Grid.Column="0">
+                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" />
+                </Grid>
+                <Grid Grid.Column="1">
+                    <StackPanel Margin="18,16,0,0">
+                        <StackPanel>
+                            <TextBlock
+                                Width="48"
+                                Height="20"
+                                HorizontalAlignment="Left"
+                                Text="文件类型" />
+                            <ComboBox
+                                Name="ImageTypeComboBox"
+                                Width="228"
+                                Height="32"
+                                Margin="0,8,0,0"
+                                HorizontalAlignment="Left"
+                                ItemsSource="{Binding ImageTypeFamily}"
+                                SelectedIndex="{Binding ImageTypeSelectedIndex, Mode=TwoWay}"
+                                />
+                            <ComboBox
+                                Name="ImageDPIComboBox"
+                                Width="228"
+                                Height="32"
+                                Margin="0,8,0,0"
+                                HorizontalAlignment="Left"
+                                ItemsSource="{Binding ImageDPIFamily}"
+                                SelectedIndex="{Binding ImageDPISelectedIndex, Mode=TwoWay}"
+                                />
+                        </StackPanel>
+                        <StackPanel Margin="0,16,0,0">
+                            <TextBlock
+                                Width="48"
+                                Height="20"
+                                HorizontalAlignment="Left"
+                                Text="页面范围" />
+                            <cus:WritableComboBox
+                                x:Name="PageRangeComboBox"
+                                Width="228"
+                                Height="32"
+                                Margin="0,4,0,0"
+                                HorizontalAlignment="Left"
+                                IsCurrentPage="True"
+                                Loaded="PageRangeComboBox_Loaded"
+                                SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}"
+                                Text="{Binding PageRangeText, Mode=TwoWay}" >
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </cus:WritableComboBox>
+                        </StackPanel>
+                    </StackPanel>
+                </Grid>
+            </Grid>
+        </cus:DialogContent.Content>
+        <cus:DialogContent.BottmBar>
+            <Grid>
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="0,0,124,0"
+                    HorizontalAlignment="Right"
+                    Command="{Binding CancelCommand}"
+                    Content="取消" />
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="16,0"
+                    HorizontalAlignment="Right"
+                    Command="{Binding ConverterCommnad}"
+                    Content="转换" />
+            </Grid>
+        </cus:DialogContent.BottmBar>
+    </cus:DialogContent>
+</UserControl>

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

@@ -0,0 +1,49 @@
+using ComPDFKit_Conversion.Converter;
+using ComPDFKit_Conversion.Options;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.ConverterDialogs;
+using System.Diagnostics;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.ConverterDialogs
+{
+    /// <summary>
+    /// Interaction logic for ConverterImgDialog
+    /// </summary>
+    public partial class ConverterImgDialog : UserControl
+    {
+        public ConverterImgDialog()
+        {
+            InitializeComponent();
+        }
+        private void ConverterPreview_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ConverterPreview.document = ((ConverterImgDialogViewModel)this.DataContext).currentViewer.Document;
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, "1-" + ConverterPreview.document.PageCount.ToString(), ConverterPreview.document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
+            ConverterPreview.PageIndex.Text = ConverterPreview.document.PageCount.ToString();
+        }
+        private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
+        {
+            PageRangeComboBox.CurrentPage = true;
+            if (PageRangeComboBox.CurrentPage)
+            {
+                ComboBoxItem comboBoxItem = new ComboBoxItem();
+                comboBoxItem.Content = "当前页面";
+                PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
+
+            }
+        }
+
+    }
+}

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

@@ -0,0 +1,75 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterPPTDialog"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+             xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
+             xmlns:prism="http://prismlibrary.com/"           
+             Width="480"
+             Height="416"
+             d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
+             d:DesignHeight="416"
+             d:DesignWidth="480"
+             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             mc:Ignorable="d">
+    <cus:DialogContent Header="PDF转PPT">
+        <cus:DialogContent.Content>
+            <Grid Grid.Row="1">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="212"/>
+                    <ColumnDefinition Width="*"/>
+                </Grid.ColumnDefinitions>
+                <Grid Grid.Column="0">
+                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
+                </Grid>
+                <Grid Grid.Column="1">
+                    <StackPanel Orientation="Vertical"  Margin="18,16,0,0">
+                        <StackPanel Orientation="Vertical">
+                            <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
+                            <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0">
+                                <TextBlock Text="在需要时识别文本"/>
+                            </CheckBox>
+                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left">
+                            </ComboBox>
+                        </StackPanel>
+                        <StackPanel Orientation="Vertical" Margin="0,14,0,0">
+                            <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
+                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </cus:WritableComboBox>
+                        </StackPanel>
+                    </StackPanel>
+                </Grid>
+            </Grid>
+        </cus:DialogContent.Content>
+        <cus:DialogContent.BottmBar>
+            <Grid>
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="0,0,124,0"
+                    HorizontalAlignment="Right"
+                    Content="取消" 
+                    Command="{Binding CancelCommand}"/>
+                <Button
+                    Width="98"
+                    Height="32"
+                    Margin="16,0"
+                    HorizontalAlignment="Right"
+                    Content="转换" 
+                    Command = "{Binding ConverterCommnad}"/>
+            </Grid>
+        </cus:DialogContent.BottmBar>
+    </cus:DialogContent>
+</UserControl>

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

@@ -0,0 +1,47 @@
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.ConverterDialogs;
+using System.Diagnostics;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.ConverterDialogs
+{
+    /// <summary>
+    /// Interaction logic for ConverterPPT
+    /// </summary>
+    public partial class ConverterPPTDialog : UserControl
+    {
+        public ConverterPPTDialog()
+        {
+            InitializeComponent();
+        }
+        private void ConverterPreview_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ConverterPreview.document = ((ConverterPPTDialogViewModel)this.DataContext).currentViewer.Document;
+            char[] enumerationSeparator = new char[] { ',' };
+            char[] rangeSeparator = new char[] { '-' };
+            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, "1-" + ConverterPreview.document.PageCount.ToString(), ConverterPreview.document.PageCount, enumerationSeparator, rangeSeparator))
+            { //TODO
+                Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
+                return;
+            }
+            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
+            ConverterPreview.PageIndex.Text = ConverterPreview.document.PageCount.ToString();
+        }
+
+        private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
+        {
+            PageRangeComboBox.CurrentPage = true;
+            if (PageRangeComboBox.CurrentPage)
+            {
+                ComboBoxItem comboBoxItem = new ComboBoxItem();
+                comboBoxItem.Content = "当前页面";
+                PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
+
+            }
+        }
+    }
+}

+ 19 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterProgressBarDialog.xaml

@@ -0,0 +1,19 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterProgressBarDialog"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             d:DesignHeight="40"
+             d:DesignWidth="220"
+             mc:Ignorable="d">
+    <Grid Height="40" Width="220">
+        <StackPanel>
+            <StackPanel Orientation="Horizontal" Margin="13,5,0,10">
+                <TextBlock Text="Converte  .  .  . "></TextBlock>
+            </StackPanel>
+            <ProgressBar Minimum="0" Maximum="{Binding PageNumber}" Value="{Binding PageIndex}"  Height="4" Width="194"/>
+        </StackPanel>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterProgressBarDialog.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.ConverterDialogs
+{
+    /// <summary>
+    /// Interaction logic for ConverterProgressBarDialog
+    /// </summary>
+    public partial class ConverterProgressBarDialog : UserControl
+    {
+        public ConverterProgressBarDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

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


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů