Bladeren bron

批量处理

liyijie 2 jaren geleden
bovenliggende
commit
12fe65bae2
35 gewijzigde bestanden met toevoegingen van 555 en 286 verwijderingen
  1. 3 2
      PDF Office/CustomControl/WritableComboBox.xaml
  2. 12 0
      PDF Office/CustomControl/WritableComboBox.xaml.cs
  3. 1 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateColorContentViewModel.cs
  4. 6 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateFileContentViewModel.cs
  5. 19 4
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialogViewModel.cs
  6. 1 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundTemplateListBaseContentViewModel.cs
  7. 9 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundTemplateListColorContentViewModel.cs
  8. 10 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundTemplateListFileContentViewModel.cs
  9. 3 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesCreateContentViewModel.cs
  10. 19 8
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialogViewModel.cs
  11. 6 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesTemplateListContentViewModel.cs
  12. 58 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs
  13. 4 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterCreateContentViewModel.cs
  14. 19 4
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialogViewModel.cs
  15. 9 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterTemplateListContentViewModel.cs
  16. 5 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateFileContentViewModel.cs
  17. 3 3
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateTextContentViewModel.cs
  18. 20 4
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialogViewModel.cs
  19. 8 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkTemplateListFileContentViewModel.cs
  20. 10 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkTemplateListTextContentViewModel.cs
  21. 1 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs
  22. 1 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListFileContentViewModel.cs
  23. 1 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListTextContentViewModel.cs
  24. 136 136
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateColorContent.xaml
  25. 106 106
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateFileContent.xaml
  26. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml
  27. 15 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml.cs
  28. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml
  29. 22 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml.cs
  30. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml
  31. 14 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml.cs
  32. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml
  33. 14 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml.cs
  34. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml
  35. 15 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml.cs

+ 3 - 2
PDF Office/CustomControl/WritableComboBox.xaml

@@ -22,7 +22,7 @@
             Visibility="Visible">
             <ComboBoxItem Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=IsAllPageVisible}">全部页面</ComboBoxItem>
             <ComboBoxItem>奇数页</ComboBoxItem>
-            <ComboBoxItem>偶数页</ComboBoxItem>
+            <ComboBoxItem IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=EvenPageIsEnabled}">偶数页</ComboBoxItem>
             <ComboBoxItem>自定义页面</ComboBoxItem>
         </ComboBox>
         <TextBox
@@ -33,6 +33,7 @@
             HorizontalAlignment="Left"
             VerticalContentAlignment="Center"
             TextChanged="writableTextBox_TextChange"
-            Visibility="Hidden" />
+            Visibility="Hidden" 
+            />
     </Grid>
 </UserControl>

+ 12 - 0
PDF Office/CustomControl/WritableComboBox.xaml.cs

@@ -71,6 +71,16 @@ namespace PDF_Office.CustomControl
         public static readonly DependencyProperty CurrentPageProperty =
             DependencyProperty.Register("CurrentPage", typeof(bool), typeof(WritableComboBox), new PropertyMetadata(false));
 
+        public bool EvenPageIsEnabled
+        {
+            get { return (bool)GetValue(EvenPageIsEnabledProperty); }
+            set { SetValue(EvenPageIsEnabledProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty EvenPageIsEnabledProperty =
+            DependencyProperty.Register("EvenPageIsEnabled", typeof(bool), typeof(WritableComboBox), new PropertyMetadata(true));
+
         public string SelectedIndex
         {
             get { return (string)GetValue(SelectedIndexProperty); }
@@ -124,8 +134,10 @@ namespace PDF_Office.CustomControl
 
         private void writableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
+            if (this.writableComboBox.ActualWidth == 0) { return; }
             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;

+ 1 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateColorContentViewModel.cs

@@ -167,7 +167,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             set
             {
                 _pageRangeText = value;
-                //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
+                BackgroundInfo.PageRange=EditToolsHelper.ParseRange(PageRangeText);
                 
             }
         }

+ 6 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateFileContentViewModel.cs

@@ -231,8 +231,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             set
             {
                 _pageRangeText = value;
-               // EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
-                
+                BackgroundInfo.PageRange = EditToolsHelper.ParseRange(PageRangeText);
+                // EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
+
             }
         }
 
@@ -243,6 +244,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             set
             {
                 SetProperty(ref _pageRangeSelectIndex, value);
+                BackgroundInfo.PageRangeIndex = PageRangeSelectIndex;
                 //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
             }
         }
@@ -396,6 +398,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             backgroundItem.rotation = backgroundInfo.Rotation;
             backgroundItem.isRelativeScale = backgroundInfo.IsRelativeScale;
             backgroundItem.scale = backgroundInfo.Scale;
+            backgroundItem.PageRangeIndex = backgroundInfo.PageRangeIndex;
+            backgroundItem.pageRange = backgroundInfo.PageRange;
             //backgroundItem.pagRangeMode = backgroundInfo.PageRange;
         }
 

+ 19 - 4
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialogViewModel.cs

@@ -234,10 +234,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             this.backgroundRegion = backgroundRegion;
             PDFCurrentDataTable.Columns.Add("FilePageRangeText");
             PDFCurrentDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFCurrentDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFCurrentDataTable.Columns.Add("FileState");
             PDFDataTable.Columns.Add("FileName");
             PDFDataTable.Columns.Add("FilePageRangeText");
             PDFDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
@@ -486,15 +488,26 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             pdfdatatable.Columns.Add("FileName");
             pdfdatatable.Columns.Add("FilePageRangeText");
             pdfdatatable.Columns.Add("FilePageRangeSelectIndex");
+            pdfdatatable.Columns.Add("IsEvenPageIsEnabled");
             pdfdatatable.Columns.Add("FileSize");
             pdfdatatable.Columns.Add("FileState");
             int datatableindex = 0;
+            List<int> PageIndexLists = new List<int>();
             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, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]); 
+                if (!isEvenPage(fileName) && PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "2")
+                {
+
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                if (PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "3" && !CommonHelper.GetPagesInRange(ref PageIndexLists, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"].ToString(), CPDFDocument.InitWithFilePath(fileName).PageCount, new char[] { ',' }, new char[] { '-' }, true))
+                {
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                pdfdatatable.Rows.Add(f.Name, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], isEvenPage(fileName), file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]); 
                 datatableindex++;
             }
             PDFDataTable = pdfdatatable;
@@ -552,16 +565,18 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         }
 
         /// <summary>
-        /// 获取文件列表单个文件对应的页码范围
-        /// document 文档对象 pagerangetext 自定义页面范围字符串  pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面
+        /// 判断是否关闭偶数页
+        /// document 文档对象 )
         /// </summary>
-        public bool isEvenPage(CPDFDocument document)
+        public bool isEvenPage(string filename)
         {
+            CPDFDocument document= CPDFDocument.InitWithFilePath(filename);
             bool isevenpage = false;
             if (document.PageCount > 1)
             {
                 isevenpage = true;
             }
+            document.Release();
             return isevenpage;
         }
 

+ 1 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundTemplateListBaseContentViewModel.cs

@@ -76,7 +76,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         {
             NavigationParameters param = new NavigationParameters();
             param.Add("ViewModel", homePageBackgroundDialogViewModel);
-            backgroundTemplateListRegion.RequestNavigate(BackgroundTemplateListRegionName, currentTemplateListName);
+            backgroundTemplateListRegion.RequestNavigate(BackgroundTemplateListRegionName, currentTemplateListName,param);
             backgroundTemplateListVisible = System.Windows.Visibility.Visible;
         }
 

+ 9 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundTemplateListColorContentViewModel.cs

@@ -198,6 +198,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             backgroundInfo.Opacity = backgroundItem.opacity;
             backgroundInfo.Rotation = backgroundItem.rotation;
             backgroundInfo.Scale = backgroundItem.scale;
+            backgroundInfo.PageRangeIndex = backgroundItem.PageRangeIndex;
+            backgroundInfo.PageRange = backgroundItem.pageRange;
             //  backgroundItem.pagRangeMode = backgroundInfo.PageRange;
 
         }
