瀏覽代碼

PDF关键词搜索

章政 7 年之前
父節點
當前提交
e2efc59a08

+ 27 - 1
UAS-MES/CustomControl/HeadBar/PDFOperater.Designer.cs

@@ -38,6 +38,9 @@
             this.ScrollSpan = new System.Windows.Forms.ToolStripTextBox();
             this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
             this.ScrollTimer = new System.Windows.Forms.Timer(this.components);
+            this.KeyWord_label = new System.Windows.Forms.ToolStripLabel();
+            this.KeyWord = new System.Windows.Forms.ToolStripTextBox();
+            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
             this.toolStrip1.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -51,7 +54,10 @@
             this.toolStripSeparator1,
             this.ScrollSpan_label,
             this.ScrollSpan,
-            this.toolStripLabel2});
+            this.toolStripLabel2,
+            this.toolStripSeparator2,
+            this.KeyWord_label,
+            this.KeyWord});
             this.toolStrip1.Location = new System.Drawing.Point(0, 0);
             this.toolStrip1.Name = "toolStrip1";
             this.toolStrip1.Size = new System.Drawing.Size(598, 30);
@@ -105,6 +111,23 @@
             // 
             this.ScrollTimer.Tick += new System.EventHandler(this.ScrollTimer_Tick);
             // 
+            // KeyWord_label
+            // 
+            this.KeyWord_label.Name = "KeyWord_label";
+            this.KeyWord_label.Size = new System.Drawing.Size(68, 27);
+            this.KeyWord_label.Text = "关键词搜索";
+            // 
+            // KeyWord
+            // 
+            this.KeyWord.Name = "KeyWord";
+            this.KeyWord.Size = new System.Drawing.Size(100, 30);
+            this.KeyWord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.toolStripTextBox1_KeyDown);
+            // 
+            // toolStripSeparator2
+            // 
+            this.toolStripSeparator2.Name = "toolStripSeparator2";
+            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 30);
+            // 
             // PDFOperater
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -132,5 +155,8 @@
         private System.Windows.Forms.ToolStripLabel toolStripLabel1;
         private System.Windows.Forms.Timer ScrollTimer;
         private System.Windows.Forms.ToolStripLabel toolStripLabel2;
+        private System.Windows.Forms.ToolStripLabel KeyWord_label;
+        private System.Windows.Forms.ToolStripTextBox KeyWord;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
     }
 }

+ 9 - 0
UAS-MES/CustomControl/HeadBar/PDFOperater.cs

@@ -8,6 +8,7 @@ using System.Text;
 using System.Windows.Forms;
 using O2S.Components.PDFView4NET;
 using UAS_MES.PublicMethod;
+using O2S.Components.PDFView4NET.Text;
 
 namespace UAS_MES.CustomControl
 {
@@ -76,5 +77,13 @@ namespace UAS_MES.CustomControl
                 PageView1.GoToNextPage();
             }
         }
+
+        private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                PageView1.SearchText(KeyWord.Text, PDFHighlightSearchResultsMode.AllResults);
+            }
+        }
     }
 }

+ 1 - 0
UAS-MES/FunctionCode/Query/Query_ShowPDF.Designer.cs

@@ -42,6 +42,7 @@
             this.PageView.AutoScroll = true;
             this.PageView.BackColor = System.Drawing.SystemColors.Window;
             this.PageView.DefaultEllipseAnnotationBorderWidth = 1D;
+            this.PageView.DefaultHighlightAnnotationColor = System.Drawing.Color.OliveDrab;
             this.PageView.DefaultInkAnnotationWidth = 1D;
             this.PageView.DefaultRectangleAnnotationBorderWidth = 1D;
             this.PageView.Document = this.PDFDocument;