C# 在winform webbrowser中获取PDF文件的选定文本

C# 在winform webbrowser中获取PDF文件的选定文本,c#,winforms,pdf,C#,Winforms,Pdf,我正在尝试获取已在Webbrowser控件(c#winform)中显示的pdf文档的选定行 这是我的密码 IHTMLDocument2 htmlDocument = webBrowser1.Document.DomDocument as IHTMLDocument2; IHTMLSelectionObject currentSelection = htmlDocument.selection; if (currentSelection != n

我正在尝试获取已在Webbrowser控件(c#winform)中显示的pdf文档的选定行

这是我的密码

IHTMLDocument2 htmlDocument = webBrowser1.Document.DomDocument as IHTMLDocument2;

            IHTMLSelectionObject currentSelection = htmlDocument.selection;

            if (currentSelection != null)
            {
                IHTMLTxtRange range = currentSelection.createRange() as IHTMLTxtRange;

                if (range != null)
                {
                    MessageBox.Show(range.text);
                }
            }
我得到以下输出

它似乎不起作用,因为我收到一个空的消息框。我必须在线知道,为了编辑/突出显示文本,我可能必须使用SDK

我真的非常感谢这里的任何帮助/指导