I try to use Acrobat PDF Reader in a WPF app but I found that WindowsFormsHost is a WinForm Control ...so it could be the source of the issue... I got the message "Cannot convert OphtalBox.PDFReader to Windows.Forms.control" at the indicated line. Thanks
I did a mix of these 2 tutorials :
http://www.screencast.com/t/JXRhGvzvB
http://www.codeproject.com/Articles/380019/Using-Adobe-Reader-in-a-WPF-app
My page to display my usercontrol
public partial class DidactielPage : Window
{
public DidactielPage()
{
InitializeComponent();
var ucPdfReader = new PdfReader("/Resource/Data/DidacticielOphtalBoX.pdf");
this.WindowsFormHost1.Child = ucPdfReader;// the error message shows here
}
}
My userControl Class
public partial class PdfReader : UserControl
{
public PdfReader(string filename)
{
InitializeComponent();
AcroPDF acro = new AcroPDF();
acro.setShowToolbar(false);
acro.setView("FitH");
acro.LoadFile(filename);
acro.src = filename;
acro.setViewScroll("FitH", 0);
}
}