Re: groff (or dvi) TO ms-word anyone?



One way to convert groff to word is to output HTML from groff, then
convert to word using OOo. Here is a rough outline of the process.

First, create OOo macros in converter.odt.
1. Open Ooo
2. Create new text document
3. in top menu, click Tools, Macros, Organize Macros, OpenOffice.org
Basic...
4. on right, click Organizer... to get OpenOffice.org Basic Macro
Organizer
5. select Standard under My Macros
6. on right, click New... to get New Module
7. under Name, enter MyConversions
8. on right, click OK to close New Module
9. on right, click Close to close OpenOffice.org Basic Macro Organizer
10. select Standard under My Macros
11. in right, click New to get My Macros & Dialogs.Standard -
OpenOffice.org Basic
12. in bottom, select MyConversions tab
13. at the end, enter the following code
Sub SaveAsDoc( cFile )
cURL = ConvertToURL( cFile )
oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, (_
Array( MakePropertyValue( "Hidden", True ),))
cFile = Left( cFile, Len( cFile ) - 4 ) + ".doc"
cURL = ConvertToURL( cFile )
oDoc.storeToURL( cURL, Array(_
MakePropertyValue( "FilterName", "MS WinWord 6.0" ),)
oDoc.close( True )
End Sub

Function MakePropertyValue( Optional cName As String, Optional
uValue ) _
As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
14. in top menu, click File Close to close My Macros &
Dialogs.Standard - OpenOffice.org Basic
15. in top menu, click File, Save As... to get Save As
16. at File name, enter converter
17. in right, click Save, to close Save As
18. in top menu, click File, Exit

Next, convert roff to HTML.
gzip -cd /usr/man/mann/open.n.gz | groff -t -man -Thtml >/tmp/
open.html

Finally, convert HTML to Word.
soffice converter.odt 'macro://converter/
Standard.MyConversions.SaveAsDoc(/tmp/open.html)'

Cheers,

Ben
.



Relevant Pages

  • Re: macro and cl-who help
    ... Lisp, but... ... you back into the "walking forms as HTML data" mode, ... This would have been extensible with user-defined tags, ... HTML tags are macros can be functions: ...
    (comp.lang.lisp)
  • Re: Alternatives
    ... Does Ruby have macros? ... Again macros that don't give any advantage against OOP. ... SUCounterTest>>renderContentOn: html ... The thing about Lisp macros is, ...
    (comp.lang.lisp)
  • Re: Pretty-printing HTML with HTMLgen?
    ... > html element names. ... Actually, it works fine, because they're not macros, they're just ... You may be confusing HTOUT with one of these terribly rudimantary ... systems which defines macros for all the HTML tags, ...
    (comp.lang.lisp)
  • Re: SiteMap For Google
    ... >>I was about to make a content management program in Java. ... and the html generation and remote updating would be automatic. ... The macros themselves are written in Java so can be quite ... > school is using my header scheme to teach students. ...
    (comp.lang.java.programmer)
  • Re: How can this macro be improved?
    ... | it write an html link with or without attributes. ... using macros to create a small embedded ... Personally, I like HTOUT and CL-WHO, which let you write things ... the occasional explicit LFD calls in the above example. ...
    (comp.lang.lisp)