|
@@ -203,16 +203,18 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
private void OpenSetPasswordDialog()
|
|
|
{
|
|
|
VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
|
|
|
-
|
|
|
if (result.IsDiscryptied)
|
|
|
{
|
|
|
- if ((result.Password != null || !viewContentViewModel.SecurityInfo.IsPasswordChanged)&&!string.IsNullOrEmpty(PDFViewer.Document.FilePath))
|
|
|
+ if (result.Password != null&&!string.IsNullOrEmpty(PDFViewer.Document.FilePath))
|
|
|
{
|
|
|
- string filePath = PDFViewer.Document.FilePath;
|
|
|
- PDFViewer.CloseDocument();
|
|
|
- PDFViewer.InitDocument(filePath);
|
|
|
- PDFViewer.Load();
|
|
|
- PDFViewer.Document.UnlockWithPassword(result.Password);
|
|
|
+ //string filePath = PDFViewer.Document.FilePath;
|
|
|
+ //PDFViewer.CloseDocument();
|
|
|
+ //PDFViewer.InitDocument(filePath);
|
|
|
+ //if (PDFViewer.Document != null)
|
|
|
+ //{
|
|
|
+ // PDFViewer.Load();
|
|
|
+ //}
|
|
|
+ PDFViewer.Document.CheckOwnerPassword(result.Password);
|
|
|
}
|
|
|
|
|
|
DialogParameters value = new DialogParameters();
|
|
@@ -250,10 +252,7 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
{
|
|
|
if (result.Password != null)
|
|
|
{
|
|
|
- string filePath = PDFViewer.Document.FilePath;
|
|
|
- PDFViewer.Document.Release();
|
|
|
- PDFViewer.InitDocument(filePath);
|
|
|
- PDFViewer.Document.UnlockWithPassword(result.Password);
|
|
|
+ PDFViewer.Document.CheckOwnerPassword(result.Password);
|
|
|
}
|
|
|
DialogParameters value = new DialogParameters();
|
|
|
value.Add(ParameterNames.PDFDocument, PDFViewer.Document);
|