0

How can we convert a doc file into an html and a pdf file using c# in a web application?

I am making a web application and i want to convert a doc file into html and pdf as soon as the user clicks on the desired button

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Neha
  • 39
  • 1
  • 7
  • I found an answer to this and it works perfectly http://stackoverflow.com/questions/607669/how-do-i-convert-word-files-to-pdf-programmatically?s=31dc0f5d-5059-47e5-a0d3-339b39ff94a0#new-answer – Neha Jul 20 '11 at 13:52

1 Answers1

0

If you want to convert a word doc to pure html, you will need to run a function that strips all of the garbage characters from your word document.. you would be recreating your own basic CMS.

If you want to convert a word doc to PDF, you will need to run Microsoft Office on a Microsoft server and it gets quite complex and expensive to buy licences for using Office on the server.

If you want to simply upload a word doc to a server, you can display it online using Google Doc Viewer without any conversion. Here is an short article on how to embed a document on a website. All that is required is a short amount of code:

<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
BumbleB2na
  • 10,723
  • 6
  • 28
  • 30
  • i don't want to embed the document. i want to actually convert it on the fly as soon as the user clicks on html button- an html version of the doc file opens, as soon as user clicks on pdf button- a pdf version of the doc file opens if i save it as save as psf using the word doc and save it in the folder i can open the file using Process.Start("file path") but i don't want to save the file i want to create a new one everytime on runtime – Neha Jul 13 '11 at 15:37
  • could u help me with it? i am new to all this i have no idea how to proceed – Neha Jul 13 '11 at 16:16
  • i have not done it before because it is very complex and gets expensive. – BumbleB2na Jul 13 '11 at 16:26