@@ -207,7 +209,13 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             if (template != null)
             {
                 ConvertItemToInfo(template, ref BackgroundInfo);
-               
+                homePageBackgroundDialogViewModel.BackgroundInfo = BackgroundInfo;
+                for (int i = 0; homePageBackgroundDialogViewModel.PDFDataTable.Rows.Count > i; i++)
+                {
+                    homePageBackgroundDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeText"] = BackgroundInfo.PageRange;
+                    homePageBackgroundDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeSelectIndex"] = BackgroundInfo.PageRangeIndex.ToString();
+                    homePageBackgroundDialogViewModel.updateListview("待确定");
+                }
             }
 
         }

+ 10 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundTemplateListFileContentViewModel.cs

@@ -1,7 +1,9 @@
 using Microsoft.Office.Interop.Word;
 using PDF_Office.EventAggregators;
 using PDF_Office.Model.EditTools.Background;
+using PDF_Office.Model.EditTools.Bates;
 using PDF_Office.Properties;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Events;
@@ -209,6 +211,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 backgroundInfo.Opacity = backgroundItem.opacity;
                 backgroundInfo.Rotation = backgroundItem.rotation;
                 backgroundInfo.Scale = backgroundItem.scale;
+                backgroundInfo.PageRangeIndex = backgroundItem.PageRangeIndex;
+                backgroundInfo.PageRange = backgroundItem.pageRange;
                 //  backgroundItem.pagRangeMode = backgroundInfo.PageRange;
             }
         }
@@ -219,6 +223,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             {
                 ConvertItemToInfo(template, ref BackgroundInfo);
                 homePageBackgroundDialogViewModel.BackgroundInfo = BackgroundInfo;
+                for (int i = 0; homePageBackgroundDialogViewModel.PDFDataTable.Rows.Count > i; i++)
+                {
+                    homePageBackgroundDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeText"] = BackgroundInfo.PageRange;
+                    homePageBackgroundDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeSelectIndex"] = BackgroundInfo.PageRangeIndex.ToString();
+                    homePageBackgroundDialogViewModel.updateListview("待确定");
+                }
             }
         }
 

+ 3 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesCreateContentViewModel.cs

@@ -141,8 +141,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             set
             {
                 _pageRangeText = value;
+                BatesInfo.PageRange = EditToolsHelper.ParseRange(PageRangeText);
                 //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
-                
+
             }
         }
 
@@ -586,6 +587,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             batesInfo.StarPagetNumber = batesItem.StarPagetNumber;
             batesInfo.margin = batesItem.margin;
             batesInfo.PageRangeIndex = batesItem.PageRangeIndex;
+            batesInfo.PageRange=batesItem.PageRange;
             //EditToolsHelper.GetPageRange(batesInfo.PageRangeIndex, PDFViewer.Document, ref batesInfo.PageRange, batesItem.PageRange);
 
         }

+ 19 - 8
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialogViewModel.cs

@@ -21,6 +21,7 @@ using PDFSettings;
 using ImTools;
 using PDF_Office.Model.EditTools.Watermark;
 using PDF_Office.Model.EditTools.Bates;
+using PDF_Office.Model.EditTools.Background;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates
 {
@@ -56,7 +57,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
         private int fileNamesIndex = 0;
 
-        private int FileNameNumber = 0;
+        public int FileNameNumber = 0;
 
         private string _batesSettingsRegionName;
         /// <summary>
@@ -186,6 +187,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
             }
         }
+
         #endregion
 
         #region 委托声明
@@ -208,10 +210,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             PDFCurrentDataTable.Columns.Add("FilePageRangeText");
             PDFCurrentDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFCurrentDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFCurrentDataTable.Columns.Add("FileState");
             PDFDataTable.Columns.Add("FileName");
             PDFDataTable.Columns.Add("FilePageRangeText");
             PDFDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             ADDPDFCommand = new DelegateCommand(addpicture);
@@ -412,20 +416,25 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             pdfdatatable.Columns.Add("FileName");
             pdfdatatable.Columns.Add("FilePageRangeText");
             pdfdatatable.Columns.Add("FilePageRangeSelectIndex");
+            pdfdatatable.Columns.Add("IsEvenPageIsEnabled");
             pdfdatatable.Columns.Add("FileSize");
             pdfdatatable.Columns.Add("FileState");
             int datatableindex = 0;
+            List<int> PageIndexLists = new List<int>();
             foreach (var fileName in fileNames)
             {
                 string file_all = fileName;
                 FileInfo f = new FileInfo(file_all);
                 string file_size = (((float)f.Length) / 1024).ToString() + " K";
+                if (!isEvenPage(fileName)&& PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString()=="2") {
 
-                pdfdatatable.Rows.Add(f.Name, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]);
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                if (PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "3" && !CommonHelper.GetPagesInRange(ref PageIndexLists, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"].ToString(), CPDFDocument.InitWithFilePath(fileName).PageCount, new char[] { ',' }, new char[] { '-' },true)) {
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                pdfdatatable.Rows.Add(f.Name, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], isEvenPage(fileName), file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]);
                 datatableindex++;
-
-
-
             }
             PDFDataTable = pdfdatatable;
             HomePageBatchProcessingDialogModel.FilePaths = fileNames;
@@ -484,16 +493,18 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         }
 
         /// <summary>
-        /// 获取文件列表单个文件对应的页码范围
-        /// document 文档对象 pagerangetext 自定义页面范围字符串  pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面
+        /// 判断是否关闭偶数页
+        /// document 文档对象 )
         /// </summary>
-        public bool isEvenPage(CPDFDocument document)
+        public bool isEvenPage(string filename)
         {
+            CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
             bool isevenpage = false;
             if (document.PageCount > 1)
             {
                 isevenpage = true;
             }
+            document.Release();
             return isevenpage;
         }
 

+ 6 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesTemplateListContentViewModel.cs

@@ -171,6 +171,11 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             {
                 ConvertItemToInfo(template, ref BatesInfo);
                 homePageBatesDialogViewModel.BatesInfo = BatesInfo;
+                for(int i =0; homePageBatesDialogViewModel.PDFDataTable.Rows.Count> i;i++) {
+                    homePageBatesDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeText"] = BatesInfo.PageRange;
+                    homePageBatesDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeSelectIndex"] = BatesInfo.PageRangeIndex.ToString();
+                    homePageBatesDialogViewModel.updateListview("待确定");
+                }
             }
         }
 
@@ -197,6 +202,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             batesInfo.StarPagetNumber = batesItem.StarPagetNumber;
             batesInfo.margin = batesItem.margin;
             batesInfo.PageRangeIndex = batesItem.PageRangeIndex;
+            batesInfo.PageRange = batesItem.PageRange;
             //EditToolsHelper.GetPageRange(batesInfo.PageRangeIndex, PDFViewer.Document, ref batesInfo.PageRange, batesItem.PageRange);
 
         }

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

@@ -163,6 +163,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
             }
         }
+
         #endregion
 
         #region 委托声明
@@ -182,10 +183,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
             PDFCurrentDataTable.Columns.Add("FilePageRangeText");
             PDFCurrentDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFCurrentDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFCurrentDataTable.Columns.Add("FileState");
             PDFDataTable.Columns.Add("FileName");
             PDFDataTable.Columns.Add("FilePageRangeText");
             PDFDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             ADDPDFCommand = new DelegateCommand(addpicture);
@@ -392,15 +395,26 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             pdfdatatable.Columns.Add("FileName");
             pdfdatatable.Columns.Add("FilePageRangeText");
             pdfdatatable.Columns.Add("FilePageRangeSelectIndex");
+            pdfdatatable.Columns.Add("IsEvenPageIsEnabled");
             pdfdatatable.Columns.Add("FileSize");
             pdfdatatable.Columns.Add("FileState");
             int datatableindex = 0;
+            List<int> PageIndexLists = new List<int>();
             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, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]);
