C# Class iTextSharp.text.Document

A generic Document class.
All kinds of Text-elements can be added to a HTMLDocument. The Document signals all the listeners when an element has been added.

  1. Once a document is created you can add some meta information.
  2. You can also set the headers/footers.
  3. You have to open the document before you can write content.
  4. You can only write content (no more meta-formation!) once a document is opened.
  5. When you change the header/footer on a certain page, this will be effective starting on the next page.
  6. Ater closing the document, every listener (as well as its OutputStream) is closed too.
Inheritance: IDocListener
Afficher le fichier Open project: mapo80/iTextSharp-Monotouch Class Usage Examples

Méthodes publiques

Свойство Type Description
Compress bool
WmfFontCorrection float

Protected Properties

Свойство Type Description
chapternumber int
close bool
htmlStyleClass string
javaScript_onLoad string
javaScript_onUnLoad string
listeners List
marginBottom float
marginLeft float
marginMirroring bool
marginMirroringTopBottom bool
marginRight float
marginTop float
open bool
pageN int
pageSize Rectangle

Méthodes publiques

Méthode Description
Add ( IElement element ) : bool

Adds an Element to the Document.

AddAuthor ( string author ) : bool

Adds the author to a Document.

AddCreationDate ( ) : bool

Adds the current date and time to a Document.

AddCreator ( string creator ) : bool

Adds the creator to a Document.

AddDocListener ( IDocListener listener ) : void

Adds a IDocListener to the Document.

AddHeader ( string name, string content ) : bool

Adds a user defined header to the document.

AddKeywords ( string keywords ) : bool

Adds the keywords to a Document.

AddProducer ( ) : bool

Adds the producer to a Document.

AddSubject ( string subject ) : bool

Adds the subject to a Document.

AddTitle ( string title ) : bool

Adds the title to a Document.

Close ( ) : void

Closes the document.

Once all the content has been written in the body, you have to close the body. After that nothing can be written to the body anymore.

CloseDocument ( ) : void

Closes the document.

Version for languages that are not case-dependant. Once all the content has been written in the body, you have to close the body. After that nothing can be written to the body anymore.

Dispose ( ) : void
Document ( ) : System

Constructs a new Document-object.

Document ( Rectangle pageSize ) : System

Constructs a new Document-object.

Document ( Rectangle pageSize, float marginLeft, float marginRight, float marginTop, float marginBottom ) : System

Constructs a new Document-object.

GetBottom ( float margin ) : float

Returns the lower left y-coordinate, considering a given margin.

GetLeft ( float margin ) : float

Returns the lower left x-coordinate considering a given margin.

GetRight ( float margin ) : float

Returns the upper right x-coordinate, considering a given margin.

GetTop ( float margin ) : float

Returns the upper right y-coordinate, considering a given margin.

IsMarginMirroring ( ) : bool
IsOpen ( ) : bool

Checks if the document is open.

NewPage ( ) : bool

Signals that an new page has to be started.

Open ( ) : void

Opens the document.

Once the document is opened, you can't write any Header- or Meta-information anymore. You have to open the document before you can begin to add content to the body of the document.

OpenDocument ( ) : void

Opens the document.

Version for languages that are not case-dependant. Once the document is opened, you can't write any Header- or Meta-information anymore. You have to open the document before you can begin to add content to the body of the document.

RemoveIDocListener ( IDocListener listener ) : void

Removes a IDocListener from the Document.

ResetPageCount ( ) : void

Sets the page number to 0.

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

Sets the margins.

SetPageSize ( Rectangle pageSize ) : bool

Sets the pagesize.

Method Details

Add() public méthode

Adds an Element to the Document.
public Add ( IElement element ) : bool
element IElement the Element to add
Résultat bool

AddAuthor() public méthode

Adds the author to a Document.
public AddAuthor ( string author ) : bool
author string the name of the author
Résultat bool

AddCreationDate() public méthode

Adds the current date and time to a Document.
public AddCreationDate ( ) : bool
Résultat bool

AddCreator() public méthode

Adds the creator to a Document.
public AddCreator ( string creator ) : bool
creator string the name of the creator
Résultat bool

AddDocListener() public méthode

Adds a IDocListener to the Document.
public AddDocListener ( IDocListener listener ) : void
listener IDocListener the new IDocListener
Résultat void

AddHeader() public méthode

Adds a user defined header to the document.
public AddHeader ( string name, string content ) : bool
name string the name of the header
content string the content of the header
Résultat bool

AddKeywords() public méthode

Adds the keywords to a Document.
public AddKeywords ( string keywords ) : bool
keywords string keywords to add
Résultat bool

AddProducer() public méthode

Adds the producer to a Document.
public AddProducer ( ) : bool
Résultat bool

AddSubject() public méthode

Adds the subject to a Document.
public AddSubject ( string subject ) : bool
subject string the subject
Résultat bool

AddTitle() public méthode

