Browse Source

ComPDFKit.Demo(win) - 修复密码文档无法搜索问题

youna 8 months ago
parent
commit
b6871f9d6e

+ 1 - 1
Demo/Examples/Compdfkit.Controls/PDFView/PDFSearch/PDFSearchControl/CPDFSearchControl.xaml.cs

@@ -300,7 +300,7 @@ namespace ComPDFKit.Controls.PDFControl
                 
                 keyWord = e;
                 textSearch.TextSearchDocument = pdfView.GetDocument();
-                textSearch.SearchText(e, C_Search_Options.Search_Case_Insensitive);
+                textSearch.SearchText(e, C_Search_Options.Search_Case_Insensitive, ViewControl.Password);
             }
             else if (ReplaceTog.IsChecked == true)
             {

+ 2 - 0
Demo/Examples/Compdfkit.Controls/PDFView/PDFViewControl/PDFViewControl.xaml.cs

@@ -31,6 +31,8 @@ namespace ComPDFKit.Controls.PDFControl
         private CPDFViewerTool viewerTool;
         private CPDFToolManager toolManager;
 
+        public string Password { get; set; } = string.Empty;
+
         public CPDFViewerTool PDFViewTool { get; private set; }
         public CPDFToolManager PDFToolManager { get; private set; }
 

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

@@ -308,7 +308,7 @@ namespace PDFViewer
                     tabItem.IsSelected = true;
                     tabItem.FileName = Path.GetFileName(filePath);
                     tabItem.Tag = filePath;
-
+                    passwordViewer.Password = e;
                     viewPage.SetPDFViewer(passwordViewer);
                     App.OpenedFilePathList.Add(filePath);