string filename = Guid.NewGuid() + ".pdf"; //unique file name
// url of the pdf file name
string url = < Server Url > +"/CutyCapt/" + filename;
StringBuilder sb = new StringBuilder();
//location of Executable
string cutycaptLocation = "D:\\CutyCapt";
// Command for execution
System.Diagnostics.ProcessStartInfo pi = new System.Diagnostics.ProcessStartInfo();
pi.CreateNoWindow = false;
pi.WorkingDirectory = cutycaptLocation;
pi.FileName = cutycaptLocation + "\\CutyCapt.exe";
pi.Arguments = "--url=" + link + " --out-format=pdf --out=" + System.IO.Path.GetFullPath(Server.MapPath("~/CutyCapt")) + "\\" + filename;
pi.UseShellExecute = false;
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using(System.Diagnostics.Process exeProcess = System.Diagnostics.Process.Start(pi))
{
exeProcess.WaitForExit();
}
} catch (Exception ex)
{
Response.Write(ex.Message);
}
Response.Redirect(url);This Code Snippet for Create PDf of webpage using CutyCapt.exe.
