HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.DocWriter Class Reference

An abstract Writer class for documents. More...

Inheritance diagram for iTextSharp.text.DocWriter:
iTextSharp.text.IDocListener iTextSharp.text.IElementListener iTextSharp.text.html.HtmlWriter iTextSharp.text.pdf.PdfWriter iTextSharp.text.rtf.RtfWriter2 iTextSharp.text.pdf.PdfCopy iTextSharp.text.pdf.PdfStamperImp iTextSharp.text.pdf.PdfSmartCopy

Public Member Functions

virtual bool Add (IElement element)
 Signals that an Element was added to the Document. More...
 
virtual void Open ()
 Signals that the Document was opened. More...
 
virtual bool SetPageSize (Rectangle pageSize)
 Sets the pagesize. More...
 
virtual bool SetMargins (float marginLeft, float marginRight, float marginTop, float marginBottom)
 Sets the margins. More...
 
virtual bool NewPage ()
 Signals that an new page has to be started. More...
 
virtual void ResetHeader ()
 Resets the header of this document. More...
 
virtual void ResetFooter ()
 Resets the footer of this document. More...
 
virtual void ResetPageCount ()
 Sets the page number to 0. More...
 
virtual void Close ()
 Signals that the Document was closed and that no other Elements will be added. More...
 
virtual void Pause ()
 Let the writer know that all writing has to be paused. More...
 
bool IsPaused ()
 
virtual void Resume ()
 Let the writer know that writing may be resumed. More...
 
virtual void Flush ()
 Flushes the Stream. More...
 
virtual bool SetMarginMirroring (bool marginMirroring)
 
virtual bool SetMarginMirroringTopBottom (bool MarginMirroring)
 

Static Public Member Functions

static byte[] GetISOBytes (string text)
 Converts a string into a Byte array according to the ISO-8859-1 codepage. More...
 

Static Public Attributes

const byte NEWLINE = (byte)'\n'
 This is some byte that is often used. More...
 
const byte TAB = (byte)'\t'
 This is some byte that is often used. More...
 
const byte LT = (byte)'<'
 This is some byte that is often used. More...
 
const byte SPACE = (byte)' '
 This is some byte that is often used. More...
 
const byte EQUALS = (byte)'='
 This is some byte that is often used. More...
 
const byte QUOTE = (byte)'\"'
 This is some byte that is often used. More...
 
const byte GT = (byte)'>'
 This is some byte that is often used. More...
 
const byte FORWARD = (byte)'/'
 This is some byte that is often used. More...
 

Protected Member Functions

 DocWriter ()
 
 DocWriter (Document document, Stream os)
 Constructs a DocWriter. More...
 
void Write (string str)
 Writes a string to the stream. More...
 
void AddTabs (int indent)
 Writes a number of tabs. More...
 
void Write (string key, string value)
 Writes a key-value pair to the stream. More...
 
void WriteStart (string tag)
 Writes a starttag to the stream. More...
 
void WriteEnd (string tag)
 Writes an endtag to the stream. More...
 
void WriteEnd ()
 Writes an endtag to the stream. More...
 
bool WriteMarkupAttributes (Properties markup)
 Writes the markup attributes of the specified MarkupAttributes object to the stream. More...
 

Protected Attributes

Rectangle pageSize
 The pageSize. More...
 
Document document
 This is the document that has to be written. More...
 
OutputStreamCounter os
 The stream of this writer. More...
 
bool open = false
 Is the writer open for writing? More...
 
bool pause = false
 Do we have to pause all writing actions? More...
 
bool closeStream = true
 

Properties

virtual HeaderFooter Header [set]
 Changes the header of this document. More...
 
virtual HeaderFooter Footer [set]
 Changes the footer of this document. More...
 
virtual int PageCount [set]
 Sets the page number. More...
 
virtual bool CloseStream [get, set]
 
- Properties inherited from iTextSharp.text.IDocListener
int PageCount [set]
 Sets the page number. More...
 
HeaderFooter Header [set]
 Changes the header of this document. More...
 
HeaderFooter Footer [set]
 Changes the footer of this document. More...
 

Detailed Description

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.

