Documentation
¶
Overview ¶
Package rtf opens files in the Rich Text Format, as RTF 1.9.1 of Microsoft describes it.
The package converts the text of the file into one XHTML document with a style sheet, and the layout of ivy puts it on pages (D10, D15). Page lays out the document only as far as the page that a program asks for. The package reads the fonts, the colors, the formatting of the characters and of the paragraphs, the tables, the pictures in PNG, JPEG, EMF and WMF, the sections with their pages and margins, the headers and the footers, the footnotes, the fields with their last result, and the text in each code page of the Encoding Standard and in Unicode. The tables have their merged cells and the tables that nest in their cells. A paragraph and a run take the formatting of their styles of the style sheet first. A run gives its East Asian font of \dbch after its font, and the language of its East Asian text. The WordArt of a header, such as a watermark, shows on each page. A rendering is good enough for a review (D5).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Format = ivy.Format{ Name: "rtf", Mimes: []string{"application/rtf", "text/rtf"}, Exts: []string{"rtf"}, Open: func(ctx context.Context, src ivy.Source, cfg ivy.Config) (ivy.Document, error) { return Open(ctx, src, WithConfig(cfg)) }, }
Format describes the package for the registry of a program.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is an open RTF file.
func Open ¶
Open opens an RTF file. It reads the file, and converts it on the first call that needs its text. It returns an error that wraps ivy.ErrFormat if src is not an RTF file, and one that wraps ivy.ErrLimit if the file is larger than Limits.MaxMemory.
func (*Document) Describe ¶
Describe satisfies the ivy.Describer interface. It reads the group \info of the file: the title, the author, the subject and the dates.