How can i Print a Pdf document through programmatically?
i am using the follwing code to print a PDF file.but when i click on print icon directly it starts printing.but i dont want it.
<asp:ImageButton ID="PrintButton" runat="server" ImageUrl="~/images/print-icon.png"
OnClick="PrintButton_Click" ToolTip="Print Document" />
My Cs Code is
protected void PrintButton_Click(object sender, EventArgs e)
{
ProcessStartInfo infoPrint = new ProcessStartInfo();
infoPrint.FileName = Session["filename"].ToString();
infoPrint.Verb = "PrintTo";
infoPrint.CreateNoWindow = true;
infoPrint.WindowStyle = ProcessWindowStyle.Normal;
infoPrint.UseShellExecute = true;
Process printProcess = new Process();
printProcess = Process.Start(infoPrint);
}
i want to open a print dialog box when the user clicks on print icon.if the user clicks on Print Button in Print dialog box then i want to start printing the document. My PDF file is in a folder on the server i want it to be printed through programmatically in asp.net.