See also
T:iTextSharp.text.Document, T:iTextSharp.text.IDocListener

Constructor & Destructor Documentation

◆ DocWriter() [1/2]

iTextSharp.text.DocWriter.DocWriter ( )
protected

◆ DocWriter() [2/2]

iTextSharp.text.DocWriter.DocWriter ( Document  document,
Stream  os 
)
protected

Constructs a DocWriter.

Parameters
documentThe Document that has to be written
osThe Stream the writer has to write to.

Member Function Documentation

◆ Add()

virtual bool iTextSharp.text.DocWriter.Add ( IElement  element)
virtual

Signals that an Element was added to the Document.

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

Parameters
element
Returns
false

Implements iTextSharp.text.IElementListener.

Reimplemented in iTextSharp.text.rtf.RtfWriter2, and iTextSharp.text.html.HtmlWriter.

◆ AddTabs()

void iTextSharp.text.DocWriter.AddTabs ( int  indent)
protected

Writes a number of tabs.

Parameters
indentthe number of tabs to add

◆ Close()

virtual void iTextSharp.text.DocWriter.Close ( )
virtual

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

Implements iTextSharp.text.IDocListener.

Reimplemented in iTextSharp.text.rtf.RtfWriter2, iTextSharp.text.pdf.PdfWriter, iTextSharp.text.pdf.PdfCopy, and iTextSharp.text.html.HtmlWriter.

◆ Flush()

virtual void iTextSharp.text.DocWriter.Flush ( )
virtual

Flushes the Stream.

◆ GetISOBytes()

static byte [] iTextSharp.text.DocWriter.GetISOBytes ( string  text)
static

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

Parameters
textthe text to be converted
Returns
the conversion result

◆ IsPaused()

bool iTextSharp.text.DocWriter.IsPaused ( )

Checks if writing is paused.

Returns
true if writing temporarely has to be paused, false otherwise.

◆ NewPage()

virtual bool iTextSharp.text.DocWriter.NewPage ( )
virtual

Signals that an new page has to be started.

This does nothing. Has to be overridden if needed.

Returns
true if the page was added, false if not.

Implements iTextSharp.text.IDocListener.

Reimplemented in iTextSharp.text.rtf.RtfWriter2, and iTextSharp.text.html.HtmlWriter.

◆ Open()

virtual void iTextSharp.text.DocWriter.Open ( )
virtual

◆ Pause()

virtual void iTextSharp.text.DocWriter.Pause ( )
virtual

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

◆ ResetFooter()

virtual void iTextSharp.text.DocWriter.ResetFooter ( )
virtual

Resets the footer of this document.

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

Implements iTextSharp.text.IDocListener.

Reimplemented in iTextSharp.text.rtf.RtfWriter2.

◆ ResetHeader()

virtual void iTextSharp.text.DocWriter.ResetHeader ( )
virtual

Resets the header of this document.

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

Implements iTextSharp.text.IDocListener.

Reimplemented in iTextSharp.text.rtf.RtfWriter2.

◆ ResetPageCount()

virtual void iTextSharp.text.DocWriter.ResetPageCount ( )
virtual

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.

Implements iTextSharp.text.IDocListener.

Reimplemented in iTextSharp.text.rtf.RtfWriter2.

◆ Resume()

virtual void iTextSharp.text.DocWriter.Resume ( )
virtual

Let the writer know that writing may be resumed.

◆ SetMarginMirroring()

virtual bool iTextSharp.text.DocWriter.SetMarginMirroring ( bool  marginMirroring)
virtual

Parameter that allows you to do margin mirroring (odd/even pages)

Parameters
marginMirroring
Returns
true if succesfull

Implements iTextSharp.text.IDocListener.

◆ SetMarginMirroringTopBottom()

virtual bool iTextSharp.text.DocWriter.SetMarginMirroringTopBottom ( bool  MarginMirroring)
virtual
See also
com.lowagie.text.DocListener::setMarginMirroring(boolean)
Since
2.1.6

Implements iTextSharp.text.IDocListener.

◆ SetMargins()

virtual bool iTextSharp.text.DocWriter.SetMargins ( float  marginLeft,
float  marginRight,
float  marginTop,
float  marginBottom 
)
virtual

