Click here to Skip to main content
16,003,693 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I need to print a .docx/.pdf from the project folder.

I tried with the below code but no luck.

ProcessStartInfo info = new ProcessStartInfo(path);
info.Verb = "Print";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(info);


Please suggest me how to proceed.

Thanks&Regards,
Pand.
Posted
Comments
[no name] 10-Feb-14 23:47pm    
How you are selecting the file..?

Refer these links

link1
link2
link3
 
Share this answer
 
You are coding an ASP.NET website which means that your code will run at server side not at the client machine. I guess that you want to print the file to the client printer, right? If so, then that code you have there will not work as again, it'll be executed at the server machine where you'll host your site. If you want to print a file like PDF, doc, etc; then you could do one of the following: #1 Just let the user to open the file and let him/her to print it "manually"; #2 You could display the file in your web page using Google Doc Viewer then print that iframe content by using window.print() javascript code; or #3 there are other tools that can make this happen like this but it's not free, sadly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900