public static string GetSelectionAsText(this PreviewControl previewControl) { if (previewControl.GetPdfViewer()?.GetSelectedContentFromType(ContentType.Text) is TextContent textcontent) { return(textcontent.Text); } return(null); }
public static void ClearSelection(this PreviewControl previewControl) { previewControl.GetPdfViewer()?.ClearSelection(); }
public static PDFViewWPF GetPdftronViewer(this PreviewControl previewControl) { var pdfViewControl = previewControl.GetPdfViewer(); return(pdfViewControl.GetType().GetProperty("Viewer", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(pdfViewControl) as PDFViewWPF); }