Sets the margins.

This does nothing. Has to be overridden if needed.

Parameters
marginLeftthe margin on the left
marginRightthe margin on the right
marginTopthe margin on the top
marginBottomthe margin on the bottom
Returns

Implements iTextSharp.text.IDocListener.

Reimplemented in iTextSharp.text.rtf.RtfWriter2.

◆ SetPageSize()

virtual bool iTextSharp.text.DocWriter.SetPageSize ( Rectangle  pageSize)
virtual

Sets the pagesize.

Parameters
pageSizethe new pagesize
Returns
a boolean

Implements iTextSharp.text.IDocListener.

Reimplemented in iTextSharp.text.rtf.RtfWriter2.

◆ Write() [1/2]

void iTextSharp.text.DocWriter.Write ( string  key,
string  value 
)
protected

Writes a key-value pair to the stream.

Parameters
keythe name of an attribute
valuethe value of an attribute

◆ Write() [2/2]

void iTextSharp.text.DocWriter.Write ( string  str)
protected

Writes a string to the stream.

Parameters
strthe string to write

◆ WriteEnd() [1/2]

void iTextSharp.text.DocWriter.WriteEnd ( )
protected

Writes an endtag to the stream.

◆ WriteEnd() [2/2]

void iTextSharp.text.DocWriter.WriteEnd ( string  tag)
protected

Writes an endtag to the stream.

Parameters
tagthe name of the tag

◆ WriteMarkupAttributes()

bool iTextSharp.text.DocWriter.WriteMarkupAttributes ( Properties  markup)
protected

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

Parameters
mAttthe MarkupAttributes to write.
Returns

◆ WriteStart()

void iTextSharp.text.DocWriter.WriteStart ( string  tag)
protected

Writes a starttag to the stream.

Parameters
tagthe name of the tag

Member Data Documentation

◆ closeStream

bool iTextSharp.text.DocWriter.closeStream = true
protected

Closes the stream on document close

◆ document

Document iTextSharp.text.DocWriter.document
protected

This is the document that has to be written.

◆ EQUALS

const byte iTextSharp.text.DocWriter.EQUALS = (byte)'='
static

This is some byte that is often used.

◆ FORWARD

const byte iTextSharp.text.DocWriter.FORWARD = (byte)'/'
static

This is some byte that is often used.

◆ GT

const byte iTextSharp.text.DocWriter.GT = (byte)'>'
static

This is some byte that is often used.

◆ LT

const byte iTextSharp.text.DocWriter.LT = (byte)'<'
static

This is some byte that is often used.

◆ NEWLINE

const byte iTextSharp.text.DocWriter.NEWLINE = (byte)'\n'
static

This is some byte that is often used.

◆ open

bool iTextSharp.text.DocWriter.open = false
protected

Is the writer open for writing?

◆ os

OutputStreamCounter iTextSharp.text.DocWriter.os
protected

The stream of this writer.

◆ pageSize

Rectangle iTextSharp.text.DocWriter.pageSize
protected

The pageSize.

◆ pause

bool iTextSharp.text.DocWriter.pause = false
protected

Do we have to pause all writing actions?

◆ QUOTE

const byte iTextSharp.text.DocWriter.QUOTE = (byte)'\"'
static

This is some byte that is often used.

◆ SPACE

const byte iTextSharp.text.DocWriter.SPACE = (byte)' '
static

This is some byte that is often used.

◆ TAB

const byte iTextSharp.text.DocWriter.TAB = (byte)'\t'
static

This is some byte that is often used.

Property Documentation

◆ CloseStream

virtual bool iTextSharp.text.DocWriter.CloseStream
getset

◆ Footer

virtual HeaderFooter iTextSharp.text.DocWriter.Footer
set

Changes the footer of this document.

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

the new footer

◆ Header

virtual HeaderFooter iTextSharp.text.DocWriter.Header
set

Changes the header of this document.

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

the new header

◆ PageCount

virtual int iTextSharp.text.DocWriter.PageCount
set

Sets the page number.

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


The documentation for this class was generated from the following file: