C# Class iTextSharp.text.xml.ITextHandler

The iTextHandler-class maps several XHTML-tags to iText-objects.
Inheritance: ParserBase
Show file Open project: red-gate/iTextSharp-4.1.6 Class Usage Examples

Protected Properties

Property Type Description
chapters int
controlOpenClose bool
currentChunk iTextSharp.text.Chunk
document IDocListener
ignore bool
myTags System.Collections.Hashtable
stack System.Collections.Stack

Public Methods

Method Description
Characters ( string content, int start, int length ) : void

This method gets called when characters are encountered.

EndElement ( String uri, String lname, String name ) : void

This method gets called when an end tag is encountered.

HandleEndingTags ( String name ) : void

This method deals with the starting tags.

HandleStartingTags ( String name, Properties attributes ) : void

This method deals with the starting tags.

ITextHandler ( IDocListener document ) : System

Constructs a new iTextHandler that will translate all the events triggered by the parser to actions on the Document-object.

ITextHandler ( IDocListener document, Hashtable myTags ) : System
ITextHandler ( IDocListener document, HtmlTagMap myTags ) : System
ITextHandler ( IDocListener document, HtmlTagMap myTags, BaseFont bf ) : System
IgnorableWhitespace ( char ch, int start, int length ) : void

This method gets called when ignorable white space encountered.

SetControlOpenClose ( bool controlOpenClose ) : void

Sets the parameter that allows you to enable/disable the control over the Document.Open() and Document.Close() method.

If you set this parameter to true (= default), the parser will open the Document object when the start-root-tag is encountered and close it when the end-root-tag is met. If you set it to false, you have to open and close the Document object yourself.

StartElement ( String uri, String lname, String name, Hashtable attrs ) : void

This method gets called when a start tag is encountered.

Protected Methods

Method Description
AddImage ( Image img ) : void
IsDocumentRoot ( String tag ) : bool

Checks if a certain tag corresponds with the roottag.

Private Methods

Method Description
IsNewline ( String tag ) : bool

Checks if a certain tag corresponds with the newpage-tag.

IsNewpage ( String tag ) : bool

Checks if a certain tag corresponds with the newpage-tag.

Method Details

AddImage() protected method

protected AddImage ( Image img ) : void
img Image
return void

Characters() public method

This method gets called when characters are encountered.
public Characters ( string content, int start, int length ) : void
content string an array of characters
start int the start position in the array
length int the number of characters to read from the array
return void

EndElement() public method

This method gets called when an end tag is encountered.
public EndElement ( String uri, String lname, String name ) : void
uri String
lname String
name String the name of the tag that ends
return void

HandleEndingTags() public method

This method deals with the starting tags.
public HandleEndingTags ( String name ) : void
name String the name of the tag
return void

HandleStartingTags() public method

This method deals with the starting tags.
public HandleStartingTags ( String name, Properties attributes ) : void
name String the name of the tag
attributes System.util.Properties the list of attributes
return void

ITextHandler() public method

Constructs a new iTextHandler that will translate all the events triggered by the parser to actions on the Document-object.
public ITextHandler ( IDocListener document ) : System
document IDocListener this is the document on which events must be triggered
return System

ITextHandler() public method

public ITextHandler ( IDocListener document, Hashtable myTags ) : System
document IDocListener
myTags System.Collections.Hashtable
return System

ITextHandler() public method

public ITextHandler ( IDocListener document, HtmlTagMap myTags ) : System
document IDocListener
myTags iTextSharp.text.html.HtmlTagMap
return System

ITextHandler() public method

public ITextHandler ( IDocListener document, HtmlTagMap myTags, BaseFont bf ) : System
document IDocListener
myTags iTextSharp.text.html.HtmlTagMap
bf iTextSharp.text.pdf.BaseFont
return System

IgnorableWhitespace() public method

This method gets called when ignorable white space encountered.
public IgnorableWhitespace ( char ch, int start, int length ) : void
ch char an array of characters
start int the start position in the array
length int the number of characters to read from the array
return void

IsDocumentRoot() protected method

Checks if a certain tag corresponds with the roottag.
protected IsDocumentRoot ( String tag ) : bool
tag String a presumed tagname
return bool

SetControlOpenClose() public method

Sets the parameter that allows you to enable/disable the control over the Document.Open() and Document.Close() method.
If you set this parameter to true (= default), the parser will open the Document object when the start-root-tag is encountered and close it when the end-root-tag is met. If you set it to false, you have to open and close the Document object yourself.
public SetControlOpenClose ( bool controlOpenClose ) : void
controlOpenClose bool set this to false if you plan to open/close the Document yourself
return void

StartElement() public method

This method gets called when a start tag is encountered.
public StartElement ( String uri, String lname, String name, Hashtable attrs ) : void
uri String
lname String
name String the name of the tag that is encountered
attrs System.Collections.Hashtable the list of attributes
return void

Property Details

chapters protected property

Counts the number of chapters in this document.
protected int chapters
return int

controlOpenClose protected property

This is a flag that can be set, if you want to open and close the Document-object yourself.
protected bool controlOpenClose
return bool

currentChunk protected property

This is the current chunk to which characters can be added.
protected Chunk,iTextSharp.text currentChunk
return iTextSharp.text.Chunk

document protected property

This is the resulting document.
protected IDocListener document
return IDocListener

ignore protected property

This is the current chunk to which characters can be added.
protected bool ignore
return bool

myTags protected property

protected Hashtable,System.Collections myTags
return System.Collections.Hashtable

stack protected property

This is a Stack of objects, waiting to be added to the document.
protected Stack,System.Collections stack
return System.Collections.Stack