Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Feb 2010
    Posts
    50
    Thanks
    5
    Thanked 1 Time in 1 Post

    edit a word document

    hi every one,
    i am really enjoying my php at the moment.
    but i have hit a problem
    i have a word document that is attached below. and i want to be able to edit it. But the word document needs to have formating page size and margins.

    now the problem with fopen seems to strip the formating off the page. and i have try LOADS of class but no look there.

    can anyone help me with this please.
    all i need the is finishing format to be doc or docx


    thanls alot
    Attached Files Attached Files

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    You can't really edit a real MS Word document.

    There are PHP scripts for editing RTF (rich text font) files, but not MS Word specifically.
    This is what I'm talking about: http://tinymce.moxiecode.com/

    Do you mean an RTF file, or are you specifically talking about MS Word?

  • #3
    New Coder
    Join Date
    Feb 2010
    Posts
    50
    Thanks
    5
    Thanked 1 Time in 1 Post
    actually yes
    a rtf file would work.
    how would i go about creating and editing a rtf file with my correct page size and margins? as i tryed fopen then but it messes up the whole document?
    Last edited by phpcodelearner; 12-18-2010 at 01:27 PM.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    You'll have to use tinymce or fckedit ... two RTF PHP editors for websites.

    To create your own RTF editor would be extremely difficult.

    I have other solutions you may want to look into ... not being sure what
    your website is all about.

    1) WordPress ... use WP as a website CMS -- you would have to redo your site.
    2) Use Google Docs. Have your clients create a free Google Account and use
    the online free Google Docs to form all of their online content. That content can
    be embedded on any website. It's RTF.

  • #5
    New Coder
    Join Date
    Feb 2010
    Posts
    50
    Thanks
    5
    Thanked 1 Time in 1 Post
    all it is, is i want to print a lable.
    so i have wrote a bat file to print word documents.
    so all i need to do is edit the word document (data posted from a form) and then run the bat file with the exec("cmd.exe /c print.bat"); and that will print a lable.

    Though thanks to you i found out that my bat file also prints rtf files.

    so all i need to know is how to edit a word document which you have said is hard.

    so i just need to know how to go about genarating/edit a rtf. which you said is possbale. though i have tried editing rtd file (editing job number and date to relivent infomation) but when i then open that file on word is just displays the data i put in
    eg
    tf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stsh fbi31506\deflang2057\deflangfe2057 hemelang2057 hemelangfe0 hemelangcs0{
    ............................. ongoing

    instead of just
    eg

    job number {post jobnumber}

    thanks for your help seriously
    Last edited by phpcodelearner; 12-18-2010 at 08:32 PM.

  • #6
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Check out PHPDocX. It might be useful to you.


  •  

    Posting Permissions

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