+                if (!isEvenPage(fileName) && PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "2")
+                {
+
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                if (PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "3" && !CommonHelper.GetPagesInRange(ref PageIndexLists, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"].ToString(), CPDFDocument.InitWithFilePath(fileName).PageCount, new char[] { ',' }, new char[] { '-' }, true))
+                {
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                pdfdatatable.Rows.Add(f.Name, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], isEvenPage(fileName), file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]);
                 datatableindex++;
             }
             PDFDataTable = pdfdatatable;
@@ -431,6 +445,49 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             }
         }
 
+        /// <summary>
+        /// 更新Currentlistview显示
+        /// pagerangetext 自定义页面范围字符串  pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面)
+        /// </summary>
+        public void updateFilesPageRange(string pagerangetext = "1", string pagerangeselectindex = "0")
+        {
+            for (int i = 0; fileNames.Count > i; i++)
+            {
+
+                PDFDataTable.Rows[i]["FilePageRangeText"] = pagerangetext;
+                PDFDataTable.Rows[i]["FilePageRangeSelectIndex"] = pagerangeselectindex;
+                PDFCurrentDataTable.Rows[i]["FilePageRangeText"] = pagerangetext;
+                PDFCurrentDataTable.Rows[i]["FilePageRangeSelectIndex"] = pagerangeselectindex;
+            }
+        }
+        /// <summary>
+        /// 获取文件列表单个文件对应的页码范围
+        /// document 文档对象 pagerangetext 自定义页面范围字符串  pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面)
+        /// </summary>
+        public string getFilePageRange(CPDFDocument document, string pagerangetext = "1", string pagerangeselectindex = "0")
+        {
+            string filePageRange = "1";
+            EditToolsHelper.GetPageRange(int.Parse(pagerangeselectindex), document, ref filePageRange, pagerangetext);
+            return filePageRange;
+        }
+
+        /// <summary>
+        /// 判断是否关闭偶数页
+        /// document 文档对象 )
+        /// </summary>
+        public bool isEvenPage(string filename)
+        {
+            CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
+            bool isevenpage = false;
+            if (document.PageCount > 1)
+            {
+                isevenpage = true;
+            }
+            document.Release();
+            return isevenpage;
+        }
+
+
         /// <summary>
         /// 逆序int类型集合
         /// </summary>

+ 4 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterCreateContentViewModel.cs

@@ -15,6 +15,7 @@ using System.IO;
 using System.Linq;
 using System.Windows.Media;
 using System.Windows;
+using PDF_Office.Model.EditTools.Bates;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter
 {
@@ -220,8 +221,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             set
             {
                 _pageRangeText = value;
+                HeaderFooterInfo.PageRange = EditToolsHelper.ParseRange(PageRangeText);
                 //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref HeaderFooterInfo.PageRange, PageRangeText);
-                
+
             }
         }
 
@@ -602,6 +604,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             headerFooterInfo.PageNumberFormat = headerFooterItem.PageNumberFormat;
             headerFooterInfo.margin = headerFooterItem.margin;
             headerFooterInfo.PageRangeIndex = headerFooterItem.PageRangeIndex;
+            headerFooterInfo.PageRange=headerFooterItem.PageRange;
             //EditToolsHelper.GetPageRange(headerFooterInfo.PageRangeIndex, PDFViewer.Document, ref headerFooterInfo.PageRange, headerFooterItem.PageRange);
         }
 

+ 19 - 4
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialogViewModel.cs

@@ -219,10 +219,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             PDFCurrentDataTable.Columns.Add("FilePageRangeText");
             PDFCurrentDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFCurrentDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFCurrentDataTable.Columns.Add("FileState");
             PDFDataTable.Columns.Add("FileName");
             PDFDataTable.Columns.Add("FilePageRangeText");
             PDFDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             ADDPDFCommand = new DelegateCommand(addpicture);
@@ -421,15 +423,26 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             pdfdatatable.Columns.Add("FileName");
             pdfdatatable.Columns.Add("FilePageRangeText");
             pdfdatatable.Columns.Add("FilePageRangeSelectIndex");
+            pdfdatatable.Columns.Add("IsEvenPageIsEnabled");
             pdfdatatable.Columns.Add("FileSize");
             pdfdatatable.Columns.Add("FileState");
             int datatableindex = 0;
+            List<int> PageIndexLists = new List<int>();
             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, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]); 
+                if (!isEvenPage(fileName) && PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "2")
+                {
+
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                if (PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "3" && !CommonHelper.GetPagesInRange(ref PageIndexLists, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"].ToString(), CPDFDocument.InitWithFilePath(fileName).PageCount, new char[] { ',' }, new char[] { '-' }, true))
+                {
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                pdfdatatable.Rows.Add(f.Name, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], isEvenPage(fileName), file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]); 
                 datatableindex++;
             }
             PDFDataTable = pdfdatatable;
@@ -487,16 +500,18 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         }
 
         /// <summary>
-        /// 获取文件列表单个文件对应的页码范围
-        /// document 文档对象 pagerangetext 自定义页面范围字符串  pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面
+        /// 判断是否关闭偶数页
+        /// document 文档对象 )
         /// </summary>
-        public bool isEvenPage(CPDFDocument document)
+        public bool isEvenPage(string filename)
         {
+            CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
             bool isevenpage = false;
             if (document.PageCount > 1)
             {
                 isevenpage = true;
             }
+            document.Release();
             return isevenpage;
         }
 

+ 9 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterTemplateListContentViewModel.cs

@@ -15,6 +15,8 @@ using System.Collections.ObjectModel;
 using System.Linq;
 using System.Windows.Controls;
 using System.Windows;
+using PDF_Office.Model.EditTools.Bates;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter
 {
@@ -169,6 +171,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             {
                 ConvertItemToInfo(template, ref HeaderFooterInfo);
                 homePageHeaderFooterDialogViewModel.HeaderFooterInfo = HeaderFooterInfo;
+                for (int i = 0; homePageHeaderFooterDialogViewModel.PDFDataTable.Rows.Count > i; i++)
+                {
+                    homePageHeaderFooterDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeText"] = HeaderFooterInfo.PageRange;
+                    homePageHeaderFooterDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeSelectIndex"] = HeaderFooterInfo.PageRangeIndex.ToString();
+                    homePageHeaderFooterDialogViewModel.updateListview("待确定");
+                }
             }
 
         }
@@ -195,6 +203,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             headerFooterInfo.PageNumberFormat = headerFooterItem.PageNumberFormat;
             headerFooterInfo.margin = headerFooterItem.margin;
             headerFooterInfo.PageRangeIndex = headerFooterItem.PageRangeIndex;
+            headerFooterInfo.PageRange = headerFooterItem.PageRange;
             //EditToolsHelper.GetPageRange(headerFooterInfo.PageRangeIndex, PDFViewer.Document, ref headerFooterInfo.PageRange, headerFooterItem.PageRange);
         }
         private void CheckTemplateListIsEmpty(List<BatesHeaderFooterItem> headerFooterTemplateList)

+ 5 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateFileContentViewModel.cs

@@ -20,6 +20,7 @@ using System.IO;
 using System.Linq;
 using System.Windows;
 using System.Threading.Tasks;
+using PDF_Office.Model.EditTools.Background;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark
 {
@@ -231,8 +232,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             set
             {
                 _pageRangeText = value;
+                WatermarkInfo.PageRange = EditToolsHelper.ParseRange(PageRangeText);
                 //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, PageRangeText);
-                
+
             }
         }
 
@@ -403,6 +405,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 watermarkInfo.HorizOffset = watermarkItem.horizOffset;
                 watermarkInfo.VerticalSpacing = watermarkItem.verticalSpacing;
                 watermarkInfo.HorizontalSpacing = watermarkItem.horizontalSpacing;
+                watermarkInfo.PageRange=watermarkItem.pageRange;
+                watermarkInfo.PageRangeIndex = watermarkItem.pageRangeIndex;
                 //EditToolsHelper.GetPageRange(watermarkItem.pageRangeIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, watermarkItem.pageRange);
             }
         }

