|
@@ -1,7 +1,9 @@
|
|
|
using ComPDFKitViewer.PdfViewer;
|
|
|
using PDF_Office.Helper;
|
|
|
using PDF_Office.Model;
|
|
|
+using PDF_Office.Model.Dialog.ConverterDialogs;
|
|
|
using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
|
|
|
+using PDF_Office.Model.Dialog.ToolsDialogs;
|
|
|
using PDF_Office.Model.PDFTool;
|
|
|
using PDF_Office.Views;
|
|
|
using PDFSettings;
|
|
@@ -142,12 +144,24 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
|
|
|
break;
|
|
|
|
|
|
case PDFFnType.Compress:
|
|
|
+
|
|
|
+ viewer.InitDocument(dlg.FileName);
|
|
|
+ if (!CheckPassword(viewer)) { return; }
|
|
|
DialogParameters compresspdf = new DialogParameters();
|
|
|
- compresspdf.Add(ParameterNames.BatchProcessing_Name, "1");
|
|
|
- HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
- HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
|
|
|
- compresspdf.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
- dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, compresspdf, e => { });
|
|
|
+ compresspdf.Add(ParameterNames.PDFViewer, viewer);
|
|
|
+ dialogs.ShowDialog(DialogNames.CompressDialog, compresspdf, e =>
|
|
|
+ {
|
|
|
+ CompressDialogModel compressDialogModel = new CompressDialogModel();
|
|
|
+ compressDialogModel.OnOpened((Prism.Services.Dialogs.DialogResult)e);
|
|
|
+ // OnOpened((Prism.Services.Dialogs.DialogResult)e);
|
|
|
+ });
|
|
|
+ //批量
|
|
|
+ //DialogParameters compresspdf = new DialogParameters();
|
|
|
+ //compresspdf.Add(ParameterNames.BatchProcessing_Name, "1");
|
|
|
+ //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
+ //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
|
|
|
+ //compresspdf.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
+ //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, compresspdf, e => { });
|
|
|
break;
|
|
|
|
|
|
case PDFFnType.ImageToPDF:
|
|
@@ -183,12 +197,13 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
|
|
|
|
|
|
break;
|
|
|
case PDFFnType.ConvertPDF:
|
|
|
- DialogParameters convertpdf = new DialogParameters();
|
|
|
- convertpdf.Add(ParameterNames.BatchProcessing_Name, "0");
|
|
|
- HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
- HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
|
|
|
- convertpdf.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
- dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdf, e => { });
|
|
|
+
|
|
|
+ //DialogParameters convertpdf = new DialogParameters();
|
|
|
+ //convertpdf.Add(ParameterNames.BatchProcessing_Name, "0");
|
|
|
+ //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
+ //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
|
|
|
+ //convertpdf.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
+ //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdf, e => { });
|
|
|
|
|
|
break;
|
|
|
case PDFFnType.BatchRemove:
|
|
@@ -241,31 +256,61 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
|
|
|
dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoimage, e => { });
|
|
|
break;
|
|
|
case PDFFnType.PDFToExcel:
|
|
|
+
|
|
|
+ viewer.InitDocument(dlg.FileName);
|
|
|
+ if (!CheckPassword(viewer)) { return; }
|
|
|
DialogParameters convertpdftoexcel = new DialogParameters();
|
|
|
- convertpdftoexcel.Add(ParameterNames.BatchProcessing_Name, "0");
|
|
|
- convertpdftoexcel.Add("ConverterTypeIndex", 1);
|
|
|
- HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
- HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
|
|
|
- convertpdftoexcel.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
- dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoexcel, e => { });
|
|
|
+ convertpdftoexcel.Add(ParameterNames.PDFViewer, viewer);
|
|
|
+ dialogs.ShowDialog(DialogNames.ConverterExcelDialog, convertpdftoexcel, e =>
|
|
|
+ {
|
|
|
+ ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
|
|
|
+ converterDialogsModel.OnOpened((DialogResult)e);
|
|
|
+ });
|
|
|
+ //DialogParameters convertpdftoexcel = new DialogParameters();
|
|
|
+ //convertpdftoexcel.Add(ParameterNames.BatchProcessing_Name, "0");
|
|
|
+ //convertpdftoexcel.Add("ConverterTypeIndex", 1);
|
|
|
+ //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
+ //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
|
|
|
+ //convertpdftoexcel.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
+ //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoexcel, e => { });
|
|
|
break;
|
|
|
case PDFFnType.PDFToPPT:
|
|
|
- DialogParameters convertpdftoppt = new DialogParameters();
|
|
|
- convertpdftoppt.Add(ParameterNames.BatchProcessing_Name, "0");
|
|
|
- convertpdftoppt.Add("ConverterTypeIndex", 2);
|
|
|
- HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
- HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
|
|
|
- convertpdftoppt.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
- dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoppt, e => { });
|
|
|
+ viewer.InitDocument(dlg.FileName);
|
|
|
+ if (!CheckPassword(viewer)) { return; }
|
|
|
+ DialogParameters convertpdf = new DialogParameters();
|
|
|
+ convertpdf.Add(ParameterNames.PDFViewer, viewer);
|
|
|
+ dialogs.ShowDialog(DialogNames.ConverterPPTDialog, convertpdf, e =>
|
|
|
+ {
|
|
|
+ ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
|
|
|
+ converterDialogsModel.OnOpened((DialogResult)e);
|
|
|
+ });
|
|
|
+ //批量处理
|
|
|
+ //DialogParameters convertpdftoppt = new DialogParameters();
|
|
|
+ //convertpdftoppt.Add(ParameterNames.BatchProcessing_Name, "0");
|
|
|
+ //convertpdftoppt.Add("ConverterTypeIndex", 2);
|
|
|
+ //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
+ //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
|
|
|
+ //convertpdftoppt.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
+ //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoppt, e => { });
|
|
|
break;
|
|
|
case PDFFnType.PDFToWord:
|
|
|
+ viewer.InitDocument(dlg.FileName);
|
|
|
+ if (!CheckPassword(viewer)) { return; }
|
|
|
DialogParameters convertpdftoword = new DialogParameters();
|
|
|
- convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
|
|
|
- convertpdftoword.Add("ConverterTypeIndex", 0);
|
|
|
- HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
- HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
|
|
|
- convertpdftoword.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
- dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
|
|
|
+ convertpdftoword.Add(ParameterNames.PDFViewer, viewer);
|
|
|
+ dialogs.ShowDialog(DialogNames.ConverterWordDialog, convertpdftoword, e =>
|
|
|
+ {
|
|
|
+ ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
|
|
|
+ converterDialogsModel.OnOpened((DialogResult)e);
|
|
|
+ });
|
|
|
+ //批量处理
|
|
|
+ //DialogParameters convertpdftoword = new DialogParameters();
|
|
|
+ //convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
|
|
|
+ //convertpdftoword.Add("ConverterTypeIndex", 0);
|
|
|
+ //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
|
|
|
+ //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
|
|
|
+ //convertpdftoword.Add(ParameterNames.FilePath, dlg.FileNames);
|
|
|
+ //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
|
|
|
break;
|
|
|
case PDFFnType.Batch:
|
|
|
DialogParameters batcpdf = new DialogParameters();
|