Browse Source

合并-修复合并功能,选择奇偶数页面效果不准确问题

ZhouJieSheng 1 year ago
parent
commit
c353da925e
1 changed files with 8 additions and 1 deletions
  1. 8 1
      PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

+ 8 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -258,7 +258,14 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                     }
                     else
                     {
-                        result = SaveDoc.ImportPages(tempDoc, CommonHelper.GetPageParmFromList(MergeObjectlist[i].SetPageRange));
+                        //下拉框控件传出来的list是页面索引集合,
+                        //此处传给SDK的合并接口的是页码集合,因此需要将集合项遍历+1,只有合并接口是接收页码集合,其余接口是接受页面索引集合
+                        List<int> pageIndexs = new List<int>();
+                        for(int j=0;j< MergeObjectlist[i].SetPageRange.Count; j++)
+                        {
+                            pageIndexs.Add(MergeObjectlist[i].SetPageRange[j]+1);
+                        }
+                        result = SaveDoc.ImportPages(tempDoc, CommonHelper.GetPageParmFromList(pageIndexs));
                     }
                     if (!result)
                     {