private void OnProgressChanged(IntPtr converter, int progress) { var tmp = NativeCalls.wkhtmltopdf_progress_string(converter); var str = Marshaler.GetInstance(null).MarshalNativeToManaged(tmp) as string; try { ProgressChanged(this, new EventArgs <int, string>(progress, str)); } catch (Exception ex) { _Log.Error("ProgressChanged event handler failed.", ex); } }