I'm currently attempting to print a document from WPF. I'm using the web browser because it contains an active x control which has the autodesk plugin which I need to view the document.
I'm aware that WPF doesn't directly support web browser but I've just integrated the Windows Forms library for this. I've managed to get the code running and even printing, however the document that prints is blank.
I'm not sure if it could possibly be a conflict between the Windows Forms library and WPF; I'm navigating to the document and only printing once it's loaded with no errors thrown.
Here's the code I'm using:
private void btnPrint_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.WebBrowser w = new System.Windows.Forms.WebBrowser();
Uri uri = new Uri("C:\\BOS-BD-4518-000.dwg.dwf");
w.Navigate(uri);
w.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(w_DocumentCompleted);
}
void w_DocumentCompleted(object sender, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e)
{
System.Windows.Forms.WebBrowser w = (System.Windows.Forms.WebBrowser)sender;
w.Print();
}
One possible hitch could be that the active x control is not being allowed to be load, does anyone know how to force the control to be initialised.
Does anyone have any ideas about how to solve this or another method of printing an autodesk (.dwf) document
Thanks in advance, SumGuy