+ 3 - 3
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateTextContentViewModel.cs

@@ -371,8 +371,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             set
             {
                 _pageRangeText = value;
+                WatermarkInfo.PageRange = EditToolsHelper.ParseRange(PageRangeText);
                 //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, PageRangeText);
-                
+
             }
         }
 
@@ -474,13 +475,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 watermarkInfo.HorizOffset = watermarkItem.horizOffset;
                 watermarkInfo.VerticalSpacing = watermarkItem.verticalSpacing;
                 watermarkInfo.HorizontalSpacing = watermarkItem.horizontalSpacing;
+                watermarkInfo.PageRange = watermarkItem.pageRange;
                 watermarkInfo.PageRangeIndex = watermarkItem.pageRangeIndex;
                 //EditToolsHelper.GetPageRange(watermarkItem.pageRangeIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, watermarkItem.pageRange);
             }
-
         }
 
-
         public void SaveCurrentTemplate()
         {
             var watermarkItem = new WatermarkItem();

+ 20 - 4
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialogViewModel.cs

@@ -208,6 +208,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
             }
         }
+
         #endregion
 
         #region 委托声明
@@ -230,10 +231,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             WatermarkSettingsVisible = Visibility.Visible;
             PDFCurrentDataTable.Columns.Add("FilePageRangeText");
             PDFCurrentDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFCurrentDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFCurrentDataTable.Columns.Add("FileState");
             PDFDataTable.Columns.Add("FileName");
             PDFDataTable.Columns.Add("FilePageRangeText");
             PDFDataTable.Columns.Add("FilePageRangeSelectIndex");
+            PDFDataTable.Columns.Add("IsEvenPageIsEnabled");
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             ADDPDFCommand = new DelegateCommand(addpicture);
@@ -492,15 +495,26 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             pdfdatatable.Columns.Add("FileName");
             pdfdatatable.Columns.Add("FilePageRangeText");
             pdfdatatable.Columns.Add("FilePageRangeSelectIndex");
+            pdfdatatable.Columns.Add("IsEvenPageIsEnabled");
             pdfdatatable.Columns.Add("FileSize");
             pdfdatatable.Columns.Add("FileState");
             int datatableindex = 0;
+            List<int> PageIndexLists = new List<int>();
             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, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]);
+                if (!isEvenPage(fileName) && PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "2")
+                {
+
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                if (PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "3" && !CommonHelper.GetPagesInRange(ref PageIndexLists, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"].ToString(), CPDFDocument.InitWithFilePath(fileName).PageCount, new char[] { ',' }, new char[] { '-' }, true))
+                {
+                    PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
+                }
+                pdfdatatable.Rows.Add(f.Name, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], isEvenPage(fileName), file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]);
                 datatableindex++;
             }
             PDFDataTable = pdfdatatable;
@@ -558,16 +572,18 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         }
 
         /// <summary>
-        /// 获取文件列表单个文件对应的页码范围
-        /// document 文档对象 pagerangetext 自定义页面范围字符串  pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面
+        /// 判断是否关闭偶数页
+        /// document 文档对象 )
         /// </summary>
-        public bool isEvenPage(CPDFDocument document)
+        public bool isEvenPage(string filename)
         {
+            CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
             bool isevenpage = false;
             if (document.PageCount > 1)
             {
                 isevenpage = true;
             }
+            document.Release();
             return isevenpage;
         }
 

+ 8 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkTemplateListFileContentViewModel.cs

@@ -266,6 +266,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 watermarkInfo.HorizOffset = watermarkItem.horizOffset;
                 watermarkInfo.VerticalSpacing = watermarkItem.verticalSpacing;
                 watermarkInfo.HorizontalSpacing = watermarkItem.horizontalSpacing;
+                watermarkInfo.PageRange = watermarkItem.pageRange;
+                watermarkInfo.PageRangeIndex = watermarkItem.pageRangeIndex;
                 //EditToolsHelper.GetPageRange(watermarkItem.pageRangeIndex, CurrentPDFViewer.Document, ref WatermarkInfo.PageRange, watermarkItem.pageRange);
             }
         }
@@ -292,6 +294,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             {
                 ConvertItemToInfo(WatermarkItem, ref WatermarkInfo);
                 homePageWatermarkDialogViewModel.WatermarkInfo = WatermarkInfo;
+                for (int i = 0; homePageWatermarkDialogViewModel.PDFDataTable.Rows.Count > i; i++)
+                {
+                    homePageWatermarkDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeText"] = WatermarkInfo.PageRange;
+                    homePageWatermarkDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeSelectIndex"] = WatermarkInfo.PageRangeIndex.ToString();
+                    homePageWatermarkDialogViewModel.updateListview("待确定");
+                }
             }
         }
 

+ 10 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkTemplateListTextContentViewModel.cs

@@ -2,8 +2,10 @@
 using PDF_Office.CustomControl;
 using PDF_Office.EventAggregators;
 using PDF_Office.Helper;
+using PDF_Office.Model.EditTools.Background;
 using PDF_Office.Model.EditTools.Watermark;
 using PDF_Office.Properties;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Events;
@@ -239,6 +241,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 watermarkInfo.HorizOffset = watermarkItem.horizOffset;
                 watermarkInfo.VerticalSpacing = watermarkItem.verticalSpacing;
                 watermarkInfo.HorizontalSpacing = watermarkItem.horizontalSpacing;
+                watermarkInfo.PageRange = watermarkItem.pageRange;
+                watermarkInfo.PageRangeIndex = watermarkItem.pageRangeIndex;
                 //EditToolsHelper.GetPageRange(watermarkItem.pageRangeIndex, CurrentPDFViewer.Document, ref WatermarkInfo.PageRange, watermarkItem.pageRange);
             }
 
@@ -250,6 +254,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
                 ConvertItemToInfo(WatermarkItem, ref WatermarkInfo);
                 homePageWatermarkDialogViewModel.WatermarkInfo = WatermarkInfo;
+                for (int i = 0; homePageWatermarkDialogViewModel.PDFDataTable.Rows.Count > i; i++)
+                {
+                    homePageWatermarkDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeText"] = WatermarkInfo.PageRange;
+                    homePageWatermarkDialogViewModel.PDFCurrentDataTable.Rows[i]["FilePageRangeSelectIndex"] = WatermarkInfo.PageRangeIndex.ToString();
+                    homePageWatermarkDialogViewModel.updateListview("待确定");
+                }
             }
         }
 

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

@@ -455,6 +455,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 watermarkInfo.HorizOffset = watermarkItem.horizOffset;
                 watermarkInfo.VerticalSpacing = watermarkItem.verticalSpacing;
                 watermarkInfo.HorizontalSpacing = watermarkItem.horizontalSpacing;
+                watermarkInfo.PageRangeIndex = watermarkItem.pageRangeIndex;
                 EditToolsHelper.GetPageRange(watermarkItem.pageRangeIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, watermarkItem.pageRange);
             }
         }

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

@@ -273,6 +273,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 watermarkInfo.HorizOffset = watermarkItem.horizOffset;
                 watermarkInfo.VerticalSpacing = watermarkItem.verticalSpacing;
                 watermarkInfo.HorizontalSpacing = watermarkItem.horizontalSpacing;
+                watermarkInfo.PageRangeIndex = watermarkItem.pageRangeIndex;
                 EditToolsHelper.GetPageRange(watermarkItem.pageRangeIndex, CurrentPDFViewer.Document, ref WatermarkInfo.PageRange, watermarkItem.pageRange);
             }
         }

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

@@ -240,6 +240,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 watermarkInfo.HorizOffset = watermarkItem.horizOffset;
                 watermarkInfo.VerticalSpacing = watermarkItem.verticalSpacing;
                 watermarkInfo.HorizontalSpacing = watermarkItem.horizontalSpacing;
+                watermarkInfo.PageRangeIndex = watermarkItem.pageRangeIndex;
                 EditToolsHelper.GetPageRange(watermarkItem.pageRangeIndex, CurrentPDFViewer.Document, ref WatermarkInfo.PageRange, watermarkItem.pageRange);
             }
 

