Forum Bugs

Using Prince from within ASP.Net.

ngopalan
I am trying to use Prince from within ASP.Net.

When the application gets to executing the Convert metod, it just hangs.

Any help would be appreciated.

Thanks.

- Nagarajan

_________________


The C# code I am using is

Type objAddType = Type.GetTypeFromProgID("PrinceCom.Prince");

object objAdd = Activator.CreateInstance(objAddType);

object[] myPath = {"C:\\Prince\\engine\\bin\\prince.exe"};
String path = Server.MapPath("include/princexml/brochure.css");
object[] myStylesheet = {path};
object[] myConvertInput = {Server.MapPath("include/princexml/brochure_template.htm"), Server.MapPath("include/princexml/output1.pdf")};

object objPrince;

objPrince = objAddType.InvokeMember("SetPrincePath", BindingFlags.InvokeMethod, null, objAdd, myPath);
objPrince = objAddType.InvokeMember("AddStyleSheet", BindingFlags.InvokeMethod, null, objAdd, myStylesheet);

int objPrinceOutput;
objPrinceOutput = (int)objAddType.InvokeMember("Convert", BindingFlags.InvokeMethod, null, objAdd, myConvertInput);
mikeday
I'm not sure what is causing this hanging problem when Prince is invoked from ASP.NET through the COM interface.

In the future we are planning to release a .NET interface to Prince, that will integrate more easily with ASP.NET and other .NET technologies. Hopefully this will solve any problems that you are experiencing.

Best regards,

Michael