|
@@ -8,6 +8,7 @@ using ComDocumentAIKit;
|
|
|
using ComPDFKit_Conversion.Options;
|
|
|
using Microsoft.Office.Interop.Word;
|
|
|
using PDF_Master.Helper;
|
|
|
+using PDF_Master.CustomControl;
|
|
|
|
|
|
namespace PDF_Master.Model.Dialog.ConverterDialogs
|
|
|
{
|
|
@@ -15,7 +16,7 @@ namespace PDF_Master.Model.Dialog.ConverterDialogs
|
|
|
{
|
|
|
public COCRLanguage OCRLanguage = COCRLanguage.English;
|
|
|
public bool IsAllowOCR = false;
|
|
|
- public bool IsContainOCRBgImage =false;
|
|
|
+ public bool IsContainOCRBgImage = false;
|
|
|
public bool IsContainAnnotations = true;
|
|
|
public bool IsContainImages = true;
|
|
|
public ContentOptions ContentOpts = ContentOptions.AllContent;
|
|
@@ -33,22 +34,22 @@ namespace PDF_Master.Model.Dialog.ConverterDialogs
|
|
|
/// <summary>
|
|
|
/// 文档地址;
|
|
|
/// </summary>
|
|
|
- public string InputPath="";
|
|
|
+ public string InputPath = "";
|
|
|
|
|
|
/// <summary>
|
|
|
/// 输出地址;
|
|
|
/// </summary>
|
|
|
- public string OutputPath="";
|
|
|
+ public string OutputPath = "";
|
|
|
|
|
|
/// <summary>
|
|
|
/// 进度;
|
|
|
/// </summary>
|
|
|
- public OnProgress GetProgress=null;
|
|
|
+ public OnProgress GetProgress = null;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 页码 页码范围;
|
|
|
/// </summary>
|
|
|
- public List<int> PageIndexLists= new List<int> { };
|
|
|
+ public List<int> PageIndexLists = new List<int> { };
|
|
|
|
|
|
/// <summary>
|
|
|
/// 页面信息
|
|
@@ -58,18 +59,18 @@ namespace PDF_Master.Model.Dialog.ConverterDialogs
|
|
|
/// <summary>
|
|
|
/// 文档密码;
|
|
|
/// </summary>
|
|
|
- public string Pawssword="";
|
|
|
+ public string Pawssword = "";
|
|
|
|
|
|
/// <summary>
|
|
|
/// 文档密码;
|
|
|
/// </summary>
|
|
|
- public bool IsCustomFileName=true;
|
|
|
-
|
|
|
+ public bool IsCustomFileName = true;
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
|
/// OCR,与部分功能;
|
|
|
/// </summary>
|
|
|
- public ConvertOptions Options=new ConvertOptions();
|
|
|
+ public ConvertOptions Options = new ConvertOptions();
|
|
|
|
|
|
private void ConverterClear()
|
|
|
{
|
|
@@ -79,13 +80,13 @@ namespace PDF_Master.Model.Dialog.ConverterDialogs
|
|
|
private void SetProgress(int pageIndex)
|
|
|
{
|
|
|
App.mainWindowViewModel.Value = pageIndex;
|
|
|
-
|
|
|
+
|
|
|
if (App.mainWindowViewModel.Value == App.mainWindowViewModel.MaxValue) { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
|
|
|
}
|
|
|
|
|
|
public async void OnOpened(Prism.Services.Dialogs.DialogResult e)
|
|
|
{
|
|
|
- if (e.Result == Prism.Services.Dialogs.ButtonResult.Cancel|| e.Result== Prism.Services.Dialogs.ButtonResult.None) { return; }
|
|
|
+ if (e.Result == Prism.Services.Dialogs.ButtonResult.Cancel || e.Result == Prism.Services.Dialogs.ButtonResult.None) { return; }
|
|
|
bool result = false;
|
|
|
string convertType = "";
|
|
|
OnProgress GetProgress = null;
|
|
@@ -207,6 +208,12 @@ namespace PDF_Master.Model.Dialog.ConverterDialogs
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+ if (!result)
|
|
|
+ {
|
|
|
+ AlertsMessage alertsMessage = new AlertsMessage();
|
|
|
+ alertsMessage.ShowDialog("", App.MainPageLoader.GetString("Convert_FailedWarning"), App.ServiceLoader.GetString("Text_ok"));
|
|
|
+ }
|
|
|
+ App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed;
|
|
|
}
|
|
|
|
|
|
}
|