+ 136 - 136
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateColorContent.xaml

@@ -1,137 +1,137 @@
 <UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground.HomePageBackgroundCreateColorContent"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:prism="http://prismlibrary.com/"             
-             prism:ViewModelLocator.AutoWireViewModel="True"
-               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl" d:DataContext="{d:DesignInstance Type=background:BackgroundCreateColorContentViewModel}"
-             mc:Ignorable="d"
-             d:DesignHeight="632"
-             d:DesignWidth="260">
-    <UserControl.Resources>
-        <ResourceDictionary>
-            <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../../../Styles/CheckBoxStyle.xaml"/>
-            </ResourceDictionary.MergedDictionaries>
-        </ResourceDictionary>
-    </UserControl.Resources>
-    <Grid Margin="16,0,0,0">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="76"></RowDefinition>
-            <RowDefinition Height="156"></RowDefinition>
-            <RowDefinition Height="118"></RowDefinition>
-            <RowDefinition Height="76"></RowDefinition>
-            <RowDefinition></RowDefinition>
-        </Grid.RowDefinitions>
-        <Grid Grid.Row="0" >
-            <StackPanel Orientation="Vertical">
-                <TextBlock Text="背景颜色" Height="20" Width="48" HorizontalAlignment="Left" Margin="0,16,16,8" Foreground="#666666"></TextBlock>
-                <!--<StackPanel Orientation="Horizontal">
-                    <Button Name="RedColorBtn" Height="32" Width="32" Margin="0,0,8,0" Command="{Binding ChangeColorCommand}" CommandParameter="{Binding ElementName=RedColorBtn}">
-                        <Rectangle Height="22" Width="22" Fill="Red" RadiusX="20" RadiusY="20"></Rectangle>
-                    </Button>
-                    <Button Name="GreenColorBtn" Height="32" Width="32" Margin="0,0,8,0"  Command="{Binding ChangeColorCommand}" CommandParameter="{Binding ElementName=GreenColorBtn}">
-                        <Rectangle Height="22" Width="22" Fill="#008000" RadiusX="20" RadiusY="20"></Rectangle>
-
-                    </Button>
-                    <Button Height="32" Width="32" Margin="0,0,8,0"></Button>
-                    <Button Height="32" Width="32" Margin="0,0,8,0"></Button>
-                    <Button Height="32" Width="66">
-                        <Grid Height="32" Width="66" HorizontalAlignment="Center" VerticalAlignment="Center">
-                            <Grid.ColumnDefinitions>
-                                <ColumnDefinition></ColumnDefinition>
-                                <ColumnDefinition></ColumnDefinition>
-                            </Grid.ColumnDefinitions>
-                            <Grid Grid.Column="0" Height="22" Width="22">
-                                <Rectangle Fill="{Binding StringColor, Mode=TwoWay}" RadiusX="20" RadiusY="20"></Rectangle>
-                            </Grid>
-                        </Grid>
-                    </Button>
-                </StackPanel>-->
-                <CompositeControl:ColorContent Grid.Row="1" Margin="0,-2,0,0"  x:Name="cusColor"/>
-            </StackPanel>
-        </Grid>
-        <Grid Grid.Row="1">
-            <StackPanel Orientation="Vertical">
-                <TextBlock Text="外观" Margin="0,16,0,8" Foreground="#666666"></TextBlock>
-                <StackPanel Orientation="Horizontal">
-                    <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
-                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0"   Minimum="-360" Maximum="360"  TypeSouce="{Binding RotationList,Mode=TwoWay}" Value="{Binding RotationValue, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" ></cus:CommonWritableComboBox>
-
-                    <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Loaded="CommonWritableComboBox_Loaded"></cus:CommonWritableComboBox>
-                </StackPanel>
-                <StackPanel Orientation="Horizontal"></StackPanel>
-                <Grid Margin="0,19,0,0">
-
-                    <CheckBox Name="RelativeScaleCheckBox"  Grid.Column="0" Style="{StaticResource EditToolsCheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22"  IsChecked="{Binding IsRelativeScaleValue}"></CheckBox>
-                </Grid>
-                <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,0,0" TypeSouce="{Binding RelativeRatioList,Mode=TwoWay}" Value="{Binding RelativeRatioValue,Mode=TwoWay}" Text="{Binding RelativeScaleText,Mode=TwoWay}"  IsEnabled="{Binding ElementName=RelativeScaleCheckBox,Path=IsChecked}" ></cus:CommonWritableComboBox>
-
-
-            </StackPanel>
-
-        </Grid>
-        <Grid  Grid.Row="2" Margin="0,16,0,0">
-            <StackPanel>
-                <TextBlock Text="位置" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
-                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
-                    <Grid Width="74" Height="74">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition></ColumnDefinition>
-                            <ColumnDefinition></ColumnDefinition>
-                            <ColumnDefinition></ColumnDefinition>
-                        </Grid.ColumnDefinitions>
-                        <Grid.RowDefinitions>
-                            <RowDefinition></RowDefinition>
-                            <RowDefinition></RowDefinition>
-                            <RowDefinition></RowDefinition>
-                        </Grid.RowDefinitions>
-                        <Button Grid.Column="0" Grid.Row="0" Tag="0" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" IsEnabled="{Binding GetLocationFromNumber[0],Mode=TwoWay}"></Button>
-                        <Button Grid.Column="1" Grid.Row="0" Tag="1" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[1], Mode=TwoWay}"></Button>
-                        <Button Grid.Column="2" Grid.Row="0" Tag="2" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[2], Mode=TwoWay}"></Button>
-                        <Button Grid.Column="0" Grid.Row="1" Tag="10" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[10], Mode=TwoWay}"></Button>
-                        <Button Grid.Column="1" Grid.Row="1" Tag="11" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[11], Mode=TwoWay}"></Button>
-                        <Button Grid.Column="2" Grid.Row="1" Tag="12" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[12], Mode=TwoWay}"></Button>
-                        <Button Grid.Column="0" Grid.Row="2" Tag="20" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[20], Mode=TwoWay}"></Button>
-                        <Button Grid.Column="1" Grid.Row="2" Tag="21" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[21], Mode=TwoWay}"></Button>
-                        <Button Grid.Column="2" Grid.Row="2" Tag="22" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[22], Mode=TwoWay}"></Button>
-                    </Grid>
-                    <StackPanel Orientation="Vertical" Margin="70,0,0,0">
-                        <StackPanel Orientation="Horizontal">
-                            <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
-                            <cus:NumericUpDown  Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizontalOffsetValue, Mode=TwoWay}" ></cus:NumericUpDown>
-
-                        </StackPanel>
-                        <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
-                            <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
-                            <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding VerticalOffsetValue, Mode=TwoWay}"></cus:NumericUpDown>
-                        </StackPanel>
-                    </StackPanel>
-
-                </StackPanel>
-                <CheckBox Margin="0,24,0,0" >
-                    <TextBlock Text="平铺" Width="144" Height="22" FontSize="14"/>
-                </CheckBox>
-                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
-                    <StackPanel Orientation="Horizontal">
-                        <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
-                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" >
-                        <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
-                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
-                    </StackPanel>
-                </StackPanel>
-            </StackPanel>
-        </Grid>
-        <Grid Grid.Row="3" Margin="0,16,0,0">
-            <StackPanel Orientation="Vertical">
-                <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
-                <cus:WritableComboBox  Height="32" Width="228" Margin="0,8,0,0" HorizontalAlignment="Left" Text="{Binding PageRangeText,Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
-            </StackPanel>
-        </Grid>
-        <Grid Grid.Row="4">
-        </Grid>
-    </Grid>
-</UserControl>
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl" d:DataContext="{d:DesignInstance Type=background:BackgroundCreateColorContentViewModel}"
+             mc:Ignorable="d"
+             d:DesignHeight="632"
+             d:DesignWidth="260">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../../../Styles/CheckBoxStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid Margin="16,0,0,0">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="76"></RowDefinition>
+            <RowDefinition Height="156"></RowDefinition>
+            <RowDefinition Height="118"></RowDefinition>
+            <RowDefinition Height="76"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0" >
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="背景颜色" Height="20" Width="48" HorizontalAlignment="Left" Margin="0,16,16,8" Foreground="#666666"></TextBlock>
+                <!--<StackPanel Orientation="Horizontal">
+                    <Button Name="RedColorBtn" Height="32" Width="32" Margin="0,0,8,0" Command="{Binding ChangeColorCommand}" CommandParameter="{Binding ElementName=RedColorBtn}">
+                        <Rectangle Height="22" Width="22" Fill="Red" RadiusX="20" RadiusY="20"></Rectangle>
+                    </Button>
+                    <Button Name="GreenColorBtn" Height="32" Width="32" Margin="0,0,8,0"  Command="{Binding ChangeColorCommand}" CommandParameter="{Binding ElementName=GreenColorBtn}">
+                        <Rectangle Height="22" Width="22" Fill="#008000" RadiusX="20" RadiusY="20"></Rectangle>
+
+                    </Button>
+                    <Button Height="32" Width="32" Margin="0,0,8,0"></Button>
+                    <Button Height="32" Width="32" Margin="0,0,8,0"></Button>
+                    <Button Height="32" Width="66">
+                        <Grid Height="32" Width="66" HorizontalAlignment="Center" VerticalAlignment="Center">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition></ColumnDefinition>
+                                <ColumnDefinition></ColumnDefinition>
+                            </Grid.ColumnDefinitions>
+                            <Grid Grid.Column="0" Height="22" Width="22">
+                                <Rectangle Fill="{Binding StringColor, Mode=TwoWay}" RadiusX="20" RadiusY="20"></Rectangle>
+                            </Grid>
+                        </Grid>
+                    </Button>
+                </StackPanel>-->
+                <CompositeControl:ColorContent Grid.Row="1" Margin="0,-2,0,0"  x:Name="cusColor"/>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="外观" Margin="0,16,0,8" Foreground="#666666"></TextBlock>
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0"   Minimum="-360" Maximum="360"  TypeSouce="{Binding RotationList,Mode=TwoWay}" Value="{Binding RotationValue, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" ></cus:CommonWritableComboBox>
+
+                    <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Loaded="CommonWritableComboBox_Loaded"></cus:CommonWritableComboBox>
+                </StackPanel>
+                <StackPanel Orientation="Horizontal"></StackPanel>
+                <Grid Margin="0,19,0,0">
+
+                    <CheckBox Name="RelativeScaleCheckBox"  Grid.Column="0" Style="{StaticResource EditToolsCheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22"  IsChecked="{Binding IsRelativeScaleValue}"></CheckBox>
+                </Grid>
+                <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,0,0" TypeSouce="{Binding RelativeRatioList,Mode=TwoWay}" Value="{Binding RelativeRatioValue,Mode=TwoWay}" Text="{Binding RelativeScaleText,Mode=TwoWay}"  IsEnabled="{Binding ElementName=RelativeScaleCheckBox,Path=IsChecked}" ></cus:CommonWritableComboBox>
+
+
+            </StackPanel>
+
+        </Grid>
+        <Grid  Grid.Row="2" Margin="0,16,0,0">
+            <StackPanel>
+                <TextBlock Text="位置" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <Grid Width="74" Height="74">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                        </Grid.RowDefinitions>
+                        <Button Grid.Column="0" Grid.Row="0" Tag="0" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" IsEnabled="{Binding GetLocationFromNumber[0],Mode=TwoWay}"></Button>
+                        <Button Grid.Column="1" Grid.Row="0" Tag="1" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[1], Mode=TwoWay}"></Button>
+                        <Button Grid.Column="2" Grid.Row="0" Tag="2" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[2], Mode=TwoWay}"></Button>
+                        <Button Grid.Column="0" Grid.Row="1" Tag="10" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[10], Mode=TwoWay}"></Button>
+                        <Button Grid.Column="1" Grid.Row="1" Tag="11" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[11], Mode=TwoWay}"></Button>
+                        <Button Grid.Column="2" Grid.Row="1" Tag="12" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[12], Mode=TwoWay}"></Button>
+                        <Button Grid.Column="0" Grid.Row="2" Tag="20" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[20], Mode=TwoWay}"></Button>
+                        <Button Grid.Column="1" Grid.Row="2" Tag="21" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[21], Mode=TwoWay}"></Button>
+                        <Button Grid.Column="2" Grid.Row="2" Tag="22" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[22], Mode=TwoWay}"></Button>
+                    </Grid>
+                    <StackPanel Orientation="Vertical" Margin="70,0,0,0">
+                        <StackPanel Orientation="Horizontal">
+                            <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
+                            <cus:NumericUpDown  Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizontalOffsetValue, Mode=TwoWay}" ></cus:NumericUpDown>
+
+                        </StackPanel>
+                        <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                            <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
+                            <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding VerticalOffsetValue, Mode=TwoWay}"></cus:NumericUpDown>
+                        </StackPanel>
+                    </StackPanel>
+
+                </StackPanel>
+                <CheckBox Margin="0,24,0,0" >
+                    <TextBlock Text="平铺" Width="144" Height="22" FontSize="14"/>
+                </CheckBox>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
+                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" >
+                        <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
+                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                    </StackPanel>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="3" Margin="0,16,0,0">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
+                <cus:WritableComboBox  Height="32" Width="228" Margin="0,8,0,0" HorizontalAlignment="Left" Text="{Binding PageRangeText,Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="4">
+        </Grid>
+    </Grid>
+</UserControl>

