Im trying to make this plugin run in my ASP project. I´m familiar with C# but never tried an ASP.net project before.
I tried doing everthing exacly like in this blog here:
http://codeutil.wordpress.com/2013/09/16/convert-html-to-pdf/
But Im getting stuck with the following error message: " Constructor on type 'Pechkin.SimplePechkin' not found."
The happens when I call the method to get a instance of the Pechkin : ( This one below)
var pechkin = Factory.Create(new GlobalConfig());
When I debug(F11) that line of code I step into the Pechkin code and the line that returns the error is:
ObjectHandle handle = Activator.CreateInstanceFrom(
Factory.operatingDomain,
location,
typeof(SimplePechkin).FullName,
false,
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance,
null,
new object[] { config },
null,
null,
null);
Taking a look at the SimplePechkin.cs it has a constructor :
/// <summary>
/// Constructs HTML to PDF converter instance from <code>GlobalConfig</code>.
/// </summary>
/// <param name="config">global configuration object</param>
public SimplePechkin(GlobalConfig config)
{
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("T:" + Thread.CurrentThread.Name + " Creating SimplePechkin");
this._globalConfig = config;
Tracer.Trace("T:" + Thread.CurrentThread.Name + " Created global config");
this.IsDisposed = false;
}
I think that error should not be going on, specially because if I run it on a common C# winforms test project it works ok. Maybe is because I´m a noob with ASP.net.
Can you guys please help?
Here is the link to the github Pechkin repository if someone wants to give it a try.
https://github.com/tuespetre/Pechkin
Thank you for reading!
-Roiw