Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display PDF or Word's DOC/DOCX inside WinForms window?

I'm wondering what's the best option to display a pdf/doc document inside form in my c# winforms app.

This control should only allow do display preview. Edtiting documents should be forbidden.

I'm looking for free solution.

The best option would be to attach a few separate *.dlls to solution but it's not a requirement.

like image 402
tomo Avatar asked Feb 04 '09 11:02

tomo


2 Answers

I wrote something that can do this for Word Documents by taking advantage of the WebBrowser control for WinForms. Hopefully it might do you some good:

http://codinglight.blogspot.com/2008/10/simple-docbrowser-control.html

like image 142
David Morton Avatar answered Sep 28 '22 15:09

David Morton


Consider using the preview handlers for Vista, Windows 7. I used the code provided by Brad Smith (with corrections from the comments).

http://www.brad-smith.info/blog/archives/79 - Hosting Preview Handlers in Windows Forms Applications

like image 43
ptilton Avatar answered Sep 28 '22 16:09

ptilton