Slashdot Mirror


Sanely Moving from Word to the Web?

FooAtWFU asks: "I have a job for a web site (no link for you, Slashdot hordes!). A lot of it is systems administration and development, but I have to routinely post content which comes from a myriad of other sources. Usually they are from academic users, come in Word format, and ultimately need to be posted in HTML. The problem is that Word has all sorts of tricks up its sleeve to throw off the font, layout, size, and so forth. To achieve any sort of visual consistency on the site these various formatting tags all need to be scrubbed, but even using other office suites with better HTML export (OpenOffice.Org) to do the dirty work, it's often easier to recreate the formatting by hand from a plain-text version than it is to clean up a sea of messy tags. Does anyone have any advice (or magical tools) to help me deal with this sort of tedious cleanup?"

83 of 547 comments (clear)

  1. Scrapping by fembots · · Score: 5, Interesting

    Interestingly, I have a similar job on a website (no link for you too, Slashdot hordes!), here's what I do (I'm sure there are smarter ways):

    1. Place all "to-process" documents in a specific folder in a webserver
    2. Write a script to read those documents
    3. Use Regex (and similar functions) to strip off and/or replace specific tags/wordings (similar to web scrapping technique).

    Admittedly it was a tedious job at first to identify every possible template, however I'm amazed how predictable some documents are and once you get hold of such "blueprint", you can reformat documents to HTML/XML fairly easily.

    Once the changes are done, I then preview them in a browser, and if everything's expected, I simply save the page and use it; If not, it's easy enough to make a few tweaks from the familar HTML environment.

    1. Re:Scrapping by dougmc · · Score: 2, Insightful
      Use Regex (and similar functions) to strip off and/or replace specific tags/wordings (similar to web scrapping technique).
      Of course, you really can't properly parse html just using regular expressions. You can get it right 90% of the time relatively quickly, and a day or so work will get you 5% more, but you could spend weeks trying to get that last 5% -- and never quite get it.

      It's really better to use things that other people have made for parsing html. For example, if you use perl (and you should -- it's the ideal tool for this), HTML::Parser works pretty well, though there's a signifigant learning curve in using it.

    2. Re:Scrapping by cloudmaster · · Score: 2, Informative

      For simplifying documents, I've found HTML::TreeBuilder to be a handy module. Then you just have to write code to simplify HTML (throw away useless tags, merge adjacent tags, etc), rather than worrying about reformatting word docs.

    3. Re:Scrapping by Daengbo · · Score: 2, Interesting

      Or, you could convert all those Word docs to Writer and use Ant like this guy did to xsl transform the xml into a website. I discovered this website because I'm starting to write a CMS in PHP5 which automatically adds content from OO.o documents.

      Alternately, you could use Writer2Latex to generate XHTML 1.0 strict for yourself.

      Those two methods seem the easiest.

  2. PDF? by Anonymous Coward · · Score: 2, Insightful

    How about Word -> PDF -> HTML?

    Just a thought ... and probably a dumb one.

    1. Re:PDF? by cloudmaster · · Score: 2, Funny

      I hate you and your kind. Yes, hate. :)

    2. Re:PDF? by ImaLamer · · Score: 2, Interesting

      "Print to PDF" seems to be the function that would solve all of these problems, but so would any others. Think you *could* print to a TIFF, PDF, virtually any image type with a *nix Word compatible program - then you can scan the image and OCR it to plain text. Antiword (mentioned by another /.er: http://www.winfield.demon.nl/) can convert DOC to plain text... there are thousands of options.

      However, if someone is getting the idea for another open source project to solve this dilema then I'd suggest something that can render DOC to HTML on the server side. That would allow those who just know how to "setup" a webserver to sit back and let the software deal with people's problem with not using standard types. Parse the Word, Wordperfect, OpenOffice, RTF, whatever and render it in HTML. This would allow anyone in a company dump the document on the server/share and let it be viewed by anyone else.

      But there are limitless options like this http://www.doc-api.com/ found on google...

    3. Re:PDF? by FooAtWFU · · Score: 2, Informative

      Not quite what I'm looking for. Maybe I should clarify: I want to remove the nonessential formatting, while keep certain niceties (in particular, italics for the names of papers they reference, hyperlinks for footnotes, etc) and convert the rest into something simple and plain with just-the-basics of HTML, so I can then style it to match the other pages on the site. Many of these documents go to collections: encyclopedia articles, book reviews, abstracts of papers. If they don't look consistant, then people do complain. (And my site has enough formatting-consistency issues as it is ;)

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    4. Re:PDF? by FooAtWFU · · Score: 2, Insightful

      The people we're dealing with here are not social sciences people, specifically economics. I'd be perfectly fine with taking DocBook or TeX documents- but nobody's going to send them. It's not happening. We accept Word documents because we have ALWAYS accepted Word documents and most countributors probably aren't even aware that something like TeX or Docbook even exists, let alone how to use it. And they're not willing to learn it just to send us stuff.

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    5. Re:PDF? by anthony_dipierro · · Score: 2, Insightful

      Do you really think the extra bandwidth costs would be more than the cost of his salary while coming up with a better solution?

  3. PDF? by night_flyer · · Score: 2, Insightful

    you can either hot link to the .doc themselves in a new window or convert to .pdf and do the same thing

    --


    Thanks to file sharing, I purchase more CDs
    Thanks to the RIAA, I buy them used...
  4. Use antiword by shura57 · · Score: 2, Informative

    It takes Word file and spits out plain text. It can also do some more tricks.

    1. Re:Use antiword by cloudmaster · · Score: 2, Informative

      He's obviously got access to Word, and saving as text in Word at least preserves most of the whitespace-based formatting. IIRC, antiword is mostly useful as a last-ditch effort to read a word doc, a step above piping the doc through "strings". :)

  5. Dreamweaver by necro2607 · · Score: 5, Informative

    I would suggest using Macromedia Dreamweaver... it's what we use where I work and essentially all of our content entry involves pasting in content from Word documents supplied by clients. Dreamweaver is pretty good for formatting and working with stylesheets.

    1. Re:Dreamweaver by fean · · Score: 5, Informative

      in Dreamweaver, there's a command "Clean up MS Word HTML". Its made to clean up Word's crappy html, and does a pretty nice job of it.

    2. Re:Dreamweaver by drmike0099 · · Score: 3, Funny

      The OP is correct: 1) Open Dreamweaver. 2) Commands > Clean Up Word HTML... 3) Rejoice

    3. Re:Dreamweaver by ozbon · · Score: 2, Informative

      Yeah, I found that the "clean up word docs" did about 80% of the work, and then it was just a matter of a buttload of search/replace stuff in order to get it to finish the rest.

      Worked pretty well, once I'd got the search/replace stuff sussed out.

      Mind you, on a big word file you can think it's crashed when actually it's just doing lots of thinking...

      --
      I say we take off and nuke it from orbit. It's the only way to be sure...
    4. Re:Dreamweaver by necro2607 · · Score: 2, Insightful

      We use Dreamweaver exclusively for HTML/CSS programming and it doesn't create code that doesn't work - in fact the code it creates is very very compatible: I've never had to manually tweak code to obtain proper design and layout with the sites I've built.

      Indeed we'd love to move to advanced CSS for page formatting but that's a big step right now - there are no professional WYSIWYG editors that have the sheer range and quality of features we need - Page templates, ability for clients to update the site later in a very convenient WYSIWYG interface, high compatability with ultra-common web media such as Flash, etc. etc...

      Trust me we're keeping our eyes peeled for a better solution but right now Dreamweaver is the best available. Sometimes simply sticking to "standards" isn't neccesarily the best idea. In fact, sticking to proper standards creates sites that differ in appearance from browser to browser. Dreamweaver has very impressive awareness of inconsistencies and standards-deviation in many browsers.

    5. Re:Dreamweaver by Anonymous Coward · · Score: 5, Informative

      Also note that you have the ability to cut and paste formatted text from Word into the 'Design View' within dreamweaver and DW will automatically reformat the incoming text appropriately. In my brief test to make sure i wasnt talking out my a** i found it even supports word tables properly.
      If you paste text into the Code view, DW removes the formatting completely and just uses the raw text.

    6. Re:Dreamweaver by kderby2000 · · Score: 2, Informative

      Macromedia Contribute might be a better tool. It's (basically) a web browser, where you surf to a page, hit "edit", make your changes, and it posts back to the site. You can also upload Word & Excel. A site can also be set up to honor style sheets, Dreamweaver templates, etc.

    7. Re:Dreamweaver by KevinH456 · · Score: 2, Informative

      Dreamweaver MX 2004 goes one step farther and allows you to copy and paste word documents INCLUDING clip art and drawn images and graphs. It will automatically take all that and make it decent markup. It even picks up formatting. It strips all the word specific crap for you and then you can just format it as you like (using a stylesheet of course to make your life so much easier). From here you have nice html you can import into a CMS or code you can insert in your HTML template.

      We do this where I work. My job involves taking hundreds of word documents from professors and formatting them for online coursework at a major university in florida. Dreamweaver has made my life so much easier.

      --
      All sigs are created equal.
  6. Antiword by alanp · · Score: 3, Informative

    Try antiword, it's got a real decent HTML option.

    --

    Alanp

  7. Sounds like you should release on sourceforge by arete · · Score: 5, Interesting

    So if there's only a few templates and they were a pain to work out, how about releasing your regex scripts to sourceforge or similar? Or posting here?

    --
    Looking for freelance Actionscript (Flash/Flex) or ColdFusion work and/or freelance developers. Email me, put Slashdot
    1. Re:Sounds like you should release on sourceforge by Anonymous Coward · · Score: 3, Insightful

      Since they were produced at work, the copyright on them is probably owned by the company and not by him.

      Plus the templates are probably in-house templates and thus would be useless outside of the company.

    2. Re:Sounds like you should release on sourceforge by extrasolar · · Score: 2, Funny

      See, if we were really elite, we would all automatically know how to do stuff like this with our favorite editor. There would be no Ask Slashdot. There's a reason why emacs is one of the most popular editors around and it's because it saves us from having to do this kind of repetative text work that should be done autonomously.

      But we're not elite and I'm now going to learn how to do macros in emacs :)

  8. Textism by NoInfo · · Score: 4, Informative

    Here's a tool I saw linked off of O'Reilly Radar once:

    http://textism.com/wordcleaner/

    I used it once and it did a pretty decent job at preserving the tables. Yet if they're using anything odd like graphics or it's been incredibly tweaked, it probably won't be 100% perfect.

    1. Re:Textism by e**(i+pi)-1 · · Score: 3, Informative

      a standalone Perl script, I use daily is demoronizer.

    2. Re:Textism by bjdevil66 · · Score: 2, Informative

      Textism looked pretty cool, so I tried it out with a typical .htm export (67K). However, it requires a subscription (Paypal payment) to process files larger than 20K. In my experience many .htm files pumped out by MS Office are larger than 20K, so I imagine the submitter may want to look elsewhere...

      With that said, if the people that have assigned the submitter with the web work want their employee to have the tools they need to do quality web work, they should pay for quality tools so the submitter can get the job done.

      Side note: The Dreamweaver "Command..." option suggested below just worked great on the same file.

    3. Re:Textism by deepestblue · · Score: 2, Informative

      The demoronizer is b0rk3n. See http://www.unicode.org/faq/unicode_web.html#2

  9. One suggestion by Da+Fokka · · Score: 3, Funny

    You might consider a pack of monkeys and typewriters. They can ultimately reproduce Shakespeare so maybe, maybe they might be ablt to properly reformat the HTML gibberish Word produces.

    Of course, you could also outsource to India but that's unethical to both the monkeys and the Americon economy.

    1. Re:One suggestion by Anonymous Coward · · Score: 3, Funny

      It's hard to find qualified monkeys - most of them already have jobs editing /. and cnn.com...

  10. One Word... by ScentCone · · Score: 5, Funny

    ..."Intern"

    --
    Don't disappoint your bird dog. Go to the range.
    1. Re:One Word... by Cerdic · · Score: 5, Funny

      No, no, no...

      Usually they are from academic users

      It sounds like this might be a university environment. The correct answer should be grad students .

      --
      Advice for my fellow geeks: before seeking out that threesome you dream of, you might see what a TWOsome is like first.
  11. Re:hi by Anonymous Coward · · Score: 2, Funny

    hello. how are you?

  12. HTML Export by electroniceric · · Score: 2, Informative

    If you're using Office 2000, you can find the HTML filter here:

    http://www.microsoft.com/downloads/details.aspx?Fa milyID=209ADBEE-3FBD-482C-83B0-96FB79B74DED&displa ylang=EN

    I believe this functionality is built into later versions of Word.

    Per the site, this produces simpler HTML with Office-specific tags removed. With that done, you could probably use a PERL script, and you might also try writing some Word macros or COM/VBA scripts that clean up the document from within Word.

    1. Re:HTML Export by Marxist+Hacker+42 · · Score: 4, Informative

      Whew- I hoped I didn't have to post this 40 comments down in the thread. Yes, Office 2000 has the above tool- and Office 2002 or 2003 has it on the Save As menu. The option you want is "Web Page (filtered)|*.html". I saw an interview once with somebody on the Word development team, and he claimed that the original Save As HTML was built for passing Word Documents over the web- and never meant to be read by human beings as a web page at all. Web Page (filtered) cuts out all the extra shyte that Save As HTML used to put in for managing version controled updates and changing the font every bloody character- and builds a real web page.

      --
      SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
  13. Dreamweaver by SlashChick · · Score: 4, Informative

    Check out Commands -> Clean Up Word HTML in Dreamweaver. it does a nice job of getting rid of extraneous tags. While you're at it, take a look at Commands -> Apply Source Formatting as well. This can be customized to your specifications in the preferences section, and automatically tabs out, adds newlines, and converts tags to lowercase where appropriate in the HTML document. Dreamweaver is the closest thing I know of to a program that "automatically" cleans up Word HTML.

    Good luck!

  14. HTML Tidy by N8F8 · · Score: 5, Informative

    Save the Word document as filtered HTML and pipe the HTML through HTML Tidy. Nice clean HTML.

    --
    "God fights on the side with the best artillery." - Napoleon, Marshal of France - speaking truth to power
  15. no link for you, Slashdot hordes! by SeanTobin · · Score: 5, Informative

    Hmmm... sounds like a challenge to me. Let's see what we can dig up.

    Step 1: Let's look at his user page

    Ahh! He put in a website with his profile. Let's all go and check out http://fennec.homedns.org/

    Hmm... looks like a personal page. Not too sure what to make of the comic. Anyway, let's move on to..

    Step 2: Let's look at his author page. Some interesting stuff here, including three separate e-mail addresses (which I won't post here. You're welcome :)

    A-ha! There is a link to his employer! It's Economic History Services. And what do you know... there are a significant number of pages (especially under abstracts and book reviews) that seem to come straight out of a word processor, only with extensive cleaning. A quick look at the source reveals something interesting. It's clean. Very clean. We're talking on the level of I-use-vim-for-my-webpage-editor clean. Nice job.

    Anyway, it looks like it was done by hand. I'm not saying its not good work (quite to the contrary), but I can see your need for an automated solution.

    --
    Karma: SELECT `karma` FROM `users` WHERE `userid`=138474;
    1. Re:no link for you, Slashdot hordes! by Dunbal · · Score: 5, Funny

      Which only goes to show:

            There is NO WAY the slashdot effect can be avoided. Resistance is futile...

      --
      Seven puppies were harmed during the making of this post.
    2. Re:no link for you, Slashdot hordes! by slo_learner · · Score: 2, Funny

      I can understand why you would hunt this information down for your own demented purient interest, but why did you have to post it?

      Didn't he clearly state that he didn't want to be slashdotted? This just seems like a perfect opportunity for the application of a little common sense along with just a hint of courtesy.

    3. Re:no link for you, Slashdot hordes! by FooAtWFU · · Score: 3, Informative

      My SSH connection to my server still lives; I think my task was accomplished well enough. :)

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    4. Re:no link for you, Slashdot hordes! by FooAtWFU · · Score: 2, Interesting

      actually, I'm quite all right. At first I was a trifle worried when I saw that my machine's load was a little high and the story relatively new, but then I realized that it was just running pisg to generate channel statistics for #wikipedia. It's a beefy server on a fast line, really; I don't anticipate any issues if I can hide way down in the comments page instead of in the fine summary...

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    5. Re:no link for you, Slashdot hordes! by jalefkowit · · Score: 4, Funny
      This just seems like a perfect opportunity for the application of a little common sense along with just a hint of courtesy.

      You must be new here.

  16. HTML Tidy by John_Booty · · Score: 2, Informative

    HTML Tidy has a special mode for cleaning up Word's crappy HTML export. HTML Tidy is a free command-line tool that is also embedded in a lot of popular HTML editors.

    HTML Tidy:
    http://tidy.sourceforge.net/
    HTML Kit (great integration with HTML Tidy; it includes HTML Tidy so you can just grab HTML Kit without grabbing HTML Tidy)
    http://www.chami.com/html-kit/

    Countless other editors integrate with HTML Tidy as well. Have fun and good luck!

    --

    OtakuBooty.com: Smart, funny, sexy nerds.
  17. Re:hi by Anonymous Coward · · Score: 2, Funny

    I'm fine thank you

  18. Tidy Flags by N8F8 · · Score: 5, Informative

    Almost forgot. The Tidy Docs will tell you to select "--bare" and "--word-2000" and I also recommend "--output-xhtml" and "--indent".

    --
    "God fights on the side with the best artillery." - Napoleon, Marshal of France - speaking truth to power
    1. Re:Tidy Flags by Bogtha · · Score: 2, Informative

      I also recommend "--output-xhtml"

      Why? XHTML isn't any better than HTML 4.01 for almost anybody, and it's less compatible.

      --
      Bogtha Bogtha Bogtha
  19. Get it in PDF first. by frostman · · Score: 2, Interesting

    I'm assuming you have the right to republish the Word documents. I'm also assuming you have no control over how many Word-specific formatting features are used by the authors.

    What I would do in your shoes is set up a (mostly) automated system to convert the Word files to PDF. You can buy Acrobat or you can go with a third-party, printer-driver-style converter, but in the end you'll probably save more headaches just using Acrobat.

    Once you have a document in PDF, you can use any of the numerous (free and commercial) tools to convert that to HTML, text, whatever - all much more reliably than from Word directly. It's not perfect, but it's probably the closest you'll get.

    Plus, you can post the PDFs themselves for download in case someone wants them - and at least Google will still happily index your PDFs.

    Yes, you'll probably have to live with some NT variant to get that part done (though it might work with OSX) - but it's most likely your fastest path to *quality* conversions.

    --

    This Like That - fun with words!

  20. Resign from your executive position by Fastball · · Score: 2, Interesting

    What is it with executives and directors and their fixation with sending simple memos and messages via Word attachments in e-mails? Everybody else is on board with plain text (except some folks who are smitten with font coloring). Why can't the dolts at the top of the totem pole type in their mail client's editor and hit "Send?"

    1. Re:Resign from your executive position by dougmc · · Score: 4, Insightful
      Everybody else is on board with plain text
      I don't know where you live/work, but out here in the real world, not everybody is on board with plain text. Not anymore.

      I use mutt and fetchmail in a company of Exchange users. Almost every email I get at work now, from everybody, is in html. (Unless I sent it to myself.) I don't like it, but I deal with it. It's certainly easier to deal with it than to try and change everybody else.

      I could change jobs, but over something as trivial as html emails? No. I like my job, I like the people I work with, so I just bend like the reed in the wind ...

      Still, the executives are certainly worse about email ettiquette than most, and it's not just in this company -- everywhere I've worked I've found this to be the case. They don't include Subjects at all, or include useless ones like `message'. Some will type up a memo and send it as a .pdf file attachment, or worse as a .bmp file. They rarely trim anything when responding to a post -- they just top post away. (But many people do that ...)

    2. Re:Resign from your executive position by VGR · · Score: 5, Funny

      You think that's bad?

      I was given 61 screenshots (blithely dubbed "program requirements"), each its own Word document. Each containing only a (weirdly scaled) picture, of course.

      61 Word documents.

      --
      The Internet is full. Go away.
    3. Re:Resign from your executive position by Detritus · · Score: 2, Funny

      Because it isn't a "real memo" unless it is printed on company letterhead, formatted according to the company's style guide.

      --
      Mea navis aericumbens anguillis abundat
    4. Re:Resign from your executive position by Larry+Lightbulb · · Score: 2, Funny

      You get specs? And you're complaining?

    5. Re:Resign from your executive position by advocate_one · · Score: 2, Insightful
      because Microsoft put that "Oh, so convenient", send as email entry in the File menu of ms-word.... that's why... then the top of the totem pole dunderheads don't have to go to the trouble of firing up their email client and creating a message and then finding the file to attach it...

      and as another poster has suggested, perhaps it's the quality department to blame as a memo or whatever, isn't a real memo or whatever unless it has been created with the official approved template...

      --
      Donald 'Duck' Dunn: We had a band powerful enough to turn goat piss into gasoline.
    6. Re:Resign from your executive position by khakipuce · · Score: 2, Insightful
      I use mutt and fetchmail in a company of Exchange users
      isn't exactly "bending like a reed in the wind" -using a graphical mail client would be.

      Why do you use mutt and fetchmail? Why? Why? Why? Just about everywhere I have worked it has been easier (and often there is no choice) to just use what they use rather than trying to be clever or different. It is good to gain wide experience and it is good to have the flexibility to use the tools at hand.

      --
      Art is the mathematics of emotion
  21. Re:Change the Model? by danheskett · · Score: 2, Interesting

    That's the best way. Really. You want the data to be in a structured format. Semantically structured if possible, but at least structured. Define a bunch of templates. Use a templating system like smarty or whatever to make it happen. Give your users a simple form - HTML, Windows, Java, whatever, that selects a template and reads in a list of fields from the template. Dynamically generate the form fields to be filled based on the template. Store the data. To generate a page start from the master record - be it in a database, an xml file, or whatever. Load the template and fill the data from the relational store. If you do it right you can even substitute different rendering layers and get an X/HTML version, a Word version, and a PDF version without any real substantial work. This also helps (1) create consistent documents, (2) create documents for more than one target format, (3) create searchable content with rich meta-data and (4) move to a more robust system later without tons of extra work. I've done it before, and if you spend a week engineering the solution properly it'll last years.

  22. Re:hi by Anonymous Coward · · Score: 2, Funny

    I'm fine too.

    I'm glad we have these little discussions. It makes my day so much more interesting.

    Let's do lunch.

  23. fckeditor by mixmasterjake · · Score: 2, Informative

    fckeditor is an in-browser WSYWIG. It has a "Paste from MS Word" button that actually strips out a lot of the unecessary baggage. I don't know how well it handles embedded images or tricky layouts, but for the basic stuff it works well.

    The interface is similar to Word - maybe if you're lucky, you could get some of your content producers to use it.

    --
    TODO: come up with a clever sig
  24. HTML Tidy program by Todd+Knarr · · Score: 4, Informative

    One program I've had luck with is the HTML Tidy program at http://www.w3.org/People/Raggett/tidy/. It seems to clean up code (particularly from Word) quite a bit.

  25. WordML - FO - XHTML/PDF by room101 · · Score: 4, Informative

    Using a modern version of Word, output in WordML (xml format). Use a XSL stylesheet to convert the WordML to FO (formatting objects).

    From there, do anything you want, like XHTML or PDF.

    Or just go to XHTML from WordML with some stylesheet. XSL is teh cool!

    --
    room101 -- how much can you stand before they break you?
    (they always break you eventually)
  26. Recreating formatting? by RoadWarriorX · · Score: 2, Insightful

    To achieve any sort of visual consistency on the site these various formatting tags all need to be scrubbed, but even using other office suites with better HTML export (OpenOffice.Org) to do the dirty work, it's often easier to recreate the formatting by hand from a plain-text version than it is to clean up a sea of messy tags.

    The problem with conversion of documents to HTML in general is the expectation that the formatting needs to be preserved. There have been times where I needed to "post" a document to a web site, and I always try to get the author(s) to not worry about formatting. Formatted documents are pure evil simply because 9 times out of 10 it does not affect the relevant information that you are trying to convey to your audience. Sometimes, the authors give me grief about it, but I simply show them the possibilities of separating the content and presentation during the translation. I convert their documents to generic HTML (with whatever tools are available) and use CSS to apply relevant formatting for the type of document (a report, article, thesis, or whatever). No funky font tags, or weird tables. Just the let the HTML flows as it's meant to be.

  27. Net-It is your magical tool by netringer · · Score: 3, Informative

    Net-It Central is the magical tool you were looking for. With that you can just point it at the file share with the Word Documents (and Excel and Power Point...) on it and see them indexed and cross linked on web pages. It'll update the content as the source docs change.

    Oh, you mean non-commercial magical tools?

    --
    Ever dream you could fly? Get up from the Flight Sim. I Fly
  28. Amen by Quadraginta · · Score: 5, Funny

    Jesus, tell me about it. I get 30kb attachments merely saying "Got your email, thanks!" with "thanks" done up in some odd curly red font and a six-line sig, not to mention the twenty-seven 8x10 colored glossy JPG attachments with circles and arrows and a paragraph on the back of each one...

  29. Pagify by bckspc · · Score: 2, Informative

    Pagify is a perl script I wrote to do this for another job. It's basically a series of regular expressions that: 1. purges all the proprietary XML gunk from the HTML file you save from Word. 2. chops the file into smaller files wherever a Heading 1 appears 3. attaches endnotes as footnotes to the appropriate pages. It's GPL'd, so go nuts.

  30. Try this.... by mormop · · Score: 4, Informative

    Demoroniser is, in the author's own man pages words:

    A Perl script which corrects incompatible HTML generated by Microsoft applications.

    You can get it from the link in the same page. I must confess that I've not used it myself (don't use Office/Frontpage) but if it does what it says on the tin it should sort you out.

    --
    Hmmmmmm..... Deep fried and look like Squirrel.
  31. Dreamweaver MX 2004 by greymond · · Score: 2, Informative

    1) Open Word
    2) Select All -> Copy
    3) Open Dreamweaver
    4) File -> New Html Doc
    5) Paste
    6) Commands -> Clean up Word Html
    7) Commands -> Apply Source Formatting (if you take the time to set the programs preferences to what you like)
    8) Done
    9) Drink beer
    10) Sleep

  32. Re:DEMORONISER by Kelson · · Score: 2, Informative

    The Demoroniser was nice in its time, but it assumes the output should be 7-bit ASCII, or ISO Latin-1 at best.

    The Unmoroniser is an updated version that handles Unicode properly and will do things like convert proprietary Windows-only curly quotes to the appropriate HTML4 entities instead of dropping them back to less accurate, typographically offensive straight quotes. Same with ligatures and other characters that the Demoronizer would munge instead of convert.

    http://rheme.net/unmoroniser/

  33. Yes! by Kelson · · Score: 2, Insightful

    PDF is most suitable for documents that need to be printed with specific formatting.

    For documents that are going to be viewed online, it's infinitely preferable to use a free-form format like HTML (was designed to be) that can adjust to varying monitor and window sizes.

  34. Actually, an NDA probably doesn't matter. by arete · · Score: 2, Interesting

    In all likelyhood an NDA doesn't cover obvious works like this - anything that could be reasonably discovered publicly. Doubtless he couldn't post the _documents_ that he converted.

    However, I am also not willing to just assume that no company would ever consider letting someone sourceforge a script like this. It is 1) worth good advertising and 2) clearly not important enough to be worth selling. Release it in the company's name, or not depending on what they prefer.

    At a minimum a lot of small companies would be fine with this - big companies would vary wildly.

    --
    Looking for freelance Actionscript (Flash/Flex) or ColdFusion work and/or freelance developers. Email me, put Slashdot
    1. Re:Actually, an NDA probably doesn't matter. by mrchaotica · · Score: 5, Funny
      Doubtless he couldn't post the _documents_ that he converted.
      You realize he was converting them for the purpose of putting them on a website, right? ; )
      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    2. Re:Actually, an NDA probably doesn't matter. by Evil+Grinn · · Score: 2, Insightful

      You realize he was converting them for the purpose of putting them on a website, right? ; )

      Did he say the website was public?

  35. Re:Export it as XML and XSLT it to HTML by Lemuridae · · Score: 3, Informative

    From the AC above:

        1) get a copy of Word 2003
        2) "save as" an exemplar as XML
        3) write an XSLT to render it in a HTML with stylesheets etc as appropriate to your website
        4) for every document you get, "save as" XML with the XSLT from 3) as the transformation.
        5) publish

    I've been wondering how long until using XSLT and XML was suggested. XML is supposed to be a common data transport format but most of the other comments talk about starting with tranformations to Word HTML. This is wrong because it assumes that the Word to HTML conversion will produce usable HTML in the first place which is a bad assumption.

    The solution suggested by the AC could be combined into a program that drives the entire process using the Word COM API to save to XML and then then, for example, the MS Jet XSLT COM object model to automate the XML conversion. This could easily be maintained (eg: new Word formatting not previously encountered) with small changes to the XSLT.

    If the desire is to completely control the output without having control of the input then this is the best way to go. Yes, it's a bit of work but once you have a maintainable turn-key system you will save a lot of futzing with manual formatting. Use the power of XSLT.

  36. You can get anything you want.... by Quadraginta · · Score: 2, Funny

    But that's not what I came here to tell you about.

    I came to talk about the draft.

  37. RTF by yrte · · Score: 2, Informative

    One option that can work for some situations is to export / save the file from .doc into .rtf (rich text format) and then use one of the free or pay RTF->HTML converters. I find using other software than Word to convert MSDOC -> RTF produces better results.

    Using that process has made preserving italics, bold, and special characters much easier for me and almost seems fully automatable.

    I've been using this method recently with some very simple search and replace and able to get good results.

  38. Re:Handy alternative to Notepad by inphorm · · Score: 2, Informative

    I personally use dreamweaver for coding.. I know, I know, all that gui overhead and only semi-compliant code if it generates it itself.. but it does have the useful clean up word html tool, then I get to working it over in pure code.

    works for me anyway..

    - paul

  39. Common... what? by DragonHawk · · Score: 2, Funny

    "... a perfect opportunity for the application of a little common sense..."

    What is this "common sense" of which you speak? Where may I download it from?

    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  40. Re:More specifically: Word into MS CMS by sbma44 · · Score: 2, Informative

    Are you using the telerik radeditor MCMS placeholder? It's free, and has capabilities that let you automatically strip out word formatting. In my experience it only sort of works... but it's better than nothing.

    You can also add an event handler for the updating event that does some regex tidying. Replacing the regex "]*>" will go a long way (better double-check that). You should be able to come up with a similar one for all the smarttag nonsense that gets inserted, too.

    Still, Word formatting remains a major bane to my existence. Good luck.

  41. HTML Tidy cleans Word HTML. by Futurepower(R) · · Score: 2, Informative


    HTML Tidy cleans HTML, and has a special function for cleaning Word HTML junk.

    It must be terrible to work at Microsoft and always do mediocre work.

    --
    If you support dishonesty and violence, don't say you are Christian.

  42. Trying this again by einhverfr · · Score: 2, Interesting

    The script (decss.sed) is:

    s:STYLE=\"[ a-zA-Z0-9\:;-]*\"::Ig
    s:</FONT>::Ig
    s:<FONT[ -=\"A-Z0-9]*>::Ig
    s:BORDER=[0-9]*::Ig
    s:ALIGN=BO TTOM::g

    --

    LedgerSMB: Open source Accounting/ERP
  43. Re:Convert to RTF first by tonsofpcs · · Score: 2, Interesting

    Yes, it is, since RTF is a text-based format where all the formatting is open and close tags, much like HTML. Save a word doc as rtf instead and open it in notepad, and you will see. There are many tools premade to convert from RTF to HTML, but you can build your own easily.

  44. wvHtml by itomato · · Score: 2, Informative
    http://wvware.sourceforge.net/

    From the sourceforge page:

    wv Utilities

    Provided with the wv distribution is an application called wvWare. wvWare is a "power-user" application with lots of command-line options, doo-dads, bells, and whistles. Less interesting, but more convenient, are the helper scripts that use wvWare. These are:

            * wvHtml: convert your Word document into HTML4.0

    (there are more utilities for LaTeX, etc..


    I'm using this to convert all of our internal documentation. It does a pretty good job, even converts the images and acts in a relatively reliable manner with 2003, 2000, & 97 formatted files. There's some oddball output sprinkled in, but nothing a little sed fanciness can't fix.
  45. Re:OpenOffice 2.0-beta "save-as" and "export" grea by sonamchauhan · · Score: 2, Interesting

    Just expanding on your suggestion...

    Perhaps he could use the OpenOffice API to automatically have a server-side instance of OpenOffice open submitted Word documents and save them as HTML. This should happen at the same time the user uploads the document - that way the user could preview the conversion to HTML, and if it was flawed, he could choose to publish the document as PDF.

    OpenOffice API:
        http://api.openoffice.org/

    Code snippet shows simplicity of converting OpenOffice Writer SXW document into PDF:
        http://codesnippets.services.openoffice.org/Writer /Writer.StoreWriterAsPDF.snip
    Perhaps a few small changes here would get him what he wants.

    Perl interface (ooolib):
        http://ooolib.sourceforge.net/doc/ooolib-0.1.5-doc .html#info
    There are also Java code snippets. I think it would be possible to convert the OOBasic snippet above to either Java or Perl.