Printing a dynamically created pdf file from ASP.NET on a client machine
Posted on 2006-11-16
I have an application developed in ASP.NET with code behind of C#
On a page I have a grid view, with a Print button. When the user clicks Print, based on certain variables a pdf document is created on the server.
I need to print this file to the client machine after the print button is clicked
I don't mind opening the print dialog on the client to select a printer to print the content, but I do not want to open Adobe reader.
the pdf file created always has a name with the session id appended, example gkhljwtyhjkl.pdf, so everytime a user logs on it creates a file based on his/her session id, if they click the print button.
Please note two things need to happen within the print click event
1) Creation of a pdf file ---(which I have taken care of)
2) Invoking the printing fnctionality.