user2980207
user2980207

Reputation: 293

C# Opening PDF File in Windows 10 causing Adobe to hang up

I have a C# program, and after generating a PDF file, it opens it for viewing. The generation works fine on both Win7 and Win10. The opening for viewing however, works fine on Win7 but Adobe hangs up on Win10 and the process stays running making the file un-openable until it is ended through the task manager.

Here is the code I am using to run the process.

Process p = new Process();
p.StartInfo = new ProcessStartInfo(filePath+filename+".pdf");
p.Start();

Any solutions on an alternative to opening the PDF so that it wont hang up on Windows 10? I'm thinking that it is possible that norton could be causing this hangup, but unable to verify.

Thanks

Upvotes: 0

Views: 404

Answers (1)

Dave Smash
Dave Smash

Reputation: 3001

You could implement a custom PDF viewer using any of the numerous add-in controls that handle PDFs. I use Telerik's RadPdfViewer, which costs money, but there are probably free ones or open source ones out there. Process.Start() just opens a file in the user's default viewer application - if Norton and Adobe aren't cooperating, there isn't much you can do about it in code short of brushing up your resume and going to work for one of them...

Since it's a PDF, you can also try opening it in a web browser control within your program. I think regular old .Net has a browser control built in that is derived from Internet Explorer.

Upvotes: 1

Related Questions