DocWriter Public class
Description
An abstract Writer class for documents.
Diagram
flowchart LR classDef interfaceStyle stroke-dasharray: 5 5; classDef abstractStyle stroke-width:4px subgraph iTextSharp.text iTextSharp.text.DocWriter[[DocWriter]] class iTextSharp.text.DocWriter abstractStyle; iTextSharp.text.IDocListener[[IDocListener]] class iTextSharp.text.IDocListener interfaceStyle; iTextSharp.text.IElementListener[[IElementListener]] class iTextSharp.text.IElementListener interfaceStyle; end subgraph System System.IDisposable[[IDisposable]] end iTextSharp.text.IDocListener --> iTextSharp.text.DocWriter iTextSharp.text.IElementListener --> iTextSharp.text.IDocListener System.IDisposable --> iTextSharp.text.IDocListener
Members
Properties
Public properties
|
Type |
Name |
Methods |
|---|---|---|
|
|
|
|
|
|
|
|
Methods
Public methods
|
Returns |
Name |
|---|---|
|
|
(
element)
|
|
|
()
|
|
|
() |
|
|
()
|
|
|
() |
|
|
()
|
|
|
()
|
|
|
()
|
|
|
()
|
|
|
()
|
|
|
( |
|
|
( |
|
|
( |
|
|
(
pageSize)
|
Protected methods
|
Returns |
Name |
|---|---|
|
|
( |
|
|
( |
|
|
( |
|
|
( |
|
|
( |
Public Static methods
|
Returns |
Name |
|---|---|
|
|
( |
Details
Summary
An abstract Writer class for documents.
Remarks
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 -
IElementListener -
IDisposable
Constructors
DocWriter [1/2]
Source code
protected DocWriter()
DocWriter [2/2]
Source code
protected DocWriter(Document document, Stream os)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
document |
The Document that has to be written |
|
|
os |
The Stream the writer has to write to. |
Summary
Constructs a DocWriter.
Methods
Add
Source code
public virtual bool Add(IElement element)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
element |
Summary
Signals that an Element was added to the Document.
Remarks
This method should be overriden in the specific DocWriter classes derived from this abstract class.
Returns
false
Open
Source code
public virtual void Open()
Summary
Signals that the Document was opened.
SetPageSize
Source code
public virtual bool SetPageSize(Rectangle pageSize)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
pageSize |
the new pagesize |
Summary
Sets the pagesize.
Returns
a boolean
SetMargins
Source code
public virtual bool SetMargins(float marginLeft, float marginRight, float marginTop, float marginBottom)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
marginLeft |
the margin on the left |
|
|
marginRight |
the margin on the right |
|
|
marginTop |
the margin on the top |
|
|
marginBottom |
the margin on the bottom |
Summary
Sets the margins.
Remarks
This does nothing. Has to be overridden if needed.
Returns
NewPage
Source code
public virtual bool NewPage()
Summary
Signals that an new page has to be started.
Remarks
This does nothing. Has to be overridden if needed.
Returns
true if the page was added, false if not.
ResetPageCount
Source code
public virtual void ResetPageCount()
Summary
Sets the page number to 0.
Remarks
This method should be overriden in the specific DocWriter classes derived from this abstract class if they actually support the use of pagenumbers.
Close
Source code
public virtual void Close()
Summary
Signals that the Document was closed and that no other Elements will be added.
GetISOBytes
Source code
public static byte GetISOBytes(string text)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
text |
the text to be converted |
Summary
Converts a string into a Byte array according to the ISO-8859-1 codepage.
Returns
the conversion result
Pause
Source code
public virtual void Pause()
Summary
Let the writer know that all writing has to be paused.
IsPaused
Source code
public virtual bool IsPaused()
Resume
Source code
public virtual void Resume()
Summary
Let the writer know that writing may be resumed.
Flush
Source code
public virtual void Flush()
Summary
Flushes the Stream.
Write [1/2]
Source code
protected virtual void Write(string str)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
str |
the string to write |
Summary
Writes a string to the stream.
AddTabs
Source code
protected virtual void AddTabs(int indent)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
indent |
the number of tabs to add |
Summary
Writes a number of tabs.
Write [2/2]
Source code
protected virtual void Write(string key, string value)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
key |
the name of an attribute |
|
|
value |
the value of an attribute |
Summary
Writes a key-value pair to the stream.
WriteStart
Source code
protected virtual void WriteStart(string tag)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
tag |
the name of the tag |
Summary
Writes a starttag to the stream.
WriteEnd [1/2]
Source code
protected virtual void WriteEnd(string tag)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
tag |
the name of the tag |
Summary
Writes an endtag to the stream.
WriteEnd [2/2]
Source code
protected virtual void WriteEnd()
Summary
Writes an endtag to the stream.
WriteMarkupAttributes
Source code
protected virtual bool WriteMarkupAttributes(Properties markup)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
markup |
Summary
Writes the markup attributes of the specified MarkupAttributes object to the stream.
Returns
SetMarginMirroring
Source code
public virtual bool SetMarginMirroring(bool marginMirroring)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
marginMirroring |
SetMarginMirroringTopBottom
Source code
public virtual bool SetMarginMirroringTopBottom(bool MarginMirroring)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
MarginMirroring |
Dispose
Source code
public virtual void Dispose()
Properties
PageCount
public virtual int PageCount { set; }
Summary
Sets the page number.
Remarks
This method should be overriden in the specific DocWriter classes derived from this abstract class if they actually support the use of pagenumbers.
CloseStream
public virtual bool CloseStream { get; set; }
Generated with ModularDoc