C# Класс 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.
Наследование: IDocListener
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
closeStream bool
document Document
open bool
os iTextSharp.text.pdf.OutputStreamCounter
pageSize Rectangle
pause bool

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Описание методов

Add() публичный метод

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
Результат bool

AddTabs() защищенный метод

Writes a number of tabs.
protected AddTabs ( int indent ) : void
indent int the number of tabs to add
Результат void

Close() публичный метод

Signals that the Document was closed and that no other Elements will be added.
public Close ( ) : void
Результат void

Dispose() публичный метод

public Dispose ( ) : void
Результат void

DocWriter() защищенный метод

protected DocWriter ( ) : System
Результат System

DocWriter() защищенный метод

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.
Результат System

Flush() публичный метод

Flushes the Stream.
public Flush ( ) : void
Результат void

GetISOBytes() публичный статический метод

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
Результат byte[]

IsPaused() публичный метод

public IsPaused ( ) : bool
Результат bool

NewPage() публичный метод

Signals that an new page has to be started.
This does nothing. Has to be overridden if needed.
public NewPage ( ) : bool
Результат bool

Open() публичный метод

Signals that the Document was opened.
public Open ( ) : void
Результат void

Pause() публичный метод

Let the writer know that all writing has to be paused.
public Pause ( ) : void
Результат void

ResetPageCount() публичный метод

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
Результат void

Resume() публичный метод

Let the writer know that writing may be resumed.
public Resume ( ) : void
Результат void

SetMarginMirroring() публичный метод

public SetMarginMirroring ( bool marginMirroring ) : bool
marginMirroring bool
Результат bool

SetMarginMirroringTopBottom() публичный метод

public SetMarginMirroringTopBottom ( bool MarginMirroring ) : bool
MarginMirroring bool
Результат bool

SetMargins() публичный метод

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
Результат bool

SetPageSize() публичный метод

Sets the pagesize.
public SetPageSize ( Rectangle pageSize ) : bool
pageSize Rectangle the new pagesize
Результат bool

Write() защищенный метод

Writes a string to the stream.
protected Write ( string str ) : void
str string the string to write
Результат void

Write() защищенный метод

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
Результат void

WriteEnd() защищенный метод

Writes an endtag to the stream.
protected WriteEnd ( ) : void
Результат void

WriteEnd() защищенный метод

Writes an endtag to the stream.
protected WriteEnd ( string tag ) : void
tag string the name of the tag
Результат void

WriteMarkupAttributes() защищенный метод

Writes the markup attributes of the specified MarkupAttributes object to the stream.
protected WriteMarkupAttributes ( Properties markup ) : bool
markup System.util.Properties
Результат bool

WriteStart() защищенный метод

Writes a starttag to the stream.
protected WriteStart ( string tag ) : void
tag string the name of the tag
Результат void

Описание свойств

closeStream защищенное свойство

protected bool closeStream
Результат bool

document защищенное свойство

This is the document that has to be written.
protected Document,iTextSharp.text document
Результат Document

open защищенное свойство

Is the writer open for writing?
protected bool open
Результат bool

os защищенное свойство

The stream of this writer.
protected OutputStreamCounter,iTextSharp.text.pdf os
Результат iTextSharp.text.pdf.OutputStreamCounter

pageSize защищенное свойство

The pageSize.
protected Rectangle,iTextSharp.text pageSize
Результат Rectangle

pause защищенное свойство

Do we have to pause all writing actions?
protected bool pause
Результат bool