private void removePDFControls() { try { foreach (Control p in pnlPDFViewer.Controls) { if (p.GetType() == typeof(AxAcroPDFLib.AxAcroPDF)) { AxAcroPDFLib.AxAcroPDF c = (AxAcroPDFLib.AxAcroPDF)p; c.Visible = false; pnlPDFViewer.Controls.Remove(c); c.Dispose(); } } } catch (Exception ex) { } }
private void Dispose() { if (axAcroPDF1 != null) { axAcroPDF1.Dispose(); axAcroPDF1 = null; } }
private void PageUnloaded(object sender, RoutedEventArgs e) { this.Stage.Children.Remove(host); pdfviewer.Dispose(); pdfviewer = null; host.Dispose(); host = null; }