|
@@ -11,6 +11,7 @@ using System.Windows.Controls;
|
|
|
using System.Windows.Input;
|
|
|
using System.Windows.Media.Imaging;
|
|
|
using Compdfkit_Tools.Annotation.PDFAnnotationPanel.PDFAnnotationUI;
|
|
|
+using Compdfkit_Tools.Common;
|
|
|
using Compdfkit_Tools.Helper;
|
|
|
using Compdfkit_Tools.PDFControl;
|
|
|
using ComPDFKit.DigitalSign;
|
|
@@ -18,6 +19,7 @@ using ComPDFKit.PDFAnnotation.Form;
|
|
|
using ComPDFKitViewer;
|
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
|
using ComPDFKitViewer.PdfViewer;
|
|
|
+using PasswordBoxPlus.Helper;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFView
|
|
|
{
|
|
@@ -239,7 +241,7 @@ namespace Compdfkit_Tools.PDFView
|
|
|
}
|
|
|
else if (e.CommandTarget == TargetType.ImageSelection)
|
|
|
{
|
|
|
- if (PdfViewControl != null && PdfViewControl.PDFView != null && PdfViewControl.PDFView.GetSelectImageCount() > 0)
|
|
|
+ if (PdfViewControl?.PDFView != null && PdfViewControl.PDFView.GetSelectImageCount() > 0)
|
|
|
{
|
|
|
e.Handle = true;
|
|
|
e.PopupMenu = new ContextMenu();
|
|
@@ -381,9 +383,13 @@ namespace Compdfkit_Tools.PDFView
|
|
|
|
|
|
if (e != null && e.CommandType == CommandType.Copy)
|
|
|
{
|
|
|
+ if (PdfViewControl?.PDFView == null) return;
|
|
|
if (!PdfViewControl.PDFView.Document.GetPermissionsInfo().AllowsCopying)
|
|
|
{
|
|
|
- // Unlock
|
|
|
+ if(!PasswordHelper.UnlockWithOwnerPassword(PdfViewControl.PDFView.Document))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
e.DoCommand();
|
|
|
}
|