Convert HTML to DOC with PHP!

Discussion in 'PHP' started by MajHate, Feb 25, 2009.

  1. #1
    Hello Everyone!

    I am working on a project that requires html to be converted to a microsoft word document! I have no idea where to start! Any suggestions?

    Thank You,
    Jason
     
    MajHate, Feb 25, 2009 IP
  2. mystxx

    mystxx Active Member

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #2
    mystxx, Feb 25, 2009 IP
  3. sampathsl

    sampathsl Guest

    Messages:
    861
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can use php header function with a xml stream, this way works but you cannot save images.
     
    sampathsl, Feb 25, 2009 IP
  4. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I've done this, and gotten pretty good results. It was a bit of an undertaking. My clue to you: Save a lot of simple Word documents as "single-file web page" and study the format carefully. The main chore is finding all the images and replacing them with Word's weird image tags, then adding them to your MIME package as separate pieces.
     
    SmallPotatoes, Feb 25, 2009 IP
  5. salahsoftware.com

    salahsoftware.com Peon

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Here is php msword class. You can customize it.

    http: www phpclasses org/browse/package/3553.html

    (i cannot post links so i've removed the . (dot) and //
     
    salahsoftware.com, Feb 26, 2009 IP
  6. shiatsu

    shiatsu Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    The simples way is to call the office object. But you need to have a windows server with php installed and the office suit installed also. Not a very secure solution (in fact not secure at all). But if you're working on a intranet it can be done. Ive done a similar job to export from php erp to a sharepoint server.

    It's messy, dirty and smells bad. Can't it be done with pdf instead?
     
    shiatsu, Feb 26, 2009 IP