RtfParser (rtf_parser v0.1.2)
RtfParser
is a package that can be used to convert a RTF document into plain text.
It uses a Rust NIF to extract all text blocks from the RTF document and return them as a list of binaries.
Link to this section Summary
Functions
Converts a RTF document to plain text. The function takes a single binary as argument and returns a list of binaries, where each binary is a block of text in the RTF document.
Link to this section Functions
Link to this function
rtf_to_text(rtf)
Converts a RTF document to plain text. The function takes a single binary as argument and returns a list of binaries, where each binary is a block of text in the RTF document.
examples
Examples
iex> RtfParser.rtf_to_text(~S"{ \rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard This is a {\b RTF document} with some text\par }")
["This is a", "RTF document", "with some text"]