LanX has asked for the wisdom of the Perl Monks concerning the following question:

Hi

I'm tired to manually produce different formats of my CV and work history for different customers.

Some want PDF, some MS-DOCs, some have a web interface to fill with textual markups (indentation, bullets), and of course I need to produce HTML.

I'm now handling most of this by holding all information in org-mode in emacs and exporting to latex. But I'm puzzled about the best approach to export to DOC (I'm using OpenOffice anyway)

What do you recommend, I was pondering producing RTF with RTF::Writer. I could also try to import HTML or digging into ooffice's XML format...

Any ideas?

Cheers Rolf

PS: this is not about parsing org-mode

Replies are listed 'Best First'.
Re: Approaches to produce word docs
by marto (Cardinal) on Feb 01, 2011 at 12:31 UTC

    For PDF, MS Word and HTML you could try to automate Office using OpenOffice::UNO to populate a document with your data and save it in these formats.

Re: Approaches to produce word docs
by Your Mother (Archbishop) on Feb 01, 2011 at 15:05 UTC

    Pandoc? I keep almost breaking down and trying it but haven't yet. Be my guinea pig!

      Thanks,but just figured out that org-mode already has a docbook export feature. Still need to find out how to use this from OpenOffice.

      (actually I already saw this feature exists, but didn't know what it's good for ... :)

      There is also latex2rtf but I'm somehow skeptical about parsing and converting latex code...

      Cheers Rolf

Re: Approaches to produce word docs
by jmcnamara (Monsignor) on Feb 01, 2011 at 16:05 UTC
      The same things said in Re^2: Approaches to produce word docs apply here.

      I would need to switch to Win for the last step, MHT->DOC!

      But thanks, it's good to know this exists! :)

      Cheers Rolf

Re: Approaches to produce word docs
by davies (Monsignor) on Feb 01, 2011 at 16:50 UTC

    Do you have Word? If so, it may be possible to use Word's alleged ability to read HTML files to get what you want. I say "alleged", because Word will only read HTML files of a certain format. I don't speak HTML, so I haven't managed to get any code working to do this, but the automation of Word is not that difficult. I opened a Word instance and saved a blank document as HTML. This generated most of the code below, which is nearly working, i.e. it doesn't work. The problem seems (remember, I don't speak HTML) to have something to do with there being head and body tags from both the existing HTML document and the word top and tail. The temp file created therefore gets rejected by Word when it tries to open it. If anyone knows enough about HTML to get an HTML file into what Word will accept, this might be a way forward for you - if you have Word!

    Regards,

    John

      Thats comparable to the HTML export of Powerpoint in including MS-only information.

      Namely all these mso styles and xml infos. This helps IE to call office products in the background for rendering.

      (though with PPT it's more extreme)

      Anyway using MS-Word to import HTML is only my last resort. :)

      Thanks anyway I will consider doing this task from windows...

      Cheers Rolf