+ 106 - 106
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateFileContent.xaml

@@ -1,107 +1,107 @@
 <UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground.HomePageBackgroundCreateFileContent"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:prism="http://prismlibrary.com/"             
-             prism:ViewModelLocator.AutoWireViewModel="True"
-              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" d:DataContext="{d:DesignInstance Type=background:BackgroundCreateFileContentViewModel}"
-             mc:Ignorable="d"
-             d:DesignHeight="632"
-             d:DesignWidth="260">
-    <UserControl.Resources>
-        <ResourceDictionary>
-            <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../../../Styles/CheckBoxStyle.xaml"/>
-            </ResourceDictionary.MergedDictionaries>
-        </ResourceDictionary>
-    </UserControl.Resources>
-    <Grid Margin="16,0,0,0">
-        <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="58*"/>
-            <ColumnDefinition Width="3*"/>
-        </Grid.ColumnDefinitions>
-        <Grid.RowDefinitions>
-            <RowDefinition Height="48"></RowDefinition>
-            <RowDefinition Height="423"></RowDefinition>
-            <RowDefinition></RowDefinition>
-        </Grid.RowDefinitions>
-        <Grid Grid.Row="0" Grid.ColumnSpan="2">
-            <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
-                <TextBox Height="32" Width="189" Margin="0,0,7,0" IsReadOnly="True"  Text="{Binding FileNameText}" FontSize="14" VerticalAlignment="Center"></TextBox>
-                <Button Height="32" Width="32" Command="{Binding OpenFileCommand}"></Button>
-            </StackPanel>
-        </Grid>
-        <Grid Grid.Row="1" Visibility="{Binding CreateModFileVisible}" Grid.ColumnSpan="2">
-            <Grid.RowDefinitions>
-                <RowDefinition Height="157"></RowDefinition>
-                <RowDefinition Height="163"></RowDefinition>
-                <RowDefinition Height="103"></RowDefinition>
-                <RowDefinition></RowDefinition>
-            </Grid.RowDefinitions>
-            <Grid Grid.Row="0">
-                <StackPanel Orientation="Vertical">
-                    <TextBlock Text="外观" Margin="0,16,0,8" Foreground="#666666"></TextBlock>
-                    <StackPanel Orientation="Horizontal">
-                        <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
-                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding RotationList, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
-                        <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}"  Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal"></StackPanel>
-                    <Grid Margin="0,19,0,0">
-                        <CheckBox Name="RelativeScaleCheckBox"  Grid.Column="0" Style="{StaticResource EditToolsCheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22"  IsChecked="{Binding IsRelativeScaleValue}"></CheckBox>
-                    </Grid>
-                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,28,0" TypeSouce="{Binding RelativeRatioList, Mode=TwoWay}" Value="{Binding RelativeRatioValue,Mode=TwoWay}"   Text="{Binding RelativeScaleText,Mode=TwoWay}"  IsEnabled="{Binding ElementName=RelativeScaleCheckBox,Path=IsChecked}"></cus:CommonWritableComboBox>
-                </StackPanel>
-            </Grid>
-            <Grid  Grid.Row="1" Margin="0,16,0,0" VerticalAlignment="Bottom">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="3*"/>
-                    <ColumnDefinition Width="241*"/>
-                </Grid.ColumnDefinitions>
-                <StackPanel Grid.ColumnSpan="2">
-                    <TextBlock Text="位置" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
-                    <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
-                        <Grid Width="74" Height="74">
-                            <Grid.ColumnDefinitions>
-                                <ColumnDefinition></ColumnDefinition>
-                                <ColumnDefinition></ColumnDefinition>
-                                <ColumnDefinition></ColumnDefinition>
-                            </Grid.ColumnDefinitions>
-                            <Grid.RowDefinitions>
-                                <RowDefinition></RowDefinition>
-                                <RowDefinition></RowDefinition>
-                                <RowDefinition></RowDefinition>
-                            </Grid.RowDefinitions>
-                            <Button Grid.Column="0" Grid.Row="0" Tag="0" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" IsEnabled="{Binding GetLocationFromNumber[0],Mode=TwoWay}"></Button>
-                            <Button Grid.Column="1" Grid.Row="0" Tag="1" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[1], Mode=TwoWay}"></Button>
-                            <Button Grid.Column="2" Grid.Row="0" Tag="2" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[2], Mode=TwoWay}"></Button>
-                            <Button Grid.Column="0" Grid.Row="1" Tag="10" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[10], Mode=TwoWay}"></Button>
-                            <Button Grid.Column="1" Grid.Row="1" Tag="11" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[11], Mode=TwoWay}"></Button>
-                            <Button Grid.Column="2" Grid.Row="1" Tag="12" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[12], Mode=TwoWay}"></Button>
-                            <Button Grid.Column="0" Grid.Row="2" Tag="20" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[20], Mode=TwoWay}"></Button>
-                            <Button Grid.Column="1" Grid.Row="2" Tag="21" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[21], Mode=TwoWay}"></Button>
-                            <Button Grid.Column="2" Grid.Row="2" Tag="22" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[22], Mode=TwoWay}"></Button>
-                        </Grid>
-                        <StackPanel Orientation="Vertical" Margin="70,0,0,0">
-                            <StackPanel Orientation="Horizontal">
-                                <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
-                                <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizontalOffsetValue, Mode=TwoWay}"></cus:NumericUpDown>
-                            </StackPanel>
-                            <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
-                                <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
-                                <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding VerticalOffsetValue, Mode=TwoWay}"></cus:NumericUpDown>
-                            </StackPanel>
-                        </StackPanel>
-                    </StackPanel>
-                </StackPanel>
-            </Grid>
-            <Grid Grid.Row="2" Margin="0,16,0,0" VerticalAlignment="Bottom">
-                <StackPanel Orientation="Vertical">
-                    <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
-                    <cus:WritableComboBox  Height="32" Width="228" Margin="0,8,0,0" HorizontalAlignment="Left" Text="{Binding PageRangeText,Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
-                </StackPanel>
-            </Grid>
-        </Grid>
-    </Grid>
-</UserControl>
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" d:DataContext="{d:DesignInstance Type=background:BackgroundCreateFileContentViewModel}"
+             mc:Ignorable="d"
+             d:DesignHeight="632"
+             d:DesignWidth="260">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../../../Styles/CheckBoxStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid Margin="16,0,0,0">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="58*"/>
+            <ColumnDefinition Width="3*"/>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="48"></RowDefinition>
+            <RowDefinition Height="423"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0" Grid.ColumnSpan="2">
+            <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
+                <TextBox Height="32" Width="189" Margin="0,0,7,0" IsReadOnly="True"  Text="{Binding FileNameText}" FontSize="14" VerticalAlignment="Center"></TextBox>
+                <Button Height="32" Width="32" Command="{Binding OpenFileCommand}"></Button>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1" Visibility="{Binding CreateModFileVisible}" Grid.ColumnSpan="2">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="157"></RowDefinition>
+                <RowDefinition Height="163"></RowDefinition>
+                <RowDefinition Height="103"></RowDefinition>
+                <RowDefinition></RowDefinition>
+            </Grid.RowDefinitions>
+            <Grid Grid.Row="0">
+                <StackPanel Orientation="Vertical">
+                    <TextBlock Text="外观" Margin="0,16,0,8" Foreground="#666666"></TextBlock>
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
+                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding RotationList, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
+                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}"  Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal"></StackPanel>
+                    <Grid Margin="0,19,0,0">
+                        <CheckBox Name="RelativeScaleCheckBox"  Grid.Column="0" Style="{StaticResource EditToolsCheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22"  IsChecked="{Binding IsRelativeScaleValue}"></CheckBox>
+                    </Grid>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,28,0" TypeSouce="{Binding RelativeRatioList, Mode=TwoWay}" Value="{Binding RelativeRatioValue,Mode=TwoWay}"   Text="{Binding RelativeScaleText,Mode=TwoWay}"  IsEnabled="{Binding ElementName=RelativeScaleCheckBox,Path=IsChecked}"></cus:CommonWritableComboBox>
+                </StackPanel>
+            </Grid>
+            <Grid  Grid.Row="1" Margin="0,16,0,0" VerticalAlignment="Bottom">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="3*"/>
+                    <ColumnDefinition Width="241*"/>
+                </Grid.ColumnDefinitions>
+                <StackPanel Grid.ColumnSpan="2">
+                    <TextBlock Text="位置" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                    <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                        <Grid Width="74" Height="74">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition></ColumnDefinition>
+                                <ColumnDefinition></ColumnDefinition>
+                                <ColumnDefinition></ColumnDefinition>
+                            </Grid.ColumnDefinitions>
+                            <Grid.RowDefinitions>
+                                <RowDefinition></RowDefinition>
+                                <RowDefinition></RowDefinition>
+                                <RowDefinition></RowDefinition>
+                            </Grid.RowDefinitions>
+                            <Button Grid.Column="0" Grid.Row="0" Tag="0" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" IsEnabled="{Binding GetLocationFromNumber[0],Mode=TwoWay}"></Button>
+                            <Button Grid.Column="1" Grid.Row="0" Tag="1" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[1], Mode=TwoWay}"></Button>
+                            <Button Grid.Column="2" Grid.Row="0" Tag="2" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[2], Mode=TwoWay}"></Button>
+                            <Button Grid.Column="0" Grid.Row="1" Tag="10" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[10], Mode=TwoWay}"></Button>
+                            <Button Grid.Column="1" Grid.Row="1" Tag="11" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[11], Mode=TwoWay}"></Button>
+                            <Button Grid.Column="2" Grid.Row="1" Tag="12" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[12], Mode=TwoWay}"></Button>
+                            <Button Grid.Column="0" Grid.Row="2" Tag="20" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[20], Mode=TwoWay}"></Button>
+                            <Button Grid.Column="1" Grid.Row="2" Tag="21" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[21], Mode=TwoWay}"></Button>
+                            <Button Grid.Column="2" Grid.Row="2" Tag="22" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"  IsEnabled="{Binding GetLocationFromNumber[22], Mode=TwoWay}"></Button>
+                        </Grid>
+                        <StackPanel Orientation="Vertical" Margin="70,0,0,0">
+                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
+                                <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizontalOffsetValue, Mode=TwoWay}"></cus:NumericUpDown>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                                <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
+                                <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding VerticalOffsetValue, Mode=TwoWay}"></cus:NumericUpDown>
+                            </StackPanel>
+                        </StackPanel>
+                    </StackPanel>
+                </StackPanel>
+            </Grid>
+            <Grid Grid.Row="2" Margin="0,16,0,0" VerticalAlignment="Bottom">
+                <StackPanel Orientation="Vertical">
+                    <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
+                    <cus:WritableComboBox  Height="32" Width="228" Margin="0,8,0,0" HorizontalAlignment="Left" Text="{Binding PageRangeText,Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
+                </StackPanel>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml

