Просмотр исходного кода

compdfkit(win) - 修复save,修复文档信息

liuaoran 1 год назад
Родитель
Сommit
17aa7cb8b5

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFTitleBarControl.xaml

@@ -31,7 +31,7 @@
                         <MenuItem Header="About Us" Style="{StaticResource Sub_MenuItem}" Click="AboutUsItem_Click"></MenuItem>
                         <MenuItem Header="Contact Us" Style="{StaticResource Sub_MenuItem}" Click="ContactUs_Click"></MenuItem>
                         <MenuItem Header="Privacy Agreement" Style="{StaticResource Sub_MenuItem}" Click="PrivacyAgreement_Click"></MenuItem>
-                        <MenuItem Header="ServiceTerms" Style="{StaticResource Sub_MenuItem}" Click="ServiceTerms_Click"></MenuItem>
+                        <MenuItem Header="Service Terms" Style="{StaticResource Sub_MenuItem}" Click="ServiceTerms_Click"></MenuItem>
                     </MenuItem>
                 </Menu>
 

+ 4 - 4
Demo/Examples/Compdfkit_Tools/DigitalSignature/DigitalSignatureControl/DigitalSignatureControl.xaml.cs

@@ -107,11 +107,13 @@ namespace Compdfkit_Tools.PDFControl
 
             PDFViewControl.PDFView.WidgetClickHandler -= PDFView_WidgetClickHandler;
             PDFViewControl.PDFView.WidgetClickHandler += PDFView_WidgetClickHandler;
-
+            PDFViewControl.PDFView.UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
+            PDFViewControl.PDFView.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
             panelState.PropertyChanged -= PanelState_PropertyChanged;
             panelState.PropertyChanged += PanelState_PropertyChanged;
 
         }
+         
 
         private void BotaControlOnDeleteSignatureEvent(object sender, EventArgs e)
         {
@@ -209,8 +211,6 @@ namespace Compdfkit_Tools.PDFControl
             //PDFViewControl.PDFView?.Load();
             PDFViewControl.PDFView?.SetShowLink(true);
             PDFGrid.Child = PDFViewControl;
-            PDFViewControl.PDFView.UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
-            PDFViewControl.PDFView.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
             PDFViewControl.PDFView.SetFormFieldHighlight(true);
         }
 
@@ -322,7 +322,7 @@ namespace Compdfkit_Tools.PDFControl
 
         private void RedoButton_Click(object sender, RoutedEventArgs e)
         {
-            if (PDFViewControl != null && PDFViewControl.PDFView != null && CanUndo)
+            if (PDFViewControl != null && PDFViewControl.PDFView != null && CanRedo)
             {
                 PDFViewControl.PDFView.UndoManager?.Redo();
             }

+ 0 - 2
Demo/Examples/Compdfkit_Tools/Form/FormControl/FormControl.xaml.cs

@@ -310,10 +310,8 @@ namespace Compdfkit_Tools.PDFControl
             newPDFViewer.PDFView.AnnotEditHandler -= PDFView_AnnotEditHandler;
             newPDFViewer.PDFView.AnnotActiveHandler -= PDFView_AnnotActiveHandler;
             newPDFViewer.PDFView.WidgetClickHandler -= PDFView_WidgetClickHandler;
-           //newPDFViewer.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
             PdfViewControl.PDFView.UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
             PdfViewControl.PDFView.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
-            //newPDFViewer.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
             newPDFViewer.PDFView.AnnotEditHandler += PDFView_AnnotEditHandler;
             newPDFViewer.PDFView.AnnotActiveHandler += PDFView_AnnotActiveHandler;
             newPDFViewer.PDFView.WidgetClickHandler += PDFView_WidgetClickHandler;

+ 14 - 1
Demo/Examples/DigitalSignature/MainWindow.xaml.cs

@@ -41,6 +41,8 @@ namespace DigitalSignature
         private SignatureStatusBarControl signatureStatusBarControl = new SignatureStatusBarControl();
 
         private PanelState panelState = PanelState.GetInstance();
+        public event EventHandler<bool> OnCanSaveChanged;
+
 
         public event PropertyChangedEventHandler PropertyChanged;
         protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
@@ -205,9 +207,16 @@ namespace DigitalSignature
             LoadCustomControl();
             pdfViewer.PDFView.ChangeFitMode(FitMode.FitWidth);
             CPDFSaclingControl.InitWithPDFViewer(pdfViewer.PDFView);
+            digitalSignatureControl.OnCanSaveChanged -= DigitalSignatureControl_OnCanSaveChanged;
+            digitalSignatureControl.OnCanSaveChanged += DigitalSignatureControl_OnCanSaveChanged;
             regularViewerControl.IsActive = true;
         }
 
+        private void DigitalSignatureControl_OnCanSaveChanged(object sender, bool e)
+        {
+            this.CanSave = e;
+        }
+
         private void PdfViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
         {
             if (e.Key == "Zoom")
@@ -351,12 +360,16 @@ namespace DigitalSignature
 
         private void PageInfoBtn_Click(object sender, RoutedEventArgs e)
         {
+            PasswordUI.Visibility = Visibility.Collapsed;
+            FileInfoUI.Visibility = Visibility.Visible;
+            FileInfoControl.InitWithPDFViewer(pdfViewer.PDFView);
+            PopupBorder.Visibility = Visibility.Visible;
 
         }
 
         private void FileInfoCloseBtn_Click(object sender, RoutedEventArgs e)
         {
-
+            PopupBorder.Visibility = Visibility.Collapsed;
         }
 
         private void Window_Loaded(object sender, RoutedEventArgs e)