"DOC" probably means obsolete Microsoft Word document (present-days format is Open XML, files are named *.docx), and PDF is PDF. Even though PDF is the standard, it's not a part of W3 standards, so not all systems/browsers support it, and those supporting the standard may use some plug-ins which some user may not want to install (I personally use the PDF viewer not supported by browser, cannot view those documents on the Web pages and don't care a bit about it). So, you should never assume that all users will view PDFs in a browser. I don't think this is a problem though. And forget about proprietary Word documents.
Nevertheless, Word documents are also often supported by Web sites. In some areas this is even very typical (one example is job hunting sites). The secret is simple: the documents are supported internally, only on server side. Viewing and edition of the documents are always presented through HTML which mimics Word document look and styling, with some degree of similarity.
For parsing Word document, you would need to use Microsoft Open XML file format. You can always learn the formats, as they are standardized. Please see:
http://en.wikipedia.org/wiki/Office_Open_XML[
^],
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[
^],
http://en.wikipedia.org/wiki/Office_Open_XML_file_formats[
^].
(Don't mix them up with OpenDocument,
http://en.wikipedia.org/wiki/OpenDocument[
^].)
Now, there is another approach to it. There are third-party products working with Microsoft Office document. If they can do it, you can, too. You just need to download source code of some open-source products and find out how it works. The only open-source code I know is OpenOffice itself (where .odt came from) and its
fork LibreOffice. Please see:
http://en.wikipedia.org/wiki/OpenOffice.org[
^],
http://www.openoffice.org/[
^],
http://en.wikipedia.org/wiki/LibreOffice[
^],
http://www.libreoffice.org/[
^].
You can download the source and find the code working with nearly all versions of Office documents. And, of course, .ODT and all other OpenOffice/LibreOffice documents.
It is not recommended to use Office Interop assemblies on the server side. Please see these Microsoft articles:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[
^],
http://support.microsoft.com/kb/257757/en-us[
^].
Instead, Microsoft Open XML SDK is recommended:
Alternatively, you can use Open XML SDK:
http://www.microsoft.com/en-us/download/details.aspx?id=30425[
^].
This way, you can support new XML-based Office formats (such as .DOCX, .XLSX), ECMA-376 standard.
And this is another approach:
http://npoi.codeplex.com[
^].
Please also see my past answers:
Convert Office-Documents to PDF without interop[
^],
Hi how can i display word file in windows application using c#.net[
^].
—SA