C# Class iTextSharp.text.DocWriter

An abstract Writer class for documents.
DocWriter is the abstract class of several writers such as PdfWriter and HtmlWriter. A DocWriter can be added as a DocListener to a certain Document by getting an instance (see method GetInstance() in the specific writer-classes). Every Element added to the original Document will be written to the stream of the listening DocWriter.
Inheritance: IDocListener
ファイルを表示 Open project: mapo80/iTextSharp-Monotouch

Protected Properties

Property Type Description
closeStream bool
document Document
open bool
os iTextSharp.text.pdf.OutputStreamCounter
pageSize Rectangle
pause bool

Public Methods

Method Description
Add ( IElement element ) : bool

Signals that an Element was added to the Document.

This method should be overriden in the specific DocWriter classes derived from this abstract class.

Close ( ) : void

Signals that the Document was closed and that no other Elements will be added.

Dispose ( ) : void
Flush ( ) : void

Flushes the Stream.

GetISOBytes ( string text ) : byte[]

Converts a string into a Byte array according to the ISO-8859-1 codepage.

IsPaused ( ) : bool
NewPage ( ) : bool

Signals that an new page has to be started.

This does nothing. Has to be overridden if needed.

Open ( ) : void

Signals that the Document was opened.

Pause ( ) : void

Let the writer know that all writing has to be paused.

ResetPageCount ( ) : void

Sets the page number to 0.

This method should be overriden in the specific DocWriter classes derived from this abstract class if they actually support the use of pagenumbers.

Resume ( ) : void

Let the writer know that writing may be resumed.

SetMarginMirroring ( bool marginMirroring ) : bool
SetMarginMirroringTopBottom ( bool MarginMirroring ) : bool
SetMargins ( float marginLeft, float marginRight, float marginTop, float marginBottom ) : bool

Sets the margins.

This does nothing. Has to be overridden if needed.

SetPageSize ( Rectangle pageSize ) : bool

Sets the pagesize.

Protected Methods

Method Description
AddTabs ( int indent ) : void

Writes a number of tabs.

DocWriter ( ) : System
DocWriter ( Document document, Stream os ) : System

Constructs a DocWriter.

Write ( string str ) : void

Writes a string to the stream.

Write ( string key, string value ) : void

Writes a key-value pair to the stream.

WriteEnd ( ) : void

Writes an endtag to the stream.

WriteEnd ( string tag ) : void

Writes an endtag to the stream.

WriteMarkupAttributes ( Properties markup ) : bool

Writes the markup attributes of the specified MarkupAttributes object to the stream.

WriteStart ( string tag ) : void

Writes a starttag to the stream.

Method Details

Add() public method

Signals that an Element was added to the Document.
This method should be overriden in the specific DocWriter classes derived from this abstract class.
public Add ( IElement element ) : bool
element IElement
return bool

AddTabs() protected method

Writes a number of tabs.
protected AddTabs ( int indent ) : void
indent int the number of tabs to add
return void

Close() public method

Signals that the Document was closed and that no other Elements will be added.
public Close ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

DocWriter() protected method

protected DocWriter ( ) : System
return System

DocWriter() protected method

Constructs a DocWriter.
protected DocWriter ( Document document, Stream os ) : System
document Document The Document that has to be written
os Stream The Stream the writer has to write to.
return System

Flush() public method

Flushes the Stream.
public Flush ( ) : void
return void

GetISOBytes() public static method

Converts a string into a Byte array according to the ISO-8859-1 codepage.
public static GetISOBytes ( string text ) : byte[]
text string the text to be converted
return byte[]

IsPaused() public method

public IsPaused ( ) : bool
return bool

NewPage() public method

Signals that an new page has to be started.
This does nothing. Has to be overridden if needed.
public NewPage ( ) : bool
return bool

Open() public method

Signals that the Document was opened.
public Open ( ) : void
return void

Pause() public method

Let the writer know that all writing has to be paused.
public Pause ( ) : void
return void

ResetPageCount() public method

Sets the page number to 0.
This method should be overriden in the specific DocWriter classes derived from this abstract class if they actually support the use of pagenumbers.
public ResetPageCount ( ) : void
return void

Resume() public method

Let the writer know that writing may be resumed.
public Resume ( ) : void
return void

SetMarginMirroring() public method

public SetMarginMirroring ( bool marginMirroring ) : bool
marginMirroring bool
return bool

SetMarginMirroringTopBottom() public method

public SetMarginMirroringTopBottom ( bool MarginMirroring ) : bool
MarginMirroring bool
return bool

SetMargins() public method

Sets the margins.
This does nothing. Has to be overridden if needed.
public SetMargins ( float marginLeft, float marginRight, float marginTop, float marginBottom ) : bool
marginLeft float the margin on the left
marginRight float the margin on the right
marginTop float the margin on the top
marginBottom float the margin on the bottom
return bool

SetPageSize() public method

Sets the pagesize.
public SetPageSize ( Rectangle pageSize ) : bool
pageSize Rectangle the new pagesize
return bool

Write() protected method

Writes a string to the stream.
protected Write ( string str ) : void
str string the string to write
return void

Write() protected method

Writes a key-value pair to the stream.
protected Write ( string key, string value ) : void
key string the name of an attribute
value string the value of an attribute
return void

WriteEnd() protected method

Writes an endtag to the stream.
protected WriteEnd ( ) : void
return void

WriteEnd() protected method

Writes an endtag to the stream.
protected WriteEnd ( string tag ) : void
tag string the name of the tag
return void

WriteMarkupAttributes() protected method

Writes the markup attributes of the specified MarkupAttributes object to the stream.
protected WriteMarkupAttributes ( Properties markup ) : bool
markup System.util.Properties
return bool

WriteStart() protected method

Writes a starttag to the stream.
protected WriteStart ( string tag ) : void
tag string the name of the tag
return void

Property Details

closeStream protected_oe property

protected bool closeStream
return bool

document protected_oe property

This is the document that has to be written.
protected Document,iTextSharp.text document
return Document

open protected_oe property

Is the writer open for writing?
protected bool open
return bool

os protected_oe property

The stream of this writer.
protected OutputStreamCounter,iTextSharp.text.pdf os
return iTextSharp.text.pdf.OutputStreamCounter

pageSize protected_oe property

The pageSize.
protected Rectangle,iTextSharp.text pageSize
return Rectangle

pause protected_oe property

Do we have to pause all writing actions?
protected bool pause
return bool