@@ -48,7 +48,7 @@
                             <GridViewColumn Header="页面范围" Width="170" >
                                 <GridViewColumn.CellTemplate>
                                     <DataTemplate>
-                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
+                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}" EvenPageIsEnabled="{Binding IsEvenPageIsEnabled,Mode=TwoWay}" LostFocus="PageRangeWritableComboBox_LostFocus"></cus:WritableComboBox>
                                     </DataTemplate>
                                 </GridViewColumn.CellTemplate>
                             </GridViewColumn>

+ 15 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml.cs

@@ -1,9 +1,12 @@
-using PDF_Office.Helper;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
 using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground;
 using Prism.Ioc;
 using Prism.Regions;
 using System;
 using System.Collections;
+using System.Data;
+using System.Diagnostics;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Interop;
@@ -145,5 +148,16 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             }
 
         }
+
+        private void PageRangeWritableComboBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            WritableComboBox writableComboBox = sender as WritableComboBox;
+            var ls = writableComboBox.DataContext as DataRowView;
+
+            Trace.WriteLine("adasda" + viewModel.PDFDataTable.Rows.IndexOf(ls.Row));
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeSelectIndex"] = writableComboBox.SelectedIndex.ToString();
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeText"] = writableComboBox.Text;
+            viewModel.updateListview("待确定");
+        }
     }
 }

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml

