Ás vezes necessitamos de uma ferramenta, ou temos uma demanda e não temos a solução a mão.
Mas algumas ferramentas são simples e podem tornar-se parte de nossos sistemas de forma definitiva.
Lógico que como programadores, todos gostam de recriar a roda e às vezes criamos uma roda que já temos, só pelo prazer de re-descobrir.
Esta ferramenta estava jogada no meio dos meus downloads, então separei o minimo necessário que pode servir tanto para quem usa modo Windows quanto quem usa modo console.
RTF2HTML
RTF2RAWRtf2Html source-file [destination] [/CSS:names] [/IS] [/ID:path]
[/IT:format] [/BC:color] [/XS] [/CE:encoding] [/CS:charset]
[CS:mappings] [/DS:scope] [/IDF] [/IUF] [/SH] [/UI] [/SI] [/LD:path]
[/LP] [/LI] [/D] [/O] [/HT] [/NBS] [/CH] [/HP:pattern] [/?]
source-file source rtf file
destination destination directory (default=source-file directory)
/CSS:name1,name2 style sheet names (default=none)
/IS use inline styles (default=on)
/ID:path images directory (default=destination directory)
/IT:format images type format: jpg, gif or png (default=jpg)
/BC:color image background color name (default=none)
/XS extended image scale - border fix (default=off)
/CE:encoding character encoding: ASCII, UTF7, UTF8, Unicode,
BigEndianUnicode, UTF32, OperatingSystem (default=UTF8)
/CS:charset document character set used for the HTML header meta-tag
'content' (default=UTF-8)
/SC:mapping1,mapping2 special character mapping (default=none)
mapping: special-character=replacement
special characters: Tabulator, NonBreakingSpace,
EmDash, EnDash, EmSpace, EnSpace, QmSpace,
Bullet, LeftSingleQuote,
RightSingleQuote, LeftDoubleQuote,
RightDoubleQuote, OptionalHyphen, NonBreakingHyphen
/DS:scope document scope, comma separated list of document sections:
doc, html, head, body, content, all (default=all)
/IDF ignore duplicated fonts (default=off)
/IUF ignore unknown fonts (default=off)
/SH don't save HTML to the destination (default=on)
/SI don't save images to the destination (default=on)
/UI enforce unscaled images (default=off)
/LD:path log file directory (default=destination directory)
/LP write rtf parser log file (default=off)
/LI write rtf interpreter log file (default=off)
/D display HTML text on screen (default=off)
/O open HTML in associated application (default=off)
/NBS use non-breaking spaces (default=off)
/HT show hidden text (default=off)
/CH convert visual hyperlinks (default=off)
/HP:pattern regular expression pattern to recognize visual hyperlinks
/? this help
Samples:
Rtf2Html MyText.rtf
Rtf2Html MyText.rtf /DS:body,content
Rtf2Html MyText.rtf c:\temp
Rtf2Html MyText.rtf c:\temp /CSS:MyCompany.css
Rtf2Html MyText.rtf c:\temp /CSS:MyCompany.css,ThisProject.css
Rtf2Html MyText.rtf c:\temp /CSS:MyCompany.css,ThisProject.css
/ID:images /IT:png /BC:white
Rtf2Html MyText.rtf c:\temp /CSS:MyCompany.css,ThisProject.css
/ID:images /IT:png /BC:white /LD:log /LP /LI
Rtf2Html MyText.rtf c:\temp /SC:Tabulator=>,Bullet=:
Download 4SharedRtf2Raw source-file [destination] [/IT:format] [/BC:color] [/CE:encoding]
[/IS] [/XS] [/UI] [/ST] [/SI] [/LD:path] [/IDF] [/IUF] [/LP]
[/LI] [/D] [/O] [/HT] [/?]
source-file source rtf file
destination destination directory (default=source-file directory)
/IT:format images type format: bmp, emf, exif, gif, icon, jpg,
png, tiff or wmf (default=original)
/BC:color image background color name (default=none)
/CE:encoding character encoding: ASCII, UTF7, UTF8, Unicode,
BigEndianUnicode, UTF32, OperatingSystem (default=UTF8)
/IS image scale (default=off)
/XS extended image scale - border fix (default=off)
/UI enforce unscaled images (default=off)
/ST don't save text to the destination (default=on)
/SI don't save images to the destination (default=on)
/LD:path log file directory (default=destination directory)
/IDF ignore duplicated fonts (default=off)
/IUF ignore unknown fonts (default=off)
/LP write rtf parser log (default=off)
/LI write rtf interpreter log (default=off)
/D write text to screen (default=off)
/O open text in associated application (default=off)
/HT show hidden text (default=off)
/? this help
Samples:
Rtf2Raw MyText.rtf
Rtf2Raw MyText.rtf c:\temp
Rtf2Raw MyText.rtf c:\temp /CSS:MyCompany.css
Rtf2Raw MyText.rtf c:\temp /CSS:MyCompany.css,ThisProject.css
Rtf2Raw MyText.rtf c:\temp /CSS:MyCompany.css,ThisProject.css /IT:png /BC:white
Rtf2Raw MyText.rtf c:\temp /CSS:MyCompany.css,ThisProject.css /IT:png /BC:white
/LD:log /LP /LI
Boa diversão.

