Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
		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();
			}
		}
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 public void SetProgressChangedCallback(IntPtr converter, IntCallback callback)
 {
     NestedToolset.SetProgressChangedCallback(converter, callback);
 }
Ejemplo n.º 7
0
 public void SetFinishedCallback(IntPtr converter, IntCallback callback)
 {
     NestedToolset.SetFinishedCallback(converter, callback);
 }
Ejemplo n.º 8
0
 public void SetProgressChangedCallback(IntPtr converter, IntCallback callback)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 9
0
 public void SetFinishedCallback(IntPtr converter, IntCallback callback)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 12
0
 public static extern void wkhtmltopdf_set_progress_changed_callback(IntPtr converter, [MarshalAs(UnmanagedType.FunctionPtr)] IntCallback callback);
Ejemplo n.º 13
0
 public static extern int wkhtmltopdf_set_finished_callback(IntPtr converter, [MarshalAs(UnmanagedType.FunctionPtr)] IntCallback callback);