@@ -48,7 +48,7 @@
                             <GridViewColumn Header="页面范围" Width="170" >
                                 <GridViewColumn.CellTemplate>
                                     <DataTemplate>
-                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
+                                        <cus:WritableComboBox x:Name="PageRangeWritableComboBox" Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}"  EvenPageIsEnabled="{Binding IsEvenPageIsEnabled,Mode=TwoWay}" LostFocus="PageRangeWritableComboBox_LostFocus"></cus:WritableComboBox>
                                     </DataTemplate>
                                 </GridViewColumn.CellTemplate>
                             </GridViewColumn>

+ 22 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml.cs

@@ -1,12 +1,17 @@
-using PDF_Office.Helper;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates;
 using Prism.Ioc;
 using Prism.Regions;
 using System;
 using System.Collections;
+using System.Data;
+using System.Diagnostics;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Interop;
+using System.Windows.Media;
 
 namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates
 {
@@ -32,16 +37,21 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             menuPop1.IsOpen = true;
         }
 
+       
+
         private void listView_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
             IList list = listView.SelectedItems;
+
             var lists = listView.Items;
             System.Data.DataRowView a;
             viewModel.fileNamesView.Clear();
             foreach (var item in list)
             {
+                
                 a = (System.Data.DataRowView)item;
                 viewModel.fileNamesView.Add(lists.IndexOf(a));
+                
             }
             if (viewModel.fileNamesView.Count > 0)
             {
@@ -145,5 +155,16 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             }
 
         }
+
+        private void PageRangeWritableComboBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+           WritableComboBox  writableComboBox = sender as WritableComboBox;
+            var ls = writableComboBox.DataContext as DataRowView;
+            
+            Trace.WriteLine("adasda"+ viewModel.PDFDataTable.Rows.IndexOf(ls.Row));
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeSelectIndex"] = writableComboBox.SelectedIndex.ToString();
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeText"] = writableComboBox.Text;
+            viewModel.updateListview("待确定");
+        }
     }
 }

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml

@@ -48,7 +48,7 @@
                             <GridViewColumn Header="页面范围" Width="170" >
                                 <GridViewColumn.CellTemplate>
                                     <DataTemplate>
-                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
+                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}" EvenPageIsEnabled="{Binding IsEvenPageIsEnabled,Mode=TwoWay}" LostFocus="PageRangeWritableComboBox_LostFocus"></cus:WritableComboBox>
                                     </DataTemplate>
                                 </GridViewColumn.CellTemplate>
                             </GridViewColumn>

+ 14 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml.cs

@@ -1,10 +1,13 @@
-using PDF_Office.Helper;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
 using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
 using Prism.Ioc;
 using Prism.Regions;
 using System;
 using System.Collections;
+using System.Data;
+using System.Diagnostics;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Interop;
@@ -150,5 +153,15 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             }
 
         }
+        private void PageRangeWritableComboBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            WritableComboBox writableComboBox = sender as WritableComboBox;
+            var ls = writableComboBox.DataContext as DataRowView;
+
+            Trace.WriteLine("adasda" + viewModel.PDFDataTable.Rows.IndexOf(ls.Row));
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeSelectIndex"] = writableComboBox.SelectedIndex.ToString();
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeText"] = writableComboBox.Text;
+            viewModel.updateListview("待确定");
+        }
     }
 }

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml

@@ -48,7 +48,7 @@
                             <GridViewColumn Header="页面范围" Width="170" >
                                 <GridViewColumn.CellTemplate>
                                     <DataTemplate>
-                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
+                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}" EvenPageIsEnabled="{Binding IsEvenPageIsEnabled,Mode=TwoWay}" LostFocus="PageRangeWritableComboBox_LostFocus"></cus:WritableComboBox>
                                     </DataTemplate>
                                 </GridViewColumn.CellTemplate>
                             </GridViewColumn>

+ 14 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml.cs

@@ -1,9 +1,12 @@
-using PDF_Office.Helper;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
 using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter;
 using Prism.Ioc;
 using Prism.Regions;
 using System;
 using System.Collections;
+using System.Data;
+using System.Diagnostics;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Interop;
@@ -145,6 +148,16 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             }
 
         }
+        private void PageRangeWritableComboBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            WritableComboBox writableComboBox = sender as WritableComboBox;
+            var ls = writableComboBox.DataContext as DataRowView;
+
+            Trace.WriteLine("adasda" + viewModel.PDFDataTable.Rows.IndexOf(ls.Row));
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeSelectIndex"] = writableComboBox.SelectedIndex.ToString();
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeText"] = writableComboBox.Text;
+            viewModel.updateListview("待确定");
+        }
     }
 }
 

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml

@@ -48,7 +48,7 @@
                             <GridViewColumn Header="页面范围" Width="170" >
                                 <GridViewColumn.CellTemplate>
                                     <DataTemplate>
-                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}"></cus:WritableComboBox>
+                                        <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}" EvenPageIsEnabled="{Binding IsEvenPageIsEnabled,Mode=TwoWay}" LostFocus="PageRangeWritableComboBox_LostFocus"></cus:WritableComboBox>
                                     </DataTemplate>
                                 </GridViewColumn.CellTemplate>
                             </GridViewColumn>

+ 15 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml.cs

@@ -1,9 +1,12 @@
-using PDF_Office.Helper;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
 using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark;
 using Prism.Ioc;
 using Prism.Regions;
 using System;
 using System.Collections;
+using System.Data;
+using System.Diagnostics;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Interop;
@@ -145,6 +148,17 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             }
 
         }
+
+        private void PageRangeWritableComboBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            WritableComboBox writableComboBox = sender as WritableComboBox;
+            var ls = writableComboBox.DataContext as DataRowView;
+
+            Trace.WriteLine("adasda" + viewModel.PDFDataTable.Rows.IndexOf(ls.Row));
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeSelectIndex"] = writableComboBox.SelectedIndex.ToString();
+            viewModel.PDFCurrentDataTable.Rows[viewModel.PDFDataTable.Rows.IndexOf(ls.Row)]["FilePageRangeText"] = writableComboBox.Text;
+            viewModel.updateListview("待确定");
+        }
     }
 }