Adds the title to a Document.
public AddTitle ( string title ) : bool
title string the title
Résultat bool

Close() public méthode

Closes the document.
Once all the content has been written in the body, you have to close the body. After that nothing can be written to the body anymore.
public Close ( ) : void
Résultat void

CloseDocument() public méthode

Closes the document.
Version for languages that are not case-dependant. Once all the content has been written in the body, you have to close the body. After that nothing can be written to the body anymore.
public CloseDocument ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Document() public méthode

Constructs a new Document-object.
public Document ( ) : System
Résultat System

Document() public méthode

Constructs a new Document-object.
public Document ( Rectangle pageSize ) : System
pageSize Rectangle the pageSize
Résultat System

Document() public méthode

Constructs a new Document-object.
public Document ( Rectangle pageSize, float marginLeft, float marginRight, float marginTop, float marginBottom ) : System
pageSize Rectangle the pageSize
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
Résultat System

GetBottom() public méthode

Returns the lower left y-coordinate, considering a given margin.
public GetBottom ( float margin ) : float
margin float a margin
Résultat float

GetLeft() public méthode

Returns the lower left x-coordinate considering a given margin.
public GetLeft ( float margin ) : float
margin float a margin
Résultat float

GetRight() public méthode

Returns the upper right x-coordinate, considering a given margin.
public GetRight ( float margin ) : float
margin float a margin
Résultat float

GetTop() public méthode

Returns the upper right y-coordinate, considering a given margin.
public GetTop ( float margin ) : float
margin float a margin
Résultat float

IsMarginMirroring() public méthode

public IsMarginMirroring ( ) : bool
Résultat bool

IsOpen() public méthode

Checks if the document is open.
public IsOpen ( ) : bool
Résultat bool

NewPage() public méthode

Signals that an new page has to be started.
public NewPage ( ) : bool
Résultat bool

Open() public méthode

Opens the document.
Once the document is opened, you can't write any Header- or Meta-information anymore. You have to open the document before you can begin to add content to the body of the document.
public Open ( ) : void
Résultat void

OpenDocument() public méthode

Opens the document.
Version for languages that are not case-dependant. Once the document is opened, you can't write any Header- or Meta-information anymore. You have to open the document before you can begin to add content to the body of the document.
public OpenDocument ( ) : void
Résultat void

RemoveIDocListener() public méthode

Removes a IDocListener from the Document.
public RemoveIDocListener ( IDocListener listener ) : void
listener IDocListener the IDocListener that has to be removed.
Résultat void

ResetPageCount() public méthode

Sets the page number to 0.
public ResetPageCount ( ) : void
Résultat void

SetMarginMirroring() public méthode

public SetMarginMirroring ( bool marginMirroring ) : bool
marginMirroring bool
Résultat bool

SetMarginMirroringTopBottom() public méthode

public SetMarginMirroringTopBottom ( bool marginMirroringTopBottom ) : bool
marginMirroringTopBottom bool
Résultat bool

SetMargins() public méthode

Sets the margins.
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
Résultat bool

SetPageSize() public méthode

Sets the pagesize.
public SetPageSize ( Rectangle pageSize ) : bool
pageSize Rectangle the new pagesize
Résultat bool

Property Details

Compress public_oe static_oe property

Allows the pdf documents to be produced without compression for debugging purposes.
public static bool Compress
Résultat bool

WmfFontCorrection public_oe static_oe property

Scales the WMF font size. The default value is 0.86.
public static float WmfFontCorrection
Résultat float

chapternumber protected_oe property

protected int chapternumber
Résultat int

close protected_oe property

Has the document already been closed?
protected bool close
Résultat bool

htmlStyleClass protected_oe property

Style class in HTML body tag
protected string htmlStyleClass
Résultat string

javaScript_onLoad protected_oe property

Content of JavaScript onLoad function
protected string javaScript_onLoad
Résultat string

javaScript_onUnLoad protected_oe property

Content of JavaScript onUnLoad function
protected string javaScript_onUnLoad
Résultat string

listeners protected_oe property

The IDocListener.
protected List listeners
Résultat List

marginBottom protected_oe property

margin in y direction starting from the bottom
protected float marginBottom
Résultat float

marginLeft protected_oe property

margin in x direction starting from the left
protected float marginLeft
Résultat float

marginMirroring protected_oe property

protected bool marginMirroring
Résultat bool

marginMirroringTopBottom protected_oe property

protected bool marginMirroringTopBottom
Résultat bool

marginRight protected_oe property

margin in x direction starting from the right
protected float marginRight
Résultat float

marginTop protected_oe property

margin in y direction starting from the top
protected float marginTop
Résultat float

open protected_oe property

Is the document open or not?
protected bool open
Résultat bool

pageN protected_oe property

Current pagenumber
protected int pageN
Résultat int

pageSize protected_oe property

The size of the page.
protected Rectangle,iTextSharp.text pageSize
Résultat Rectangle