CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    60

    Display word in html..Pls help..

    Hi,
    I am trying to show the content of a word document or a pdf file into my html page. Can someone help me out in doing this.. If there is any code snippet for that can someone share it for me... It should not prompt for open or save, instead it has to show the contents in my web page.. Please help me out.. Thanks in advacne...

  2. #2

    Re: Display word in html..Pls help..

    There are different ways to do this and it depends on two things, one that you can control, one you cannot:

    - You need to make sure you're setting the proper MIME type on the response, ie application/xls, application/pdf, etc.

    - This is the part you can't control directly - the client must have something capable of reading this data, such as a plugin / etc. If they don't have the plugin, the default behavior of a browser is to treat it as binary and save it to disk. The only other option is to actually parse the file and turn it into HTML (ie, what google does with attachments in GMail.) This usually doesn't work too well and has a lot of conversion problems.

  3. #3
    Join Date
    Jul 2005
    Location
    Currently in Mexico City
    Posts
    568

    Re: Display word in html..Pls help..

    HTML Code:
    <meta http-equiv="Content-Type" content="application/msword; charset=iso-8859-1" />
    But if you wanted all the MSWord controls, forget about it. You would need to integrate a js controls for this instead.
    Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?

    I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)

    //always looking for job opportunities in AU/NZ/US/CA/Europe :P
    willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"));

    USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured