Word doc with images

2009-08-04
2013-04-12
  • Murray Wiseman

    Murray Wiseman - 2009-08-04

    A Freemind mind map is the best way I found to create and maintain a complex document. The document generated from a mind map will then have an underlying logcal tree structure.

    The mind map contains two types of nodes: plain text and html. The html of course can have images and links to other parts of the document and external links.

    Eventually, I want to generate from the mind map into a conventional document: e.g.

    Web page
    Word document
    PDF containing internal and external hyperlinks

    Web page - no problem. hit ctrl-e and you have a perfect vanilla Web page, complete with images, hyperlinks, the works. Everything is cool. Add a few lines of simple basic style instructions up at the top of the html source code and you will have presentable web page.

    Adding a TOC to the web page is a little tricky since there is no html markup that will magically create the table of contents and its required targets throughout the document, as for example in a wiki or in Word. I installed a CPAN Perl module (hypertoc) to do this.

    Word doc: This gets more tricky if some html nodes were built by copying and pasting from MS Word or from pdf files derived from MS Word documents. Problems would include MS "smart" curly quotes, MSO fonts, references, and other non-pure html structures. Best is get rid of these immediately after pasting into a mindmap node. Otherwise, you will have the nasty job of fixing them at this point when you want to generate a word doc.

    From the browser, save your web page to disk. You need to do this rather than working with the original html file. Alternatively you can copy and paste the browser contents into an empty word document. Both will be fine unless the file has some code (referred to earleir) that Word doesn't like. Then you will have to find the problem. Word 2003 will point you to the problem after it crashes and recovers.

    Your internal hyperlinks in Word will be wrong. They will be absolute paths to wherever you saved the browser file. You don't want to edit them in Word one-by-one as this will be time consuming. Instead, you want to do a quick search and replace. Use Tools, Options, View, Field Codes. Now you can see all the hyperlinks. With ctrl-h wipe out the absolute part of the paths.

    You can add a TOC as usual in Word if you haven't already done so using the method above.

    Now create the PDF, in the usual way using Acrobat Pro if you need the hyperlinks to work, or any PDF tool if you don't need hyperlinks in the document.

    Murray

     
    • Murray Wiseman

      Murray Wiseman - 2009-08-06

      Here is an update after encountering a few glitches.

      A Freemind mind map is the best way to create and maintain a complex document, such as a book, a Standard, etc. The document generated from a mind map will have an underlying logical tree structure, which is desirable.

      The mind map contains two types of nodes: plain text and html. The html nodes can can contain images and links to other parts of the document and external links.

      Eventually, you will want to convert the mind map into a conventional document, e.g.:
      Web page
      Word document
      PDF containing internal and external hyperlinks

      Web page - no problem. hit ctrl-e and you have a perfect vanilla Web page, complete with images, hyperlinks, the works. Everything is cool. Adding a few lines of basic css instructions up at the top in the style section of the html head section will yield a presentable web page. Adding a TOC to the web page is a little tricky since there is no html markup that will magically create the table of contents and its targets throughout the document, as for example in the wiki or in Word. I installed a CPAN Perl module (hypertoc) to do this.

      Word doc: This gets tricky if some html nodes were built by copying and pasting from MS Word or from pdf files derived from MS Word documents. Problems would include MS "smart" curly quotes and other non-pure html structures. Best to remove these immediately from the Freemind node. The built in Simply HTML is a great wysiwyg flexible tool for quickly building clean html. FCKEditor and Wordoff.org can be a big help. If you don't keep your mind map clean, you will have the nasty job of fixing problems at this point when you want to generate a Word doc.

      Copy and paste the browser contents into an empty word document. This will convert all images in the document from wherever they have been linked into native Word doc images. All will be fine unless the file has some code that Word doesn't like (discussed above). Then you will have to find the problem. Word 2003 will point you to the problem after it crashes and recovers. Save as .xml

      Next, your internal hyperlinks in Word will be wrong. They will be absolute paths to wherever on your hard drive Freemind saved the filename.mm.html file. The links can be fixed one-by-one in Word using the Edit hyperlink function, but this will be time consuming. Instead you can do a regular expression search and replace on the .xml file as follows

      remove from the xml all the strings of the pattern:
      filename.mm.html#*[]
      w:bookmark="*[]#
      where *[] represents the regular expression for the bookmarks' target texts,

      Re-open the xml in Word and test the links. You will notice a few formatting changes. But these were not done by your regular expression search and replace. These are Word xml conversion issues. You can add a TOC as one usually does in Word if you haven't already done so using the method above.

      Now create the PDF, in the usual way using Acrobat Pro if you need the hyperlinks to work or with any pdf generator if not.

       
    • Wolfgang

      Wolfgang - 2009-08-14

      If you 'only' need to have a pdf-document there is another way, that I took
      I had several Mindmaps (with html and images) and converted them into TeX-files using one of the XSL-Files supplied with freemind than passed the whole thing through pdftex and was done

       
      • Murray Wiseman

        Murray Wiseman - 2009-08-16

        Thanks Wolfgang, I'll try that way. It sounds promising. Here is my current way.

        A Freemind mind map is the best way to create and maintain a complex document, such as a book, a standard, etc. The document generated from a mind map will have the desired underlying logical tree structure. Periodically, as the mind map evolves, you will want to convert it into a conventional document. For example, a:

        Web page
        Word document
        PDF with bookmarks and internal and external hyperlinks
        Mind map

        Web page:
        No problem. Hit ctrl-e and you have a perfect vanilla Web page, complete with images and hyperlinks. Modifying a few lines of basic css instructions up at the top in the style section of the html head section will yield a presentable web page. For example,
        Replace:

        li { list-style: none;  margin: 0; }
        p { margin: 0; }

        With:
        body {font-family: Arial, Verdana, Helvetica;}
        li {margin-top: 2pt; margin-bottom: 2pt}
        p {font-size: 12px;}
        ol {font-size: 12px;}
        ul {font-size: 12px;}
        td {font-size: 12px;}

        H1 {page-break-before: always}
        H2 {page-break-before: always}
        P.breakhere {page-break-before: always}

        Adding a TOC to the web page is a little tricky since there is no html markup that will magically create the table of contents and its targets throughout the document, as for example in tikiwiki or in Word. I use a CPAN Perl module (called "hypertoc") to do this.

        Word doc:
        Of course, most people want a Word doc because that is the application they use daily. Word provides the the best way to comment on and propose edits to a document. Converting to Word is now rather easy thanks to Microsoft's ".mht" format. In IE simply save the web page as a .mht file. However, your internal hyperlinks in Word will be wrong. They will be absolute paths to wherever on your hard drive Freemind saved the filename.mm.html file. The links can be fixed one-by-one in Word using the Edit hyperlink function, but this will be time consuming. Instead you can do a regular expression search and replace on the .mht file. As an example here are two lines from typicalFile.mht file:

        href=3D"file:///C:/Users/Murray/Documents/nete/nsrg/mindmaps/RCM_Pilot_Gu=
        idance_Package.mm.html#backfitrcm>Backfit RCM

        Remove the entire absolute path segment including the file name. The first line changes to: href=3D"=

        The second line changes to: #backfitrcm>Backfit RCM

        You will have to use regular expression substitutions, in order to avoid unwanted changes. For example, in the second line replace the regular expression ^idance_Package.mm.html# with #. I used Funduc Search and Replace to do this. (info@funduc.com)

        Open the .mht in Word and test the links. Save as a .doc. Some touch up is required, mainly to shift content over to the left so that it fits on a printed page.

        PDF
        Create the PDF, in the usual way from Word using Acrobat Pro.

         

Log in to post a comment.