Inherits from NSObject
Declared in DTHTMLWriter.h

Overview

Class to generate HTML from NSAttributedString instances.

Creating web archive from a DTHTMLWriter.

Tasks

Creating an HTML Writer

Generating HTML

Properties

DTWebArchive Methods

Properties

attributedString

The attributed string that the writer is processing.

@property (nonatomic, readonly) NSAttributedString *attributedString

Declared In

DTHTMLWriter.h

textScale

If specified then all absolute font sizes (px) will be divided by this value. This is useful if you specified a text size multiplicator when converting HTML to the attributed string you are processing.

@property (nonatomic, assign) CGFloat textScale

Declared In

DTHTMLWriter.h

useAppleConvertedSpace

If YES, preserve whitespaces in HTML by using “Apple-converted-space”. Default YES.

@property (nonatomic, assign) BOOL useAppleConvertedSpace

Declared In

DTHTMLWriter.h

Instance Methods

HTMLFragment

Generates a HTML fragment representation of the attributed string including inlined styles and no html or head elements

- (NSString *)HTMLFragment

Return Value

The generated string

Declared In

DTHTMLWriter.h

HTMLString

Generates a HTML representation of the attributed string

- (NSString *)HTMLString

Return Value

The generated string

Declared In

DTHTMLWriter.h

initWithAttributedString:

Creates a writer with a given NSAttributedString as input

- (id)initWithAttributedString:(NSAttributedString *)attributedString

Parameters

attributedString

An attributed string

Declared In

DTHTMLWriter.h

webArchive

Creates a web archive from the writer’s attributed string

- (DTWebArchive *)webArchive

Declared In

DTHTMLWriter+DTWebArchive.h