|
@@ -5,11 +5,8 @@ using ComPDFKit.PDFPage;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Diagnostics;
|
|
|
-using System.Linq;
|
|
|
-using System.Text;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Threading;
|
|
|
-using System.Threading.Tasks;
|
|
|
using System.Windows.Media;
|
|
|
using System.Windows;
|
|
|
|
|
@@ -152,18 +149,17 @@ namespace ComPDFKit.Tool
|
|
|
double searchPercent = 100;
|
|
|
try
|
|
|
{
|
|
|
-
|
|
|
mSearchDocument = CPDFDocument.InitWithFilePath(TextSearchDocument.FilePath);
|
|
|
- if (password != null && password != string.Empty)
|
|
|
+ if (mSearchDocument.IsLocked && !string.IsNullOrEmpty(password))
|
|
|
{
|
|
|
mSearchDocument.UnlockWithPassword(password);
|
|
|
}
|
|
|
- password = string.Empty;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
+
|
|
|
if (mSearchDocument != null)
|
|
|
{
|
|
|
try
|
|
@@ -232,6 +228,7 @@ namespace ComPDFKit.Tool
|
|
|
}
|
|
|
mSearchDocument.Release();
|
|
|
}
|
|
|
+
|
|
|
try
|
|
|
{
|
|
|
if (SearchCompletedHandler != null && !isCancel)
|
|
@@ -248,6 +245,7 @@ namespace ComPDFKit.Tool
|
|
|
{
|
|
|
|
|
|
}
|
|
|
+
|
|
|
CanDoSearch = true;
|
|
|
isCancel = false;
|
|
|
}
|