/// <summary>
        /// Constructs HTML to PDF converter instance from <code>GlobalSettings</code>.
        /// </summary>
        /// <param name="config">global configuration object</param>
        public SimplePechkin()
        {
            this.onErrorDelegate = new StringCallback(this.OnError);
            this.onFinishedDelegate = new IntCallback(this.OnFinished);
            this.onPhaseChangedDelegate = new VoidCallback(this.OnPhaseChanged);
            this.onProgressChangedDelegate = new IntCallback(this.OnProgressChanged);
            this.onWarningDelegate = new StringCallback(this.OnWarning);

            Tracer.Trace(string.Format("T:{0} Created SimplePechkin", Thread.CurrentThread.Name));
        }
		private void SetProgressValue(int value)
		{
			//thread safe call
			if (InvokeRequired)
			{
				IntCallback callback = new IntCallback(SetProgressValue);
				Invoke(callback, new object[] { value });
			}
			else
			{
				progressBar.Value = value;
				Update();
			}
		}
Beispiel #3
0
        /// <summary>
        /// Constructs HTML to PDF converter instance from <code>GlobalConfig</code>.
        /// </summary>
        /// <param name="config">global configuration object</param>
        public SimplePechkin(GlobalConfig config)
        {
            if (_log.IsTraceEnabled)
                _log.Trace("T:" + Thread.CurrentThread.Name + " Creating SimplePechkin");

            // create and STORE delegates to protect them from GC
            _errorCallback = OnError;
            _finishedCallback = OnFinished;
            _phaseChangedCallback = OnPhaseChanged;
            _progressChangedCallback = OnProgressChanged;
            _warningCallback = OnWarning;

            PechkinStatic.InitLib(false);

            _globalConfig = config;

            if (_log.IsTraceEnabled)
                _log.Trace("T:" + Thread.CurrentThread.Name + " Created global config");

            CreateConverter();
        }
Beispiel #4
0
        public static void SetProgressChangedCallback(IntPtr converter, IntCallback callback)
        {
            if (Log.IsTraceEnabled)
            {
                Log.Trace("T:" + Thread.CurrentThread.Name + " Setting progress change callback (wkhtmltopdf_set_progress_changed_callback)");
            }

            PechkinBindings.wkhtmltopdf_set_progress_changed_callback(converter, callback);
        }
Beispiel #5
0
        public static void SetFinishedCallback(IntPtr converter, IntCallback callback)
        {
            if (Log.IsTraceEnabled)
            {
                Log.Trace("T:" + Thread.CurrentThread.Name + " Setting finished callback (wkhtmltopdf_set_finished_callback)");
            }

            PechkinBindings.wkhtmltopdf_set_finished_callback(converter, callback);
        }
 public void SetProgressChangedCallback(IntPtr converter, IntCallback callback)
 {
     NestedToolset.SetProgressChangedCallback(converter, callback);
 }
 public void SetFinishedCallback(IntPtr converter, IntCallback callback)
 {
     NestedToolset.SetFinishedCallback(converter, callback);
 }
Beispiel #8
0
 public void SetProgressChangedCallback(IntPtr converter, IntCallback callback)
 {
     throw new NotImplementedException();
 }
Beispiel #9
0
 public void SetFinishedCallback(IntPtr converter, IntCallback callback)
 {
     throw new NotImplementedException();
 }
Beispiel #10
0
        public void SetProgressChangedCallback(IntPtr converter, IntCallback callback)
        {
            Tracer.Trace("T:" + Thread.CurrentThread.Name + " Setting progress change callback (wkhtmltoimage_set_progress_changed_callback)");

            WkhtmltoxBindings.wkhtmltoimage_set_progress_changed_callback(converter, callback);

            pinnedCallbacks.Register(converter, callback);
        }
Beispiel #11
0
        public void SetFinishedCallback(IntPtr converter, IntCallback callback)
        {
            Tracer.Trace("T:" + Thread.CurrentThread.Name + " Setting finished callback (wkhtmltoimage_set_finished_callback)");

            WkhtmltoxBindings.wkhtmltoimage_set_finished_callback(converter, callback);

            pinnedCallbacks.Register(converter, callback);
        }
Beispiel #12
0
 public static extern void wkhtmltopdf_set_progress_changed_callback(IntPtr converter, [MarshalAs(UnmanagedType.FunctionPtr)] IntCallback callback);
Beispiel #13
0
 public static extern int wkhtmltopdf_set_finished_callback(IntPtr converter, [MarshalAs(UnmanagedType.FunctionPtr)] IntCallback callback);