Word and PDF conversion

I would like to know how to convert Word and PDF files to place them on my website, reading them as they are opened on the computer?

Hi there,

Thanks for your inquiry. Please check the documentation link for sending document to client browser while converting a Word document.

If document already exist then you can use following code snippet for the purpose.

byte[] pdfBytes = File.ReadAllBytes("yourPdfDocument.pdf");
Response.Clear();

//Specify the document type.
Response.ContentType = "application/pdf";

//Other options:
// Response.ContentType = "application/msword"
//Response.ContentType = "text/plain"
//Response.ContentType = "text/html"
//Specify how the document is sent to the browser.

Response.AddHeader("content-disposition", "attachment; filename=test.pdf");

//Another option could be:
//Response.AddHeader "content-disposition","inline; filename=MyDocument.doc";
//Get data bytes from the stream and send it to the response.
Response.BinaryWrite(bytes);
Response.End();

Best Regards,