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