Browse Source

compdfkit(win) - 细节问题修复,更新DLL

weixiangjie 1 year ago
parent
commit
80bbb90525

+ 10 - 11
Demo/Examples/Compdfkit_Tools/Common/HomePage/HomePageControl.xaml.cs

@@ -23,14 +23,13 @@ namespace Compdfkit_Tools.PDFControl
     /// </summary>
     public partial class HomePageControl : UserControl
     {
-        private const string DefaultFileName = "TestFile//PDF32000_2008.pdf";
-        private const string AnnotationFileName = "TestFile//ComPDFKit_Annotations_Sample_File.pdf";
-        private const string FormFileName = "TestFile//ComPDFKit_Forms_Sample_File.pdf";
-        private const string SignatureFileName = "TestFile//ComPDFKit_Signatures_Sample_File.pdf";
-        private const string MeasurementFileName = "TestFile//ComPDFKit_Measurement_Sample_File.pdf";
-        private const string SampleFileName = "TestFile//ComPDFKit_Sample_File.pdf";
-        private const string WatermarkFileName = "TestFile//ComPDFKit_Watermark_Sample_File.pdf";
-        private const string PasswordFileName = "TestFile//Password_compdfkit_Security_Sample_File.pdf";
+        private const string AnnotationFileName = @"TestFile\ComPDFKit_Annotations_Sample_File.pdf";
+        private const string FormFileName = @"TestFile\ComPDFKit_Forms_Sample_File.pdf";
+        private const string SignatureFileName = @"TestFile\ComPDFKit_Signatures_Sample_File.pdf";
+        private const string MeasurementFileName = @"TestFile\ComPDFKit_Measurement_Sample_File.pdf";
+        private const string SampleFileName = @"TestFile\ComPDFKit_Sample_File_Windows.pdf";
+        private const string WatermarkFileName = @"TestFile\ComPDFKit_Watermark_Sample_File.pdf";
+        private const string PasswordFileName = @"TestFile\Password_compdfkit_Security_Sample_File.pdf";
 
         private readonly Canvas viewerCanvas = new Canvas();
         private readonly Canvas annotationsCanvas = new Canvas();
@@ -97,7 +96,7 @@ namespace Compdfkit_Tools.PDFControl
             {
                 case "Viewer":
                     {
-                        OpenFileEvent?.Invoke(this, new OpenFileEventArgs(FileOperationType.OpenFileDirectly, DefaultFileName,  e.Feature));
+                        OpenFileEvent?.Invoke(this, new OpenFileEventArgs(FileOperationType.OpenFileDirectly, SampleFileName,  e.Feature));
                         break;
                     }
                 case "Annotations":
@@ -117,12 +116,12 @@ namespace Compdfkit_Tools.PDFControl
                     }
                 case "Document Editor":
                     {
-                        OpenFileEvent?.Invoke(this, new OpenFileEventArgs(FileOperationType.OpenFileDirectly, DefaultFileName , e.Feature));
+                        OpenFileEvent?.Invoke(this, new OpenFileEventArgs(FileOperationType.OpenFileDirectly, SampleFileName , e.Feature));
                         break;
                     }
                 case "Content Editor":
                     {
-                        OpenFileEvent?.Invoke(this, new OpenFileEventArgs(FileOperationType.OpenFileDirectly, DefaultFileName, e.Feature));
+                        OpenFileEvent?.Invoke(this, new OpenFileEventArgs(FileOperationType.OpenFileDirectly, SampleFileName, e.Feature));
                         break;
                     }
                 case "Watermark":

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

@@ -654,8 +654,8 @@ namespace Compdfkit_Tools.PDFControl
                         return;
                     }
                 }
-                e.DoCommand();
             }
+            e?.DoCommand();
         }
         #endregion
 

+ 1 - 1
Demo/Examples/Compdfkit_Tools/DigitalSignature/VerifyDigitalSignatureControl/VerifyDigitalSignatureControl.xaml

@@ -24,6 +24,6 @@
         <local:DigitalSignatureInfoControl x:Name="DigitalSignatureInfoControl" Height="52" Margin="0,30,0,10"></local:DigitalSignatureInfoControl>
         <local:DigitalSignatureValiditySummaaryControl x:Name="DigitalSignatureValiditySummaryControl" Grid.Row="1" Height="239" Margin="0,10,0,10"></local:DigitalSignatureValiditySummaaryControl>
         
-        <Button Grid.Row="3" Height="32" Width="158" HorizontalAlignment="Right" Content="{Binding Converter={StaticResource SigResourceConverter},ConverterParameter=Button_Details}" Margin="12" Click="ViewCertificates_OnClick" FontSize="14" FontFamily="Microsoft YaHei"></Button>
+        <Button Grid.Row="3" Height="32" Padding="5,0,5,0" HorizontalAlignment="Right" Content="{Binding Converter={StaticResource SigResourceConverter},ConverterParameter=Button_Details}" Margin="12" Click="ViewCertificates_OnClick" FontSize="14" FontFamily="Microsoft YaHei"></Button>
     </Grid>
 </Window>

+ 13 - 1
Demo/Examples/Compdfkit_Tools/Form/FormControl/FormControl.xaml.cs

@@ -20,6 +20,7 @@ using System.Windows.Navigation;
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using Compdfkit_Tools.Helper;
+using PasswordBoxPlus.Helper;
 using Path = System.Windows.Shapes.Path;
 
 namespace Compdfkit_Tools.PDFControl
@@ -384,7 +385,18 @@ namespace Compdfkit_Tools.PDFControl
             }
             else
             {
-                e.DoCommand();
+                if (e != null && e.CommandType == CommandType.Copy)
+                {
+                    if (PdfViewControl?.PDFView == null) return;
+                    if (!PdfViewControl.PDFView.Document.GetPermissionsInfo().AllowsCopying)
+                    {
+                        if(!PasswordHelper.UnlockWithOwnerPassword(PdfViewControl.PDFView.Document))
+                        {
+                            return;
+                        }
+                    }
+                }
+                e?.DoCommand();
             }
         }
 

+ 0 - 1
Demo/Examples/PDFViewer/App.xaml.cs

@@ -23,7 +23,6 @@ namespace PDFViewer
     /// </summary>
     public partial class App: Application
     {
-        public static bool DefaultPDFLoaded = false;
         public static string CurrentCulture = Settings.Default.Cultrue;
         public static List<string> SupportedCultureList= new List<string>()
         {

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

@@ -79,20 +79,7 @@ namespace PDFViewer
                     HomePageButton.IsToggled = true;
                 }
             }
-            else
-            {
-                if (App.DefaultPDFLoaded == false)
-                {
-                    LoadDefaultDocument();
-                }
-            }
-            App.DefaultPDFLoaded = true;
-        }
-
-        private void LoadDefaultDocument()
-        {
-            string defaultFilePath = "TestFile//PDF32000_2008.pdf";
-            TabControlLoadDocument(defaultFilePath);
+            HomePageButton.IsToggled = true;
         }
 
         private bool LoadLastOpenedDocuments()

BIN
Demo/Examples/packages/ComPDFKit.NetFramework.1.10.0/build/x64/ComPDFKit.dll


BIN
Demo/Examples/packages/ComPDFKit.NetFramework.1.10.0/build/x86/ComPDFKit.dll