Inherits from NSObject
Declared in DTHTMLWriter.h

Overview

Class to generate HTML from NSAttributedString instances.

Tasks

Creating an HTML Writer

Generating HTML

Properties

Properties

attributedString

The attributed string that the writer is processing.

@property (nonatomic, readonly) NSAttributedString *attributedString

Declared In

DTHTMLWriter.h

paragraphTagName

The HTML element tag name to use for paragraphs. Defaults to @“p”.

@property (nonatomic, strong) NSString *paragraphTagName

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